diff --git a/java_console/autotest/src/com/rusefi/FunctionalTest.java b/java_console/autotest/src/com/rusefi/FunctionalTest.java index a89d1e609d..2a67a77798 100644 --- a/java_console/autotest/src/com/rusefi/FunctionalTest.java +++ b/java_console/autotest/src/com/rusefi/FunctionalTest.java @@ -22,15 +22,8 @@ import static com.rusefi.config.generated.Fields.*; * @author Andrey Belomutskiy * 3/5/14 */ -public class FunctionalTest { - private EcuTestHelper ecu; - - @Before - public void startUp() { - ecu = EcuTestHelper.createInstance(); - } - - @Test +public class FunctionalTest extends RusefiTestBase { + @Test public void testChangingIgnitionMode() { String msg = "change ign mode"; @@ -61,7 +54,7 @@ public class FunctionalTest { EngineChart chart = nextChart(); // All 4 cylinders should be firing - assertWaveNotNull(chart, EngineChart.SPARK_1); + assertWaveNotNull(chart, EngineChart.SPARK_1); assertWaveNotNull(chart, EngineChart.SPARK_2); assertWaveNotNull(chart, EngineChart.SPARK_3); assertWaveNotNull(chart, EngineChart.SPARK_4); diff --git a/java_console/autotest/src/com/rusefi/HighRevTest.java b/java_console/autotest/src/com/rusefi/HighRevTest.java index 634d8041eb..fce15d99d6 100644 --- a/java_console/autotest/src/com/rusefi/HighRevTest.java +++ b/java_console/autotest/src/com/rusefi/HighRevTest.java @@ -7,11 +7,9 @@ import org.junit.Test; import static com.rusefi.functional_tests.EcuTestHelper.FAIL; import static com.rusefi.config.generated.Fields.*; -public class HighRevTest { +public class HighRevTest extends RusefiTestBase { @Test public void testVW() { - EcuTestHelper ecu = EcuTestHelper.createInstance(); - ecu.setEngineType(ET_VW_ABA); // trying to disable engine sniffer to help https://github.com/rusefi/rusefi/issues/1849 ecu.sendCommand("set " + CMD_ENGINESNIFFERRPMTHRESHOLD + " 100"); @@ -22,15 +20,12 @@ public class HighRevTest { @Test public void testV12() { - EcuTestHelper ecu = EcuTestHelper.createInstance(); ecu.setEngineType(ET_BMW_M73_F); ecu.changeRpm(700); // first let's get to expected RPM EcuTestHelper.assertRpmDoesNotJump(6000, 5, 40, FAIL, ecu.commandQueue); - testCaseBug1873(ecu); - } - private void testCaseBug1873(EcuTestHelper ecu) { + // tests bug 1873 EcuTestHelper.assertRpmDoesNotJump(60, 5, 110, FAIL, ecu.commandQueue); } } diff --git a/java_console/autotest/src/com/rusefi/MiscTest.java b/java_console/autotest/src/com/rusefi/MiscTest.java index 3ef8609906..058564de13 100644 --- a/java_console/autotest/src/com/rusefi/MiscTest.java +++ b/java_console/autotest/src/com/rusefi/MiscTest.java @@ -5,11 +5,9 @@ import com.rusefi.functional_tests.EcuTestHelper; import org.junit.Ignore; import org.junit.Test; -public class MiscTest { +public class MiscTest extends RusefiTestBase { @Test public void burn() { - EcuTestHelper ecu = EcuTestHelper.createInstance(); - BinaryProtocol bp = ecu.getLinkManager().getCurrentStreamState(); // let's make sure 'burn' command works since sometimes it does not bp.burn(); diff --git a/java_console/autotest/src/com/rusefi/PwmHardwareTest.java b/java_console/autotest/src/com/rusefi/PwmHardwareTest.java index e82790dde8..0d31d46f93 100644 --- a/java_console/autotest/src/com/rusefi/PwmHardwareTest.java +++ b/java_console/autotest/src/com/rusefi/PwmHardwareTest.java @@ -18,13 +18,17 @@ import static com.rusefi.config.generated.Fields.*; * PD2<>PA5 */ -public class PwmHardwareTest { +public class PwmHardwareTest extends RusefiTestBase { + @Override + boolean needsHardwareTriggerInput() { + // This test uses hardware trigger input! + return true; + } + private static final int FREQUENCY = 160; @Test public void testIdlePin() { - EcuTestHelper ecu = EcuTestHelper.createInstance(true); - ecu.setEngineType(ET_FRANKENSO_MIATA_NA6); ecu.sendCommand(getDisableCommand(Fields.CMD_SELF_STIMULATION)); ecu.changeRpm(1000); diff --git a/java_console/autotest/src/com/rusefi/RusefiTestBase.java b/java_console/autotest/src/com/rusefi/RusefiTestBase.java new file mode 100644 index 0000000000..855e825687 --- /dev/null +++ b/java_console/autotest/src/com/rusefi/RusefiTestBase.java @@ -0,0 +1,18 @@ +package com.rusefi; + +import com.rusefi.functional_tests.EcuTestHelper; +import org.junit.Before; + +public class RusefiTestBase { + protected EcuTestHelper ecu; + + boolean needsHardwareTriggerInput() { + // Most tests do not, but some may need it + return false; + } + + @Before + public void startUp() { + ecu = EcuTestHelper.createInstance(needsHardwareTriggerInput()); + } +} diff --git a/java_console/autotest/src/com/rusefi/VssHardwareLoopTest.java b/java_console/autotest/src/com/rusefi/VssHardwareLoopTest.java index f5a3bec540..d6a494d230 100644 --- a/java_console/autotest/src/com/rusefi/VssHardwareLoopTest.java +++ b/java_console/autotest/src/com/rusefi/VssHardwareLoopTest.java @@ -16,11 +16,15 @@ import static com.rusefi.config.generated.Fields.*; * PD1<>PC6 * PD2<>PA5 */ -public class VssHardwareLoopTest { +public class VssHardwareLoopTest extends RusefiTestBase { + @Override + boolean needsHardwareTriggerInput() { + // This test uses hardware trigger input! + return true; + } + @Test public void test() { - EcuTestHelper ecu = EcuTestHelper.createInstance(true); - ecu.setEngineType(ET_FRANKENSO_MIATA_NA6); ecu.sendCommand(getDisableCommand(Fields.CMD_SELF_STIMULATION)); ecu.changeRpm(1400);