Skip to content

Commit

Permalink
chore: minor cleanup in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Sep 18, 2024
1 parent e77e69d commit 49a394a
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.orientechnologies.orient.core.command.OCommandRequestAbstract;
import com.orientechnologies.orient.core.fetch.OFetchHelper;

@SuppressWarnings("serial")
public abstract class OQueryAbstract<T extends Object> extends OCommandRequestAbstract
implements OQuery<T> {
public OQueryAbstract() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
* @param <T> Record type to return.
* @author Luca Garulli (l.garulli--(at)--orientdb.com)
*/
@SuppressWarnings("serial")
public abstract class OSQLQuery<T> extends OQueryAbstract<T> implements OCommandRequestText {
protected String text;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -124,7 +126,7 @@ public void testParamCountOneItem() {

@Test
public void testGetKeyTypes() {
Assert.assertEquals(
assertArrayEquals(
simpleKeyIndexDefinition.getTypes(), new OType[] {OType.INTEGER, OType.STRING});
}

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,6 @@ public void testUpdateInChain() {
}

public void testSerialization() {
@SuppressWarnings("deprecation")
ORecordSerializer current = ODatabaseDocumentAbstract.getDefaultSerializer();
//noinspection deprecation
ODatabaseDocumentAbstract.setDefaultSerializer(ORecordSerializerSchemaAware2CSV.INSTANCE);
Expand Down

0 comments on commit 49a394a

Please sign in to comment.