diff --git a/core/src/main/java/com/orientechnologies/orient/core/query/OQueryAbstract.java b/core/src/main/java/com/orientechnologies/orient/core/query/OQueryAbstract.java index b35eb5ff586..82fec40a752 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/query/OQueryAbstract.java +++ b/core/src/main/java/com/orientechnologies/orient/core/query/OQueryAbstract.java @@ -22,7 +22,6 @@ import com.orientechnologies.orient.core.command.OCommandRequestAbstract; import com.orientechnologies.orient.core.fetch.OFetchHelper; -@SuppressWarnings("serial") public abstract class OQueryAbstract extends OCommandRequestAbstract implements OQuery { public OQueryAbstract() { diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/query/OSQLQuery.java b/core/src/main/java/com/orientechnologies/orient/core/sql/query/OSQLQuery.java index afe7593fcb6..adef90b56d7 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/query/OSQLQuery.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/query/OSQLQuery.java @@ -50,7 +50,6 @@ * @param Record type to return. * @author Luca Garulli (l.garulli--(at)--orientdb.com) */ -@SuppressWarnings("serial") public abstract class OSQLQuery extends OQueryAbstract implements OCommandRequestText { protected String text; diff --git a/core/src/test/java/com/orientechnologies/orient/core/index/OSimpleKeyIndexDefinitionTest.java b/core/src/test/java/com/orientechnologies/orient/core/index/OSimpleKeyIndexDefinitionTest.java index 68658f7b8fe..0ffa424c7f3 100755 --- a/core/src/test/java/com/orientechnologies/orient/core/index/OSimpleKeyIndexDefinitionTest.java +++ b/core/src/test/java/com/orientechnologies/orient/core/index/OSimpleKeyIndexDefinitionTest.java @@ -1,5 +1,7 @@ package com.orientechnologies.orient.core.index; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; + import com.orientechnologies.orient.core.db.OrientDB; import com.orientechnologies.orient.core.db.OrientDBConfig; import com.orientechnologies.orient.core.db.document.ODatabaseDocument; @@ -124,7 +126,7 @@ public void testParamCountOneItem() { @Test public void testGetKeyTypes() { - Assert.assertEquals( + assertArrayEquals( simpleKeyIndexDefinition.getTypes(), new OType[] {OType.INTEGER, OType.STRING}); } @@ -133,7 +135,7 @@ public void testGetKeyTypesOneType() { final OSimpleKeyIndexDefinition keyIndexDefinition = new OSimpleKeyIndexDefinition(OType.BOOLEAN); - Assert.assertEquals(keyIndexDefinition.getTypes(), new OType[] {OType.BOOLEAN}); + assertArrayEquals(keyIndexDefinition.getTypes(), new OType[] {OType.BOOLEAN}); } @Test diff --git a/core/src/test/java/com/orientechnologies/orient/core/record/impl/ODocumentSchemalessBinarySerializationTest.java b/core/src/test/java/com/orientechnologies/orient/core/record/impl/ODocumentSchemalessBinarySerializationTest.java index 9c2c6a3066e..9e784c5b437 100755 --- a/core/src/test/java/com/orientechnologies/orient/core/record/impl/ODocumentSchemalessBinarySerializationTest.java +++ b/core/src/test/java/com/orientechnologies/orient/core/record/impl/ODocumentSchemalessBinarySerializationTest.java @@ -4,6 +4,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; import com.orientechnologies.orient.core.config.OGlobalConfiguration; import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; @@ -242,12 +243,12 @@ public void testSimpleLiteralArray() { ODocument extr = (ODocument) serializer.fromStream(res, new ODocument(), new String[] {}); assertEquals(extr.fields(), document.fields()); - assertEquals(((List) extr.field("listStrings")).toArray(), document.field("listStrings")); - assertEquals(((List) extr.field("integers")).toArray(), document.field("integers")); - assertEquals(((List) extr.field("doubles")).toArray(), document.field("doubles")); - assertEquals(((List) extr.field("dates")).toArray(), document.field("dates")); - assertEquals(((List) extr.field("bytes")).toArray(), document.field("bytes")); - assertEquals(((List) extr.field("booleans")).toArray(), document.field("booleans")); + assertArrayEquals(((List) extr.field("listStrings")).toArray(), document.field("listStrings")); + assertArrayEquals(((List) extr.field("integers")).toArray(), document.field("integers")); + assertArrayEquals(((List) extr.field("doubles")).toArray(), document.field("doubles")); + assertArrayEquals(((List) extr.field("dates")).toArray(), document.field("dates")); + assertArrayEquals(((List) extr.field("bytes")).toArray(), document.field("bytes")); + assertArrayEquals(((List) extr.field("booleans")).toArray(), document.field("booleans")); // assertEquals(((List) extr.field("arrayNulls")).toArray(), document.field("arrayNulls")); // assertEquals(extr.field("listMixed"), document.field("listMixed")); } diff --git a/core/src/test/java/com/orientechnologies/orient/core/record/impl/ODocumentSerializerDeltaTest.java b/core/src/test/java/com/orientechnologies/orient/core/record/impl/ODocumentSerializerDeltaTest.java index 31e1907537b..c93ee3fa3c0 100755 --- a/core/src/test/java/com/orientechnologies/orient/core/record/impl/ODocumentSerializerDeltaTest.java +++ b/core/src/test/java/com/orientechnologies/orient/core/record/impl/ODocumentSerializerDeltaTest.java @@ -1,5 +1,6 @@ package com.orientechnologies.orient.core.record.impl; +import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -1624,12 +1625,12 @@ public void testSimpleLiteralArray() { serializerDelta.deserialize(res, extr); assertEquals(extr.fields(), document.fields()); - assertEquals(((List) extr.field("listStrings")).toArray(), document.field("listStrings")); - assertEquals(((List) extr.field("integers")).toArray(), document.field("integers")); - assertEquals(((List) extr.field("doubles")).toArray(), document.field("doubles")); - assertEquals(((List) extr.field("dates")).toArray(), document.field("dates")); - assertEquals(((List) extr.field("bytes")).toArray(), document.field("bytes")); - assertEquals(((List) extr.field("booleans")).toArray(), document.field("booleans")); + assertArrayEquals(((List) extr.field("listStrings")).toArray(), document.field("listStrings")); + assertArrayEquals(((List) extr.field("integers")).toArray(), document.field("integers")); + assertArrayEquals(((List) extr.field("doubles")).toArray(), document.field("doubles")); + assertArrayEquals(((List) extr.field("dates")).toArray(), document.field("dates")); + assertArrayEquals(((List) extr.field("bytes")).toArray(), document.field("bytes")); + assertArrayEquals(((List) extr.field("booleans")).toArray(), document.field("booleans")); // assertEquals(((List) extr.field("arrayNulls")).toArray(), document.field("arrayNulls")); // assertEquals(extr.field("listMixed"), document.field("listMixed")); } diff --git a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/AbstractServerClusterSQLGraphTest.java b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/AbstractServerClusterSQLGraphTest.java index d43bdf809f2..7f09bea2123 100755 --- a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/AbstractServerClusterSQLGraphTest.java +++ b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/AbstractServerClusterSQLGraphTest.java @@ -20,6 +20,7 @@ package com.orientechnologies.orient.server.distributed; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import com.orientechnologies.orient.core.db.ODatabasePool; @@ -35,7 +36,6 @@ import java.util.Date; import java.util.UUID; import java.util.concurrent.Callable; -import junit.framework.Assert; /** Test distributed TX */ public abstract class AbstractServerClusterSQLGraphTest extends AbstractServerClusterInsertTest { @@ -80,18 +80,18 @@ public Void call() throws Exception { OEdge knows = createEdge(graph, person1, person2); - Assert.assertEquals(knows.getFrom(), person1.getIdentity()); - Assert.assertEquals(knows.getTo(), person2.getIdentity()); + assertEquals(knows.getFrom(), person1.getIdentity()); + assertEquals(knows.getTo(), person2.getIdentity()); graph.commit(); updateVertex(graph, person1); checkVertex(graph, person1); - Assert.assertTrue(person1.getIdentity().isPersistent()); + assertTrue(person1.getIdentity().isPersistent()); updateVertex(graph, person2); checkVertex(graph, person2); - Assert.assertTrue(person2.getIdentity().isPersistent()); + assertTrue(person2.getIdentity().isPersistent()); } catch (Exception e) { graph.rollback(); throw e; diff --git a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/ThreeClientsRecordUpdateWithTransactionsOnMultipleServersScenarioIT.java b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/ThreeClientsRecordUpdateWithTransactionsOnMultipleServersScenarioIT.java index 8451ba7dd55..259ff1941de 100644 --- a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/ThreeClientsRecordUpdateWithTransactionsOnMultipleServersScenarioIT.java +++ b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/ThreeClientsRecordUpdateWithTransactionsOnMultipleServersScenarioIT.java @@ -102,15 +102,15 @@ public void executeTest() throws Exception { // retrieves record1 from server2 and server 3 and checks they're equal ODocument record1Server2 = retrieveRecord(serverInstance.get(1), RECORD_ID); assertEquals(record1Server2.getVersion(), record1Server1.getVersion()); - assertEquals(record1Server2.field("id"), record1Server1.field("id")); - assertEquals(record1Server2.field("firstName"), record1Server1.field("firstName")); - assertEquals(record1Server2.field("lastName"), record1Server1.field("lastName")); + assertEquals((Object) record1Server2.field("id"), record1Server1.field("id")); + assertEquals((Object) record1Server2.field("firstName"), record1Server1.field("firstName")); + assertEquals((Object) record1Server2.field("lastName"), record1Server1.field("lastName")); ODocument record1Server3 = retrieveRecord(serverInstance.get(2), RECORD_ID); assertEquals(record1Server3.getVersion(), record1Server1.getVersion()); - assertEquals(record1Server3.field("id"), record1Server1.field("id")); - assertEquals(record1Server3.field("firstName"), record1Server1.field("firstName")); - assertEquals(record1Server3.field("lastName"), record1Server1.field("lastName")); + assertEquals((Object) (Object) record1Server3.field("id"), record1Server1.field("id")); + assertEquals((Object) record1Server3.field("firstName"), record1Server1.field("firstName")); + assertEquals((Object) record1Server3.field("lastName"), record1Server1.field("lastName")); // gets the actual version of the record1 int actualVersion = record1Server1.getVersion(); diff --git a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/TwoClientsRecordUpdateTxOnTwoServersWithQuorum2ScenarioIT.java b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/TwoClientsRecordUpdateTxOnTwoServersWithQuorum2ScenarioIT.java index a4674b74929..0e1bab8eb2b 100644 --- a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/TwoClientsRecordUpdateTxOnTwoServersWithQuorum2ScenarioIT.java +++ b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/scenariotest/TwoClientsRecordUpdateTxOnTwoServersWithQuorum2ScenarioIT.java @@ -87,9 +87,9 @@ public void executeTest() throws Exception { // retrieves record from server1 and checks they're equal ODocument recordServer1 = retrieveRecord(serverInstance.get(1), RECORD_ID); assertEquals(recordServer1.getVersion(), recordServer0.getVersion()); - assertEquals(recordServer1.field("id"), recordServer0.field("id")); - assertEquals(recordServer1.field("firstName"), recordServer0.field("firstName")); - assertEquals(recordServer1.field("lastName"), recordServer0.field("lastName")); + assertEquals((Object) recordServer1.field("id"), recordServer0.field("id")); + assertEquals((Object) recordServer1.field("firstName"), recordServer0.field("firstName")); + assertEquals((Object) recordServer1.field("lastName"), recordServer0.field("lastName")); // gets the actual version of record from server0 int actualVersion = recordServer0.getVersion(); diff --git a/distribution/src/test/java/com/orientechnologies/distribution/integration/OSingleOrientDBServerBaseIT.java b/distribution/src/test/java/com/orientechnologies/distribution/integration/OSingleOrientDBServerBaseIT.java index d63880bc588..74bb55a4d75 100644 --- a/distribution/src/test/java/com/orientechnologies/distribution/integration/OSingleOrientDBServerBaseIT.java +++ b/distribution/src/test/java/com/orientechnologies/distribution/integration/OSingleOrientDBServerBaseIT.java @@ -1,5 +1,7 @@ package com.orientechnologies.distribution.integration; +import com.orientechnologies.orient.core.db.ODatabasePool; +import com.orientechnologies.orient.core.db.OrientDB; import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Rule; @@ -10,9 +12,6 @@ import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.containers.wait.strategy.Wait; -import com.orientechnologies.orient.core.db.ODatabasePool; -import com.orientechnologies.orient.core.db.OrientDB; - public abstract class OSingleOrientDBServerBaseIT { private static final Logger LOGGER = LoggerFactory.getLogger(OSingleOrientDBServerBaseIT.class); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDDocumentPhysicalTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDDocumentPhysicalTest.java index acc24beefdc..2c866e8b0dc 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDDocumentPhysicalTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/CRUDDocumentPhysicalTest.java @@ -818,7 +818,6 @@ public void testUpdateInChain() { } public void testSerialization() { - @SuppressWarnings("deprecation") ORecordSerializer current = ODatabaseDocumentAbstract.getDefaultSerializer(); //noinspection deprecation ODatabaseDocumentAbstract.setDefaultSerializer(ORecordSerializerSchemaAware2CSV.INSTANCE);