mirror of https://github.com/rusefi/rusefi.git
only:junit5
This commit is contained in:
parent
436ce3f932
commit
77f932e1af
|
@ -1,9 +1,9 @@
|
||||||
package com.opensr5.ini.test;
|
package com.opensr5.ini.test;
|
||||||
|
|
||||||
import com.opensr5.ini.field.EnumIniField;
|
import com.opensr5.ini.field.EnumIniField;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
public class IniEnumDecoderTest {
|
public class IniEnumDecoderTest {
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -5,12 +5,12 @@ import com.opensr5.ini.field.ArrayIniField;
|
||||||
import com.opensr5.ini.field.EnumIniField;
|
import com.opensr5.ini.field.EnumIniField;
|
||||||
import com.opensr5.ini.field.IniField;
|
import com.opensr5.ini.field.IniField;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Andrey Belomutskiy, (c) 2013-2020
|
* Andrey Belomutskiy, (c) 2013-2020
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.rusefi.core.io;
|
package com.rusefi.core.io;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,8 @@ import com.rusefi.ui.livedata.SourceCodePainter;
|
||||||
import com.rusefi.ui.livedata.VariableValueSource;
|
import com.rusefi.ui.livedata.VariableValueSource;
|
||||||
import org.antlr.v4.runtime.tree.ParseTree;
|
import org.antlr.v4.runtime.tree.ParseTree;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Disabled;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
@ -19,7 +20,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
public class LiveDataConventionTest {
|
public class LiveDataConventionTest {
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
@Disabled
|
||||||
public void assertLiveDataConvention() throws IOException, URISyntaxException {
|
public void assertLiveDataConvention() throws IOException, URISyntaxException {
|
||||||
for (live_data_e view : live_data_e.values()) {
|
for (live_data_e view : live_data_e.values()) {
|
||||||
String fileName = StateDictionary.INSTANCE.getFileName(view) + CPP_SUFFIX;
|
String fileName = StateDictionary.INSTANCE.getFileName(view) + CPP_SUFFIX;
|
||||||
|
|
|
@ -19,8 +19,8 @@ import com.rusefi.proxy.client.UpdateType;
|
||||||
import com.rusefi.server.*;
|
import com.rusefi.server.*;
|
||||||
import com.rusefi.tools.online.HttpUtil;
|
import com.rusefi.tools.online.HttpUtil;
|
||||||
import org.apache.http.HttpResponse;
|
import org.apache.http.HttpResponse;
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
@ -36,7 +36,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
public class FullServerTest {
|
public class FullServerTest {
|
||||||
private static final Logging log = getLogging(FullServerTest.class);
|
private static final Logging log = getLogging(FullServerTest.class);
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
public void setup() throws MalformedURLException {
|
public void setup() throws MalformedURLException {
|
||||||
BackendTestHelper.commonServerTest();
|
BackendTestHelper.commonServerTest();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@ import com.rusefi.server.*;
|
||||||
import com.rusefi.tools.online.HttpUtil;
|
import com.rusefi.tools.online.HttpUtil;
|
||||||
import com.rusefi.tools.online.ProxyClient;
|
import com.rusefi.tools.online.ProxyClient;
|
||||||
import com.rusefi.tools.online.PublicSession;
|
import com.rusefi.tools.online.PublicSession;
|
||||||
import org.junit.Before;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
@ -33,7 +33,7 @@ import static org.junit.Assert.assertEquals;
|
||||||
* https://github.com/rusefi/web_backend/blob/master/documentation/rusEFI%20remote.png
|
* https://github.com/rusefi/web_backend/blob/master/documentation/rusEFI%20remote.png
|
||||||
*/
|
*/
|
||||||
public class ServerTest {
|
public class ServerTest {
|
||||||
@Before
|
@BeforeEach
|
||||||
public void setup() throws MalformedURLException {
|
public void setup() throws MalformedURLException {
|
||||||
BackendTestHelper.commonServerTest();
|
BackendTestHelper.commonServerTest();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,8 @@ import com.rusefi.io.tcp.BinaryProtocolServer;
|
||||||
import com.rusefi.io.tcp.TcpConnector;
|
import com.rusefi.io.tcp.TcpConnector;
|
||||||
import com.rusefi.server.Backend;
|
import com.rusefi.server.Backend;
|
||||||
import com.rusefi.server.ControllerConnectionState;
|
import com.rusefi.server.ControllerConnectionState;
|
||||||
import org.junit.Before;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
@ -23,7 +23,7 @@ import static com.rusefi.binaryprotocol.BinaryProtocol.sleep;
|
||||||
public class NetworkConnectorTest {
|
public class NetworkConnectorTest {
|
||||||
private static final Logging log = getLogging(NetworkConnectorTest.class);
|
private static final Logging log = getLogging(NetworkConnectorTest.class);
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
public void setup() throws MalformedURLException {
|
public void setup() throws MalformedURLException {
|
||||||
BackendTestHelper.commonServerTest();
|
BackendTestHelper.commonServerTest();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,8 @@ import com.rusefi.server.SessionDetails;
|
||||||
import com.rusefi.tools.online.ProxyClient;
|
import com.rusefi.tools.online.ProxyClient;
|
||||||
import com.rusefi.ui.StatusConsumer;
|
import com.rusefi.ui.StatusConsumer;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.junit.Before;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
@ -25,7 +25,6 @@ import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import static com.rusefi.BackendTestHelper.createTestUserResolver;
|
|
||||||
import static com.rusefi.TestHelper.*;
|
import static com.rusefi.TestHelper.*;
|
||||||
import static com.rusefi.Timeouts.SECOND;
|
import static com.rusefi.Timeouts.SECOND;
|
||||||
import static com.rusefi.binaryprotocol.BinaryProtocol.findCommand;
|
import static com.rusefi.binaryprotocol.BinaryProtocol.findCommand;
|
||||||
|
@ -34,12 +33,12 @@ import static com.rusefi.config.generated.Fields.TS_PROTOCOL;
|
||||||
import static com.rusefi.io.tcp.BinaryProtocolServer.getPacketLength;
|
import static com.rusefi.io.tcp.BinaryProtocolServer.getPacketLength;
|
||||||
import static com.rusefi.io.tcp.TcpConnector.LOCALHOST;
|
import static com.rusefi.io.tcp.TcpConnector.LOCALHOST;
|
||||||
import static com.rusefi.core.FileUtil.close;
|
import static com.rusefi.core.FileUtil.close;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
public class LocalApplicationProxyTest {
|
public class LocalApplicationProxyTest {
|
||||||
private static final AtomicInteger portNumber = new AtomicInteger(4000);
|
private static final AtomicInteger portNumber = new AtomicInteger(4000);
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
public void setup() throws MalformedURLException {
|
public void setup() throws MalformedURLException {
|
||||||
BackendTestHelper.commonServerTest();
|
BackendTestHelper.commonServerTest();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.rusefi.server;
|
package com.rusefi.server;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static com.rusefi.Timeouts.MINUTE;
|
import static com.rusefi.Timeouts.MINUTE;
|
||||||
import static com.rusefi.Timeouts.SECOND;
|
import static com.rusefi.Timeouts.SECOND;
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.rusefi.server;
|
||||||
import com.rusefi.TestHelper;
|
import com.rusefi.TestHelper;
|
||||||
import com.rusefi.proxy.NetworkConnector;
|
import com.rusefi.proxy.NetworkConnector;
|
||||||
import com.rusefi.core.rusEFIVersion;
|
import com.rusefi.core.rusEFIVersion;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.rusefi.server;
|
package com.rusefi.server;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
public class TwoKindSemaphoreTest {
|
public class TwoKindSemaphoreTest {
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.rusefi;
|
package com.rusefi;
|
||||||
|
|
||||||
import com.rusefi.core.SignatureHelper;
|
import com.rusefi.core.SignatureHelper;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.rusefi.ts_plugin;
|
package com.rusefi.ts_plugin;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,10 @@ import com.rusefi.tools.tune.TuneTools;
|
||||||
import com.rusefi.tune.xml.Msq;
|
import com.rusefi.tune.xml.Msq;
|
||||||
import com.rusefi.tune.xml.Page;
|
import com.rusefi.tune.xml.Page;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.function.ThrowingRunnable;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
|
|
||||||
public class LoadOlderTuneTest {
|
public class LoadOlderTuneTest {
|
||||||
@Test
|
@Test
|
||||||
|
@ -127,11 +127,13 @@ public class LoadOlderTuneTest {
|
||||||
" // defa", sb.substring(0, 3500));
|
" // defa", sb.substring(0, 3500));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalStateException.class)
|
@Test
|
||||||
public void testLegacyCustomEnumOrdinal() {
|
public void testLegacyCustomEnumOrdinal() {
|
||||||
|
assertThrows(IllegalStateException.class, () -> {
|
||||||
String tsCustomLine = "bits, U08, @OFFSET@, [0:1], \"Single Coil\", \"Individual Coils\", \"Wasted Spark\", \"Two Distributors\"";
|
String tsCustomLine = "bits, U08, @OFFSET@, [0:1], \"Single Coil\", \"Individual Coils\", \"Wasted Spark\", \"Two Distributors\"";
|
||||||
|
|
||||||
Assert.assertEquals(0, TuneTools.resolveEnumByName(tsCustomLine, "One coil"));
|
Assert.assertEquals(0, TuneTools.resolveEnumByName(tsCustomLine, "One coil"));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.rusefi.tune;
|
||||||
|
|
||||||
import com.opensr5.ini.IniFileModel;
|
import com.opensr5.ini.IniFileModel;
|
||||||
import com.rusefi.tools.tune.WriteSimulatorConfiguration;
|
import com.rusefi.tools.tune.WriteSimulatorConfiguration;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,13 @@ import com.rusefi.tools.tune.TuneCanTool;
|
||||||
import com.rusefi.tune.xml.Constant;
|
import com.rusefi.tune.xml.Constant;
|
||||||
import com.rusefi.tune.xml.Msq;
|
import com.rusefi.tune.xml.Msq;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
public class TuneReadWriteTest {
|
public class TuneReadWriteTest {
|
||||||
private static final String PATH = TuneCanTool.SRC_TEST_RESOURCES + "frankenso/";
|
private static final String PATH = TuneCanTool.SRC_TEST_RESOURCES + "frankenso/";
|
||||||
|
@ -200,7 +200,7 @@ public class TuneReadWriteTest {
|
||||||
* Looks like I am not getting something right around Field#FIELD_PRECISION
|
* Looks like I am not getting something right around Field#FIELD_PRECISION
|
||||||
* See also TuneWriterTest :(
|
* See also TuneWriterTest :(
|
||||||
*/
|
*/
|
||||||
assertEquals("Binary match expected", 66, compareImages(binaryDataFromXml, fileBinaryData, model));
|
assertEquals(66, compareImages(binaryDataFromXml, fileBinaryData, model), "Binary match expected");
|
||||||
// todo: looks like this is not removing the temporary file?
|
// todo: looks like this is not removing the temporary file?
|
||||||
Files.delete(path);
|
Files.delete(path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue