diff --git a/e2e-ha/src/test/java/com/arcadedb/containers/ha/LeaderFailoverIT.java b/e2e-ha/src/test/java/com/arcadedb/containers/ha/LeaderFailoverIT.java index cc13a212335..ddb9f6de1f7 100644 --- a/e2e-ha/src/test/java/com/arcadedb/containers/ha/LeaderFailoverIT.java +++ b/e2e-ha/src/test/java/com/arcadedb/containers/ha/LeaderFailoverIT.java @@ -76,7 +76,7 @@ private int findLeaderIndex(final List servers) { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test leader failover: kill leader, verify new election and data consistency") - void testLeaderFailover() throws InterruptedException { + void leaderFailover() throws Exception { logger.info("Creating 3-node Raft HA cluster with majority quorum"); final GenericContainer arcade0 = createArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -181,7 +181,7 @@ void testLeaderFailover() throws InterruptedException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test repeated leader failures: verify cluster stability under continuous failover") - void testRepeatedLeaderFailures() throws InterruptedException { + void repeatedLeaderFailures() throws Exception { logger.info("Creating 3-node Raft HA cluster"); final GenericContainer arcade0 = createArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -317,7 +317,7 @@ void testRepeatedLeaderFailures() throws InterruptedException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test leader failover with active writes: verify no data loss during failover") - void testLeaderFailoverDuringWrites() throws InterruptedException { + void leaderFailoverDuringWrites() throws Exception { logger.info("Creating 3-node Raft HA cluster"); final GenericContainer arcade0 = createArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); diff --git a/e2e-ha/src/test/java/com/arcadedb/containers/ha/LoadThreeInstancesScenarioIT.java b/e2e-ha/src/test/java/com/arcadedb/containers/ha/LoadThreeInstancesScenarioIT.java index 0000be60abe..073b706b463 100644 --- a/e2e-ha/src/test/java/com/arcadedb/containers/ha/LoadThreeInstancesScenarioIT.java +++ b/e2e-ha/src/test/java/com/arcadedb/containers/ha/LoadThreeInstancesScenarioIT.java @@ -128,7 +128,7 @@ void threeNodeReplication() { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Three-node Raft HA: replication across all nodes with consistency check") - void threeNodeReplicationMulti() throws InterruptedException { + void threeNodeReplicationMulti() throws Exception { createArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); createArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); createArcadeContainer("arcadedb-2", SERVER_LIST, "majority", network); diff --git a/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkDelayIT.java b/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkDelayIT.java index 5be47337466..9bc51336e84 100644 --- a/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkDelayIT.java +++ b/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkDelayIT.java @@ -31,7 +31,6 @@ import org.junit.jupiter.api.Timeout; import org.testcontainers.junit.jupiter.Testcontainers; -import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; @@ -41,7 +40,7 @@ * Toxiproxy intercepts the Raft gRPC consensus port (2434) to inject faults. */ @Testcontainers -public class NetworkDelayIT extends ContainersTestTemplate { +class NetworkDelayIT extends ContainersTestTemplate { // Proxy ports for Raft (consensus) traffic per node private static final int RAFT_PROXY_PORT_0 = 8660; @@ -65,7 +64,7 @@ public class NetworkDelayIT extends ContainersTestTemplate { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test symmetric network delay: all nodes experience same latency") - void testSymmetricDelay() throws IOException { + void symmetricDelay() throws Exception { logger.info("Creating Raft and HTTP proxies for 3-node cluster"); final Proxy raftProxy0 = toxiproxyClient.createProxy("raftProxy0", "0.0.0.0:" + RAFT_PROXY_PORT_0, "arcadedb-0:2434"); final Proxy raftProxy1 = toxiproxyClient.createProxy("raftProxy1", "0.0.0.0:" + RAFT_PROXY_PORT_1, "arcadedb-1:2434"); @@ -144,7 +143,7 @@ void testSymmetricDelay() throws IOException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test asymmetric delay: leader has higher latency than followers") - void testAsymmetricLeaderDelay() throws IOException, InterruptedException { + void asymmetricLeaderDelay() throws Exception { logger.info("Creating Raft and HTTP proxies for 3-node cluster"); final Proxy raftProxy0 = toxiproxyClient.createProxy("raftProxy0", "0.0.0.0:" + RAFT_PROXY_PORT_0, "arcadedb-0:2434"); toxiproxyClient.createProxy("raftProxy1", "0.0.0.0:" + RAFT_PROXY_PORT_1, "arcadedb-1:2434"); @@ -219,7 +218,7 @@ void testAsymmetricLeaderDelay() throws IOException, InterruptedException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test high latency with jitter: variable delays simulate unstable network") - void testHighLatencyWithJitter() throws IOException { + void highLatencyWithJitter() throws Exception { logger.info("Creating Raft and HTTP proxies for 2-node cluster"); final Proxy raftProxy0 = toxiproxyClient.createProxy("raftProxy0", "0.0.0.0:" + RAFT_PROXY_PORT_0, "arcadedb-0:2434"); final Proxy raftProxy1 = toxiproxyClient.createProxy("raftProxy1", "0.0.0.0:" + RAFT_PROXY_PORT_1, "arcadedb-1:2434"); @@ -283,7 +282,7 @@ void testHighLatencyWithJitter() throws IOException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test extreme latency: verify timeout handling") - void testExtremeLatency() throws IOException { + void extremeLatency() throws Exception { logger.info("Creating Raft and HTTP proxies for 2-node cluster"); final Proxy raftProxy0 = toxiproxyClient.createProxy("raftProxy0", "0.0.0.0:" + RAFT_PROXY_PORT_0, "arcadedb-0:2434"); toxiproxyClient.createProxy("raftProxy1", "0.0.0.0:" + RAFT_PROXY_PORT_1, "arcadedb-1:2434"); diff --git a/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkPartitionIT.java b/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkPartitionIT.java index bc6ad3530e4..62f4dbef4d7 100644 --- a/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkPartitionIT.java +++ b/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkPartitionIT.java @@ -79,7 +79,7 @@ private int findLeaderIndex(final List servers) { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test leader partition: isolate leader from cluster, verify new election in majority") - void testLeaderPartitionWithQuorum() throws InterruptedException { + void leaderPartitionWithQuorum() throws Exception { logger.info("Creating 3-node Raft HA cluster with majority quorum (persistent for restart)"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -197,7 +197,7 @@ void testLeaderPartitionWithQuorum() throws InterruptedException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test single follower partition: one follower isolated, cluster continues") - void testSingleFollowerPartition() throws InterruptedException { + void singleFollowerPartition() throws Exception { logger.info("Creating 3-node Raft HA cluster with majority quorum (persistent for restart)"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -299,7 +299,7 @@ void testSingleFollowerPartition() throws InterruptedException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test no-quorum partition: cluster cannot accept writes when quorum is lost") - void testNoQuorumScenario() throws Exception { + void noQuorumScenario() throws Exception { logger.info("Creating 3-node Raft HA cluster with majority quorum (persistent for restart)"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); diff --git a/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkPartitionRecoveryIT.java b/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkPartitionRecoveryIT.java index 788f3db8cb7..51b91ea1cb5 100644 --- a/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkPartitionRecoveryIT.java +++ b/e2e-ha/src/test/java/com/arcadedb/containers/ha/NetworkPartitionRecoveryIT.java @@ -80,7 +80,7 @@ private int findLeaderIndex(final List servers) { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test partition recovery: 2+1 split, heal partition, verify Raft log catch-up") - void testPartitionRecovery() throws InterruptedException { + void partitionRecovery() throws Exception { logger.info("Creating 3-node Raft HA cluster with majority quorum (persistent for restart)"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -185,7 +185,7 @@ void testPartitionRecovery() throws InterruptedException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test multiple partition cycles: repeated split and heal with Raft log catch-up") - void testMultiplePartitionCycles() throws InterruptedException { + void multiplePartitionCycles() throws Exception { logger.info("Creating 3-node Raft HA cluster (persistent for restart)"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -281,7 +281,7 @@ void testMultiplePartitionCycles() throws InterruptedException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test asymmetric partition recovery: follower isolated then resyncs") - void testAsymmetricPartitionRecovery() throws InterruptedException { + void asymmetricPartitionRecovery() throws Exception { logger.info("Creating 3-node Raft HA cluster (persistent for restart)"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); diff --git a/e2e-ha/src/test/java/com/arcadedb/containers/ha/PacketLossIT.java b/e2e-ha/src/test/java/com/arcadedb/containers/ha/PacketLossIT.java index e4e8bef14f1..6ec1fb72bf6 100644 --- a/e2e-ha/src/test/java/com/arcadedb/containers/ha/PacketLossIT.java +++ b/e2e-ha/src/test/java/com/arcadedb/containers/ha/PacketLossIT.java @@ -29,7 +29,6 @@ import org.junit.jupiter.api.Timeout; import org.testcontainers.junit.jupiter.Testcontainers; -import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; @@ -41,7 +40,7 @@ * Toxiproxy intercepts the Raft gRPC consensus port (2434) to inject faults. */ @Testcontainers -public class PacketLossIT extends ContainersTestTemplate { +class PacketLossIT extends ContainersTestTemplate { // Proxy ports for Raft (consensus) traffic per node private static final int RAFT_PROXY_PORT_0 = 8660; @@ -65,7 +64,7 @@ public class PacketLossIT extends ContainersTestTemplate { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test low packet loss (5%): cluster should remain stable") - void testLowPacketLoss() throws IOException { + void lowPacketLoss() throws Exception { logger.info("Creating Raft and HTTP proxies for 2-node cluster"); final Proxy raftProxy0 = toxiproxyClient.createProxy("raftProxy0", "0.0.0.0:" + RAFT_PROXY_PORT_0, "arcadedb-0:2434"); final Proxy raftProxy1 = toxiproxyClient.createProxy("raftProxy1", "0.0.0.0:" + RAFT_PROXY_PORT_1, "arcadedb-1:2434"); @@ -131,7 +130,7 @@ void testLowPacketLoss() throws IOException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test moderate packet loss (20%): replication should succeed with retries") - void testModeratePacketLoss() throws IOException { + void moderatePacketLoss() throws Exception { logger.info("Creating Raft and HTTP proxies for 2-node cluster"); final Proxy raftProxy0 = toxiproxyClient.createProxy("raftProxy0", "0.0.0.0:" + RAFT_PROXY_PORT_0, "arcadedb-0:2434"); final Proxy raftProxy1 = toxiproxyClient.createProxy("raftProxy1", "0.0.0.0:" + RAFT_PROXY_PORT_1, "arcadedb-1:2434"); @@ -195,7 +194,7 @@ void testModeratePacketLoss() throws IOException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test high packet loss (50%): verify connection resilience") - void testHighPacketLoss() throws IOException { + void highPacketLoss() throws Exception { logger.info("Creating Raft and HTTP proxies for 2-node cluster"); final Proxy raftProxy0 = toxiproxyClient.createProxy("raftProxy0", "0.0.0.0:" + RAFT_PROXY_PORT_0, "arcadedb-0:2434"); final Proxy raftProxy1 = toxiproxyClient.createProxy("raftProxy1", "0.0.0.0:" + RAFT_PROXY_PORT_1, "arcadedb-1:2434"); @@ -262,7 +261,7 @@ void testHighPacketLoss() throws IOException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test directional packet loss: loss only in one direction") - void testDirectionalPacketLoss() throws IOException { + void directionalPacketLoss() throws Exception { logger.info("Creating Raft and HTTP proxies for 3-node cluster"); final Proxy raftProxy0 = toxiproxyClient.createProxy("raftProxy0", "0.0.0.0:" + RAFT_PROXY_PORT_0, "arcadedb-0:2434"); toxiproxyClient.createProxy("raftProxy1", "0.0.0.0:" + RAFT_PROXY_PORT_1, "arcadedb-1:2434"); @@ -332,7 +331,7 @@ void testDirectionalPacketLoss() throws IOException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test intermittent packet loss: verify recovery from transient issues") - void testIntermittentPacketLoss() throws IOException, InterruptedException { + void intermittentPacketLoss() throws Exception { logger.info("Creating Raft and HTTP proxies for 2-node cluster"); final Proxy raftProxy0 = toxiproxyClient.createProxy("raftProxy0", "0.0.0.0:" + RAFT_PROXY_PORT_0, "arcadedb-0:2434"); toxiproxyClient.createProxy("raftProxy1", "0.0.0.0:" + RAFT_PROXY_PORT_1, "arcadedb-1:2434"); diff --git a/e2e-ha/src/test/java/com/arcadedb/containers/ha/RollingRestartIT.java b/e2e-ha/src/test/java/com/arcadedb/containers/ha/RollingRestartIT.java index 1dddc614167..8bf2131a9f7 100644 --- a/e2e-ha/src/test/java/com/arcadedb/containers/ha/RollingRestartIT.java +++ b/e2e-ha/src/test/java/com/arcadedb/containers/ha/RollingRestartIT.java @@ -83,7 +83,7 @@ public void tearDown() { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Rolling restart: restart each node sequentially, verify zero downtime") - void testRollingRestart() throws InterruptedException { + void rollingRestart() throws Exception { logger.info("Creating 3-node Raft HA cluster with majority quorum"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -287,7 +287,7 @@ void testRollingRestart() throws InterruptedException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Rapid rolling restart: minimal wait between restarts") - void testRapidRollingRestart() throws InterruptedException { + void rapidRollingRestart() throws Exception { logger.info("Creating 3-node Raft HA cluster"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -390,7 +390,7 @@ void testRapidRollingRestart() throws InterruptedException { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Rolling restart with continuous writes: verify no data loss") - void testRollingRestartWithContinuousWrites() throws InterruptedException { + void rollingRestartWithContinuousWrites() throws Exception { logger.info("Creating 3-node Raft HA cluster"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); diff --git a/e2e-ha/src/test/java/com/arcadedb/containers/ha/SimpleHaScenarioIT.java b/e2e-ha/src/test/java/com/arcadedb/containers/ha/SimpleHaScenarioIT.java index 8135c747536..a3fa92b8e2c 100644 --- a/e2e-ha/src/test/java/com/arcadedb/containers/ha/SimpleHaScenarioIT.java +++ b/e2e-ha/src/test/java/com/arcadedb/containers/ha/SimpleHaScenarioIT.java @@ -36,7 +36,7 @@ class SimpleHaScenarioIT extends ContainersTestTemplate { @Test @DisplayName("Two-node Raft HA: schema and data replication") - void twoNodeRaftReplication() throws InterruptedException { + void twoNodeRaftReplication() throws Exception { createArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); createArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); diff --git a/e2e-ha/src/test/java/com/arcadedb/containers/ha/SplitBrainIT.java b/e2e-ha/src/test/java/com/arcadedb/containers/ha/SplitBrainIT.java index 548d9137aab..918b98a8071 100644 --- a/e2e-ha/src/test/java/com/arcadedb/containers/ha/SplitBrainIT.java +++ b/e2e-ha/src/test/java/com/arcadedb/containers/ha/SplitBrainIT.java @@ -82,7 +82,7 @@ private int findLeaderIndex(final List servers) { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test split-brain prevention: verify minority partition cannot accept writes (Raft leader steps down)") - void testSplitBrainPrevention() throws Exception { + void splitBrainPrevention() throws Exception { logger.info("Creating 3-node Raft HA cluster with majority quorum (persistent for restart)"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -207,7 +207,7 @@ void testSplitBrainPrevention() throws Exception { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test 1+1+1 partition: verify no writes possible without majority (all leaders step down)") - void testCompletePartitionNoQuorum() throws Exception { + void completePartitionNoQuorum() throws Exception { logger.info("Creating 3-node Raft HA cluster with majority quorum (persistent for restart)"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -329,7 +329,7 @@ void testCompletePartitionNoQuorum() throws Exception { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test cluster reformation: verify proper Raft leader election after partition healing") - void testClusterReformation() throws Exception { + void clusterReformation() throws Exception { logger.info("Creating 3-node Raft HA cluster (persistent for restart)"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); @@ -436,7 +436,7 @@ void testClusterReformation() throws Exception { @Test @Timeout(value = 10, unit = TimeUnit.MINUTES) @DisplayName("Test quorum loss recovery: verify cluster recovers after temporary quorum loss") - void testQuorumLossRecovery() throws Exception { + void quorumLossRecovery() throws Exception { logger.info("Creating 3-node Raft HA cluster with majority quorum (2/3) (persistent for restart)"); final GenericContainer arcade0 = createPersistentArcadeContainer("arcadedb-0", SERVER_LIST, "majority", network); final GenericContainer arcade1 = createPersistentArcadeContainer("arcadedb-1", SERVER_LIST, "majority", network); diff --git a/engine/src/test/java/com/arcadedb/engine/ApplyChangesPartialReplayTest.java b/engine/src/test/java/com/arcadedb/engine/ApplyChangesPartialReplayTest.java index d849ab7c0a4..bfe9b0e0b13 100644 --- a/engine/src/test/java/com/arcadedb/engine/ApplyChangesPartialReplayTest.java +++ b/engine/src/test/java/com/arcadedb/engine/ApplyChangesPartialReplayTest.java @@ -45,7 +45,7 @@ protected void beginTest() { } @Test - void testPartialReplayAppliesRemainingPages() throws Exception { + void partialReplayAppliesRemainingPages() throws Exception { final DatabaseInternal db = (DatabaseInternal) database; // Insert records to ensure we have pages with known versions diff --git a/engine/src/test/java/com/arcadedb/index/CaseInsensitiveIndexTest.java b/engine/src/test/java/com/arcadedb/index/CaseInsensitiveIndexTest.java index 63766b6a5ef..e3d9e4ecdf1 100644 --- a/engine/src/test/java/com/arcadedb/index/CaseInsensitiveIndexTest.java +++ b/engine/src/test/java/com/arcadedb/index/CaseInsensitiveIndexTest.java @@ -54,7 +54,7 @@ protected void beginTest() { } @Test - void testCILookupWithExactCase() { + void cILookupWithExactCase() { database.transaction(() -> { final ResultSet rs = database.query("sql", "SELECT FROM Product WHERE Name = 'Hello World'"); // CI index: all 3 case variants of "hello world" should match @@ -63,7 +63,7 @@ void testCILookupWithExactCase() { } @Test - void testCILookupWithDifferentCase() { + void cILookupWithDifferentCase() { database.transaction(() -> { final ResultSet rs = database.query("sql", "SELECT FROM Product WHERE Name = 'HELLO WORLD'"); assertThat(rs.stream().count()).isEqualTo(3); @@ -71,7 +71,7 @@ void testCILookupWithDifferentCase() { } @Test - void testCILookupWithToLowerCase() { + void cILookupWithToLowerCase() { // This is the main use case: Name.toLowerCase() = 'value' should use the CI index database.transaction(() -> { final ResultSet rs = database.query("sql", @@ -81,7 +81,7 @@ void testCILookupWithToLowerCase() { } @Test - void testCIIndexUsedInExecutionPlan() { + void cIIndexUsedInExecutionPlan() { database.transaction(() -> { final ResultSet rs = database.query("sql", "SELECT FROM Product WHERE Name.toLowerCase() = 'hello world'"); @@ -92,7 +92,7 @@ void testCIIndexUsedInExecutionPlan() { } @Test - void testCINonMatchingValue() { + void cINonMatchingValue() { database.transaction(() -> { final ResultSet rs = database.query("sql", "SELECT FROM Product WHERE Name = 'nonexistent'"); assertThat(rs.stream().count()).isEqualTo(0); @@ -100,7 +100,7 @@ void testCINonMatchingValue() { } @Test - void testCILookupDistinctValue() { + void cILookupDistinctValue() { database.transaction(() -> { final ResultSet rs = database.query("sql", "SELECT FROM Product WHERE Name = 'arcadedb'"); assertThat(rs.stream().count()).isEqualTo(1); @@ -108,7 +108,7 @@ void testCILookupDistinctValue() { } @Test - void testCIPersistenceAcrossReopen() { + void cIPersistenceAcrossReopen() { database.close(); database = factory.open(); @@ -120,7 +120,7 @@ void testCIPersistenceAcrossReopen() { } @Test - void testCIUniqueIndex() { + void cIUniqueIndex() { database.transaction(() -> { database.getSchema().createDocumentType("UniqueCI") .createProperty("Code", Type.STRING); @@ -138,7 +138,7 @@ void testCIUniqueIndex() { } @Test - void testCompositeIndexPartialCI() { + void compositeIndexPartialCI() { database.transaction(() -> { database.getSchema().createDocumentType("Composite") .createProperty("Name", Type.STRING); diff --git a/engine/src/test/java/com/arcadedb/index/CompositeIndexPartialKeySelectTest.java b/engine/src/test/java/com/arcadedb/index/CompositeIndexPartialKeySelectTest.java index 16feaa77204..29006f3888c 100644 --- a/engine/src/test/java/com/arcadedb/index/CompositeIndexPartialKeySelectTest.java +++ b/engine/src/test/java/com/arcadedb/index/CompositeIndexPartialKeySelectTest.java @@ -108,7 +108,7 @@ protected void beginTest() { } @Test - void testSelectWithPartialCompositeKeyOrCondition() { + void selectWithPartialCompositeKeyOrCondition() { // Client's exact query pattern (simplified) database.transaction(() -> { final ResultSet result = database.query("sql", @@ -126,7 +126,7 @@ void testSelectWithPartialCompositeKeyOrCondition() { } @Test - void testSelectWithSingleConditionOnCompositeIndex() { + void selectWithSingleConditionOnCompositeIndex() { // Simplest case: single equality on first field of composite index database.transaction(() -> { final ResultSet result = database.query("sql", @@ -142,7 +142,7 @@ void testSelectWithSingleConditionOnCompositeIndex() { } @Test - void testSelectWithNullSecondFieldInCompositeIndex() { + void selectWithNullSecondFieldInCompositeIndex() { // Insert a record without ModifiedOn (null second index field) database.transaction(() -> { database.newVertex("Study") @@ -167,7 +167,7 @@ void testSelectWithNullSecondFieldInCompositeIndex() { } @Test - void testSelectViaCommandEndpoint() { + void selectViaCommandEndpoint() { // Simulate what happens via POST /command - command() instead of query() database.transaction(() -> { final ResultSet result = database.command("sql", @@ -185,7 +185,7 @@ void testSelectViaCommandEndpoint() { } @Test - void testSelectWithPartialKeyAndModificationInSameTransaction() { + void selectWithPartialKeyAndModificationInSameTransaction() { // Test if a modification + select in the same tx causes issues database.transaction(() -> { // First modify a record @@ -212,7 +212,7 @@ void testSelectWithPartialKeyAndModificationInSameTransaction() { } @Test - void testPartialKeyRangeOnCompositeIndexAfterCompaction() throws Exception { + void partialKeyRangeOnCompositeIndexAfterCompaction() throws Exception { // Regression test for: "key is composed of 1 items, while the index defined 2 items" // The bug occurs in LSMTreeIndexCompacted.newIterators() which calls lookupInPage // with purpose=1 (retrieve) that rejects partial keys on composite indexes. diff --git a/engine/src/test/java/com/arcadedb/index/ConcurrentCompactionTest.java b/engine/src/test/java/com/arcadedb/index/ConcurrentCompactionTest.java index bc994ba7457..4a69b673ff4 100644 --- a/engine/src/test/java/com/arcadedb/index/ConcurrentCompactionTest.java +++ b/engine/src/test/java/com/arcadedb/index/ConcurrentCompactionTest.java @@ -39,7 +39,7 @@ class ConcurrentCompactionTest extends TestHelper { private static final int RECORDS_PER_TYPE = 5_000; @Test - void testConcurrentCompactionDoesNotCorruptFilesList() throws Exception { + void concurrentCompactionDoesNotCorruptFilesList() throws Exception { final int origRam = GlobalConfiguration.INDEX_COMPACTION_RAM_MB.getValueAsInteger(); final int origMinPages = GlobalConfiguration.INDEX_COMPACTION_MIN_PAGES_SCHEDULE.getValueAsInteger(); try { diff --git a/engine/src/test/java/com/arcadedb/index/Issue3714BatchUpsertArrayCopyTest.java b/engine/src/test/java/com/arcadedb/index/Issue3714BatchUpsertArrayCopyTest.java index e20ec7b9c82..0cde8c7e276 100644 --- a/engine/src/test/java/com/arcadedb/index/Issue3714BatchUpsertArrayCopyTest.java +++ b/engine/src/test/java/com/arcadedb/index/Issue3714BatchUpsertArrayCopyTest.java @@ -77,7 +77,7 @@ void tearDown() { * many page splits and compactions. */ @Test - void testConcurrentBatchUpsertsWithCompactionDoNotCorruptPages() throws Exception { + void concurrentBatchUpsertsWithCompactionDoNotCorruptPages() throws Exception { final int threads = 4; final int batchesPerThread = 1500; final int recordsPerBatch = 20; @@ -145,7 +145,7 @@ void testConcurrentBatchUpsertsWithCompactionDoNotCorruptPages() throws Exceptio * in LocalBucket.updateRecordInternal(). */ @Test - void testHighVolumeRepeatedUpsertsWithGrowingRecords() { + void highVolumeRepeatedUpsertsWithGrowingRecords() { final int totalKeys = 2000; final int iterations = 200; diff --git a/engine/src/test/java/com/arcadedb/index/Issue3714BatchUpsertVLQTest.java b/engine/src/test/java/com/arcadedb/index/Issue3714BatchUpsertVLQTest.java index 992d4a5e224..606fd39f567 100644 --- a/engine/src/test/java/com/arcadedb/index/Issue3714BatchUpsertVLQTest.java +++ b/engine/src/test/java/com/arcadedb/index/Issue3714BatchUpsertVLQTest.java @@ -70,7 +70,7 @@ void tearDown() { * ConcurrentModificationException retries. */ @Test - void testConcurrentBatchUpsertsDoNotCorruptIndex() throws Exception { + void concurrentBatchUpsertsDoNotCorruptIndex() throws Exception { // Use 2 threads to reduce contention while still testing concurrency final int threads = 2; final int batchesPerThread = 500; @@ -141,7 +141,7 @@ void testConcurrentBatchUpsertsDoNotCorruptIndex() throws Exception { * This stresses the index with many modifications to the same page. */ @Test - void testRepeatedBatchUpsertsOnSameKeys() { + void repeatedBatchUpsertsOnSameKeys() { final int totalKeys = 1000; final int iterations = 100; diff --git a/engine/src/test/java/com/arcadedb/index/Issue3714HashIndexCorruptionTest.java b/engine/src/test/java/com/arcadedb/index/Issue3714HashIndexCorruptionTest.java index d98fbf7465c..58595281735 100644 --- a/engine/src/test/java/com/arcadedb/index/Issue3714HashIndexCorruptionTest.java +++ b/engine/src/test/java/com/arcadedb/index/Issue3714HashIndexCorruptionTest.java @@ -73,7 +73,7 @@ void tearDown() { * - "Hash index bucket full when adding RID to existing entry" */ @Test - void testNonUniqueHashIndexPageFragmentation() { + void nonUniqueHashIndexPageFragmentation() { database.transaction(() -> { final DocumentType type = database.getSchema().getOrCreateDocumentType("FragDoc"); type.createProperty("category", String.class); @@ -115,7 +115,7 @@ void testNonUniqueHashIndexPageFragmentation() { * in hash index pages. This simulates the user's scenario of batch UPSERTs. */ @Test - void testRepeatedUpsertsWithNonUniqueHashIndex() { + void repeatedUpsertsWithNonUniqueHashIndex() { database.transaction(() -> { final DocumentType type = database.getSchema().getOrCreateDocumentType("UpsertDoc"); type.createProperty("recordId", String.class); @@ -167,7 +167,7 @@ void testRepeatedUpsertsWithNonUniqueHashIndex() { * exercises the removeRIDFromEntry code path. */ @Test - void testRemoveRIDFromEntryUnderFragmentation() { + void removeRIDFromEntryUnderFragmentation() { database.transaction(() -> { final DocumentType type = database.getSchema().getOrCreateDocumentType("RemoveDoc"); type.createProperty("tag", String.class); @@ -258,7 +258,7 @@ void testRemoveRIDFromEntryUnderFragmentation() { * that the physical record count and the SELECT result count stay consistent. */ @Test - void testNoDuplicatesAfterBatchUpsertsWithHashIndexes() { + void noDuplicatesAfterBatchUpsertsWithHashIndexes() { database.transaction(() -> { final DocumentType type = database.getSchema().getOrCreateDocumentType("Metadata"); type.createProperty("recordId", String.class); @@ -344,7 +344,7 @@ void testNoDuplicatesAfterBatchUpsertsWithHashIndexes() { * entire overflow chain and remove ALL matching entries, not stop at the first matching page. */ @Test - void testRemoveAllEntriesForKeyAcrossOverflowChain() { + void removeAllEntriesForKeyAcrossOverflowChain() { database.transaction(() -> { final DocumentType type = database.getSchema().getOrCreateDocumentType("OrphanDoc"); type.createProperty("key", String.class); @@ -390,7 +390,7 @@ void testRemoveAllEntriesForKeyAcrossOverflowChain() { * Uses very small page size to force many overflow pages. */ @Test - void testDeepOverflowChainDoesNotStackOverflow() { + void deepOverflowChainDoesNotStackOverflow() { database.transaction(() -> { final DocumentType type = database.getSchema().getOrCreateDocumentType("OverflowDoc"); type.createProperty("key", String.class); diff --git a/engine/src/test/java/com/arcadedb/index/vector/Issue3679VectorRebuildThresholdTest.java b/engine/src/test/java/com/arcadedb/index/vector/Issue3679VectorRebuildThresholdTest.java index 19f01c718f0..d0cb5cf992b 100644 --- a/engine/src/test/java/com/arcadedb/index/vector/Issue3679VectorRebuildThresholdTest.java +++ b/engine/src/test/java/com/arcadedb/index/vector/Issue3679VectorRebuildThresholdTest.java @@ -110,7 +110,7 @@ CREATE INDEX ON Embedding (vector) LSM_VECTOR } @Test - void searchShouldTriggerAsyncRebuildAtThreshold() throws InterruptedException { + void searchShouldTriggerAsyncRebuildAtThreshold() throws Exception { // Low threshold of 5 so we can easily trigger async rebuild final int lowThreshold = 5; database.getConfiguration().setValue(GlobalConfiguration.VECTOR_INDEX_MUTATIONS_BEFORE_REBUILD, lowThreshold); diff --git a/engine/src/test/java/com/arcadedb/index/vector/Issue3683AsyncRebuildRetriggerTest.java b/engine/src/test/java/com/arcadedb/index/vector/Issue3683AsyncRebuildRetriggerTest.java index e6d54180a51..08666151bd0 100644 --- a/engine/src/test/java/com/arcadedb/index/vector/Issue3683AsyncRebuildRetriggerTest.java +++ b/engine/src/test/java/com/arcadedb/index/vector/Issue3683AsyncRebuildRetriggerTest.java @@ -47,7 +47,7 @@ class Issue3683AsyncRebuildRetriggerTest extends TestHelper { private static final int LARGE_INDEX_VECTORS = 1100; @Test - void asyncRebuildShouldBeRetriggeredForMutationsDuringBuild() throws InterruptedException { + void asyncRebuildShouldBeRetriggeredForMutationsDuringBuild() throws Exception { final int threshold = 5; database.getConfiguration().setValue(GlobalConfiguration.VECTOR_INDEX_MUTATIONS_BEFORE_REBUILD, threshold); diff --git a/engine/src/test/java/com/arcadedb/index/vector/Issue3722VectorNeighborsMissingAfterIncrementalInsertTest.java b/engine/src/test/java/com/arcadedb/index/vector/Issue3722VectorNeighborsMissingAfterIncrementalInsertTest.java index fe698937be9..7fab063711a 100644 --- a/engine/src/test/java/com/arcadedb/index/vector/Issue3722VectorNeighborsMissingAfterIncrementalInsertTest.java +++ b/engine/src/test/java/com/arcadedb/index/vector/Issue3722VectorNeighborsMissingAfterIncrementalInsertTest.java @@ -48,7 +48,7 @@ class Issue3722VectorNeighborsMissingAfterIncrementalInsertTest extends TestHelp private static final int EMBEDDING_DIM = 32; @Test - void vectorNeighborsShouldReturnCorrectCountAfterIncrementalInsertAndRebuild() throws InterruptedException { + void vectorNeighborsShouldReturnCorrectCountAfterIncrementalInsertAndRebuild() throws Exception { // Set high threshold so automatic rebuild doesn't trigger during inserts, low timeout for quick inactivity rebuild database.getConfiguration().setValue(GlobalConfiguration.VECTOR_INDEX_MUTATIONS_BEFORE_REBUILD, 100_000); database.getConfiguration().setValue(GlobalConfiguration.VECTOR_INDEX_INACTIVITY_REBUILD_TIMEOUT_MS, 2_000); diff --git a/engine/src/test/java/com/arcadedb/index/vector/Issue3722VectorNeighborsMissingAfterReopenAndInsertTest.java b/engine/src/test/java/com/arcadedb/index/vector/Issue3722VectorNeighborsMissingAfterReopenAndInsertTest.java index d970f7147a1..10685b034f7 100644 --- a/engine/src/test/java/com/arcadedb/index/vector/Issue3722VectorNeighborsMissingAfterReopenAndInsertTest.java +++ b/engine/src/test/java/com/arcadedb/index/vector/Issue3722VectorNeighborsMissingAfterReopenAndInsertTest.java @@ -203,7 +203,7 @@ CREATE INDEX ON ChunkEmbedding (vector) LSM_VECTOR } @Test - void vectorSearchShouldReturnCorrectCountWithInactivityRebuildAfterReopen() throws InterruptedException { + void vectorSearchShouldReturnCorrectCountWithInactivityRebuildAfterReopen() throws Exception { // Disable automatic rebuilds during initial setup database.getConfiguration().setValue(GlobalConfiguration.VECTOR_INDEX_MUTATIONS_BEFORE_REBUILD, 100_000); database.getConfiguration().setValue(GlobalConfiguration.VECTOR_INDEX_INACTIVITY_REBUILD_TIMEOUT_MS, -1); diff --git a/engine/src/test/java/com/arcadedb/index/vector/Issue3737VectorInactivityRebuildTest.java b/engine/src/test/java/com/arcadedb/index/vector/Issue3737VectorInactivityRebuildTest.java index d865b7673cf..f6ef22abca7 100644 --- a/engine/src/test/java/com/arcadedb/index/vector/Issue3737VectorInactivityRebuildTest.java +++ b/engine/src/test/java/com/arcadedb/index/vector/Issue3737VectorInactivityRebuildTest.java @@ -43,7 +43,7 @@ class Issue3737VectorInactivityRebuildTest extends TestHelper { private static final int EMBEDDING_DIM = 32; @Test - void deltaBufferShouldFlushAfterInactivityTimeout() throws InterruptedException { + void deltaBufferShouldFlushAfterInactivityTimeout() throws Exception { // High threshold so we never reach it, low timeout so the timer fires quickly final int highThreshold = 10_000; final int timeoutMs = 2_000; // 2 seconds @@ -99,7 +99,7 @@ CREATE INDEX ON Embedding (vector) LSM_VECTOR } @Test - void timerShouldResetOnNewMutations() throws InterruptedException { + void timerShouldResetOnNewMutations() throws Exception { // High threshold, short timeout final int highThreshold = 10_000; final int timeoutMs = 3_000; // 3 seconds @@ -156,7 +156,7 @@ CREATE INDEX ON Embedding (vector) LSM_VECTOR } @Test - void noTimerWhenTimeoutIsZero() throws InterruptedException { + void noTimerWhenTimeoutIsZero() throws Exception { // Disable the inactivity timeout final int highThreshold = 10_000; diff --git a/engine/src/test/java/com/arcadedb/index/vector/Issue3868ConcurrentRebuildOOMTest.java b/engine/src/test/java/com/arcadedb/index/vector/Issue3868ConcurrentRebuildOOMTest.java index 4e5825a18c1..28594a78b56 100644 --- a/engine/src/test/java/com/arcadedb/index/vector/Issue3868ConcurrentRebuildOOMTest.java +++ b/engine/src/test/java/com/arcadedb/index/vector/Issue3868ConcurrentRebuildOOMTest.java @@ -57,7 +57,7 @@ class Issue3868ConcurrentRebuildOOMTest extends TestHelper { * and verifies that only one rebuild runs at a time. */ @Test - void concurrentAsyncRebuildsShouldBeSerialized() throws InterruptedException { + void concurrentAsyncRebuildsShouldBeSerialized() throws Exception { // Use a very low threshold so rebuilds trigger quickly final int threshold = 5; database.getConfiguration().setValue(GlobalConfiguration.VECTOR_INDEX_MUTATIONS_BEFORE_REBUILD, threshold); diff --git a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3920TailNullTest.java b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3920TailNullTest.java index a5d45156c9c..78c0b2e835a 100644 --- a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3920TailNullTest.java +++ b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3920TailNullTest.java @@ -37,7 +37,7 @@ * * @author Luca Garulli (l.garulli@arcadedata.com) */ -public class Issue3920TailNullTest { +class Issue3920TailNullTest { private Database database; @BeforeEach diff --git a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3922CaseNullTest.java b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3922CaseNullTest.java index d8080feb809..6aa86f4e564 100644 --- a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3922CaseNullTest.java +++ b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3922CaseNullTest.java @@ -37,7 +37,7 @@ * * @author Luca Garulli (l.garulli@arcadedata.com) */ -public class Issue3922CaseNullTest { +class Issue3922CaseNullTest { private Database database; @BeforeEach diff --git a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3923DynamicLabelTest.java b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3923DynamicLabelTest.java index ed000b6405a..3b69b7cce37 100644 --- a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3923DynamicLabelTest.java +++ b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3923DynamicLabelTest.java @@ -40,7 +40,7 @@ * * @author Luca Garulli (l.garulli@arcadedata.com) */ -public class Issue3923DynamicLabelTest { +class Issue3923DynamicLabelTest { private Database database; @BeforeEach diff --git a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3924QuantifiedPathPatternTest.java b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3924QuantifiedPathPatternTest.java index 51ba0b25be0..095c85eb4eb 100644 --- a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3924QuantifiedPathPatternTest.java +++ b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3924QuantifiedPathPatternTest.java @@ -42,7 +42,7 @@ * * @author Luca Garulli (l.garulli@arcadedata.com) */ -public class Issue3924QuantifiedPathPatternTest { +class Issue3924QuantifiedPathPatternTest { private Database database; @BeforeEach diff --git a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3925ReturnAllTest.java b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3925ReturnAllTest.java index 22e58cd705f..2a00a6c5ac2 100644 --- a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3925ReturnAllTest.java +++ b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3925ReturnAllTest.java @@ -40,7 +40,7 @@ * * @author Luca Garulli (l.garulli@arcadedata.com) */ -public class Issue3925ReturnAllTest { +class Issue3925ReturnAllTest { private Database database; @BeforeEach diff --git a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3928ConcatenationOperatorTest.java b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3928ConcatenationOperatorTest.java index 3067aa0ff98..c887b5c9a9a 100644 --- a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3928ConcatenationOperatorTest.java +++ b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3928ConcatenationOperatorTest.java @@ -39,7 +39,7 @@ * * @author Luca Garulli (l.garulli@arcadedata.com) */ -public class Issue3928ConcatenationOperatorTest { +class Issue3928ConcatenationOperatorTest { private Database database; @BeforeEach diff --git a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3931VarLengthPatternComprehensionTest.java b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3931VarLengthPatternComprehensionTest.java index fce06165975..e0f45a6cb2d 100644 --- a/engine/src/test/java/com/arcadedb/query/opencypher/Issue3931VarLengthPatternComprehensionTest.java +++ b/engine/src/test/java/com/arcadedb/query/opencypher/Issue3931VarLengthPatternComprehensionTest.java @@ -40,7 +40,7 @@ * * @author Luca Garulli (l.garulli@arcadedata.com) */ -public class Issue3931VarLengthPatternComprehensionTest { +class Issue3931VarLengthPatternComprehensionTest { private Database database; @BeforeEach diff --git a/engine/src/test/java/com/arcadedb/query/sql/TriggerSQLTest.java b/engine/src/test/java/com/arcadedb/query/sql/TriggerSQLTest.java index 866a67adbe9..3eeba0ca53a 100644 --- a/engine/src/test/java/com/arcadedb/query/sql/TriggerSQLTest.java +++ b/engine/src/test/java/com/arcadedb/query/sql/TriggerSQLTest.java @@ -57,8 +57,8 @@ public void beginTest() { void createTriggerWithSQL() { database.command("sql", """ - CREATE TRIGGER audit_trigger BEFORE CREATE ON TYPE User \ - EXECUTE SQL 'INSERT INTO AuditLog SET action = "create", timestamp = sysdate()'"""); + CREATE TRIGGER audit_trigger BEFORE CREATE ON TYPE User \ + EXECUTE SQL 'INSERT INTO AuditLog SET action = "create", timestamp = sysdate()'"""); assertThat(database.getSchema().existsTrigger("audit_trigger")).isTrue(); final Trigger trigger = database.getSchema().getTrigger("audit_trigger"); @@ -153,7 +153,7 @@ void beforeCreateTriggerSQL() { final ResultSet result = database.query("sql", "SELECT FROM AuditLog WHERE action = 'before_create'"); assertThat(result.hasNext()).isTrue(); - assertThat( result.next().getProperty("action")).isEqualTo("before_create"); + assertThat(result.next().getProperty("action")).isEqualTo("before_create"); } @Test @@ -220,8 +220,8 @@ void beforeCreateTriggerJavaScript() { void beforeCreateTriggerAbort() { database.command("sql", """ - CREATE TRIGGER abort_trigger BEFORE CREATE ON TYPE User \ - EXECUTE JAVASCRIPT 'false;'"""); // Return false to abort + CREATE TRIGGER abort_trigger BEFORE CREATE ON TYPE User \ + EXECUTE JAVASCRIPT 'false;'"""); // Return false to abort // Record creation should be silently aborted (no exception, just not saved) database.transaction(() -> database.newDocument("User").set("name", "Test").save()); diff --git a/engine/src/test/java/com/arcadedb/query/sql/executor/EdgeTypeVertexRidOptimizationTest.java b/engine/src/test/java/com/arcadedb/query/sql/executor/EdgeTypeVertexRidOptimizationTest.java index 5241702bbb0..db5208bdbea 100644 --- a/engine/src/test/java/com/arcadedb/query/sql/executor/EdgeTypeVertexRidOptimizationTest.java +++ b/engine/src/test/java/com/arcadedb/query/sql/executor/EdgeTypeVertexRidOptimizationTest.java @@ -67,7 +67,7 @@ protected void beginTest() { } @Test - void testSelectFromEdgeWhereOutEqualsRid() { + void selectFromEdgeWhereOutEqualsRid() { database.transaction(() -> { // This should use vertex-centric traversal, not full edge type scan final ResultSet result = database.query("sql", @@ -84,7 +84,7 @@ void testSelectFromEdgeWhereOutEqualsRid() { } @Test - void testSelectFromEdgeWhereInEqualsRid() { + void selectFromEdgeWhereInEqualsRid() { database.transaction(() -> { final ResultSet result = database.query("sql", "SELECT FROM Knows WHERE @in = " + v3Rid); @@ -100,7 +100,7 @@ void testSelectFromEdgeWhereInEqualsRid() { } @Test - void testSelectFromEdgeWhereOutEqualsRidWithAdditionalFilter() { + void selectFromEdgeWhereOutEqualsRidWithAdditionalFilter() { database.transaction(() -> { // @out = RID AND since > 2020 final ResultSet result = database.query("sql", @@ -118,7 +118,7 @@ void testSelectFromEdgeWhereOutEqualsRidWithAdditionalFilter() { } @Test - void testSelectFromEdgeWhereOutAndInEqualsRid() { + void selectFromEdgeWhereOutAndInEqualsRid() { database.transaction(() -> { // Both @out and @in specified — the optimizer picks the first one (@out) final ResultSet result = database.query("sql", @@ -136,7 +136,7 @@ void testSelectFromEdgeWhereOutAndInEqualsRid() { } @Test - void testSelectFromEdgeWhereOutEqualsRidString() { + void selectFromEdgeWhereOutEqualsRidString() { database.transaction(() -> { // RID as quoted string (common in HTTP API calls) final ResultSet result = database.query("sql", @@ -152,7 +152,7 @@ void testSelectFromEdgeWhereOutEqualsRidString() { } @Test - void testExecutionPlanUsesVertexFetch() { + void executionPlanUsesVertexFetch() { database.transaction(() -> { final ResultSet result = database.query("sql", "SELECT FROM Knows WHERE @out = " + v1Rid + " AND since > 2020"); diff --git a/engine/src/test/java/com/arcadedb/query/sql/functions/SQLStatelessFunctionBridgeTest.java b/engine/src/test/java/com/arcadedb/query/sql/functions/SQLStatelessFunctionBridgeTest.java index 18bafb87704..b69aa63837b 100644 --- a/engine/src/test/java/com/arcadedb/query/sql/functions/SQLStatelessFunctionBridgeTest.java +++ b/engine/src/test/java/com/arcadedb/query/sql/functions/SQLStatelessFunctionBridgeTest.java @@ -50,7 +50,7 @@ protected void beginTest() { } @Test - void testJaroWinklerIdenticalStrings() { + void jaroWinklerIdenticalStrings() { final ResultSet rs = database.query("sql", "SELECT text.jaroWinklerDistance('hello', 'hello') AS score"); assertThat(rs.hasNext()).isTrue(); final Result result = rs.next(); @@ -58,7 +58,7 @@ void testJaroWinklerIdenticalStrings() { } @Test - void testJaroWinklerSimilarStrings() { + void jaroWinklerSimilarStrings() { final ResultSet rs = database.query("sql", "SELECT text.jaroWinklerDistance('John', 'Jon') AS score"); assertThat(rs.hasNext()).isTrue(); final Result result = rs.next(); @@ -68,7 +68,7 @@ void testJaroWinklerSimilarStrings() { } @Test - void testJaroWinklerWithProperty() { + void jaroWinklerWithProperty() { final ResultSet rs = database.query("sql", "SELECT name, text.jaroWinklerDistance(name, 'John') AS score FROM Person ORDER BY score DESC"); final List results = rs.stream().toList(); @@ -79,7 +79,7 @@ void testJaroWinklerWithProperty() { } @Test - void testJaroWinklerInWhereClause() { + void jaroWinklerInWhereClause() { final ResultSet rs = database.query("sql", "SELECT name FROM Person WHERE text.jaroWinklerDistance(name, 'John') > 0.85"); final List results = rs.stream().toList(); @@ -92,7 +92,7 @@ void testJaroWinklerInWhereClause() { } @Test - void testLevenshteinDistance() { + void levenshteinDistance() { final ResultSet rs = database.query("sql", "SELECT text.levenshteinDistance('kitten', 'sitting') AS dist"); assertThat(rs.hasNext()).isTrue(); final Result result = rs.next(); @@ -100,7 +100,7 @@ void testLevenshteinDistance() { } @Test - void testLevenshteinSimilarity() { + void levenshteinSimilarity() { final ResultSet rs = database.query("sql", "SELECT text.levenshteinSimilarity('hello', 'hello') AS score"); assertThat(rs.hasNext()).isTrue(); final Result result = rs.next(); @@ -108,7 +108,7 @@ void testLevenshteinSimilarity() { } @Test - void testHammingDistance() { + void hammingDistance() { final ResultSet rs = database.query("sql", "SELECT text.hammingDistance('karolin', 'kathrin') AS dist"); assertThat(rs.hasNext()).isTrue(); final Result result = rs.next(); @@ -116,7 +116,7 @@ void testHammingDistance() { } @Test - void testSorensenDiceSimilarity() { + void sorensenDiceSimilarity() { final ResultSet rs = database.query("sql", "SELECT text.sorensenDiceSimilarity('night', 'nacht') AS score"); assertThat(rs.hasNext()).isTrue(); final Result result = rs.next(); @@ -125,7 +125,7 @@ void testSorensenDiceSimilarity() { } @Test - void testMathSigmoid() { + void mathSigmoid() { final ResultSet rs = database.query("sql", "SELECT math.sigmoid(0.0) AS result"); assertThat(rs.hasNext()).isTrue(); final Result result = rs.next(); @@ -133,7 +133,7 @@ void testMathSigmoid() { } @Test - void testUnknownNamespacedFunctionThrows() { + void unknownNamespacedFunctionThrows() { // Use a known namespace with a non-existent function name try { database.query("sql", "SELECT text.nonExistentFunc('a') AS result"); @@ -144,7 +144,7 @@ void testUnknownNamespacedFunctionThrows() { } @Test - void testNativeSqlFunctionsStillWork() { + void nativeSqlFunctionsStillWork() { final ResultSet rs = database.query("sql", "SELECT count(*) AS cnt FROM Person"); assertThat(rs.hasNext()).isTrue(); final Result result = rs.next(); diff --git a/engine/src/test/java/com/arcadedb/query/sql/parser/CreateEdgeStatementTest.java b/engine/src/test/java/com/arcadedb/query/sql/parser/CreateEdgeStatementTest.java index 11a14b737b7..07431d67aa5 100644 --- a/engine/src/test/java/com/arcadedb/query/sql/parser/CreateEdgeStatementTest.java +++ b/engine/src/test/java/com/arcadedb/query/sql/parser/CreateEdgeStatementTest.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test; -public class CreateEdgeStatementTest extends AbstractParserTest { +class CreateEdgeStatementTest extends AbstractParserTest { @Test void simpleCreate() { @@ -53,14 +53,14 @@ void batch() { } @Test - public void testInputVariables() { + void inputVariables() { checkRightSyntax("create edge Foo from ? to ?"); checkRightSyntax("create edge Foo from :a to :b"); checkRightSyntax("create edge Foo from [:a, :b] to [:b, :c]"); } @Test - public void testSubStatements() { + void subStatements() { checkRightSyntax("create edge Foo from (select from Foo) to (select from bar)"); checkRightSyntax("create edge Foo from (traverse out() from #12:0) to (select from bar)"); checkRightSyntax("create edge Foo from (MATCH {type:Person, as:A} return $elements) to (select from bar)"); diff --git a/engine/src/test/java/com/arcadedb/query/sql/parser/ProjectionTest.java b/engine/src/test/java/com/arcadedb/query/sql/parser/ProjectionTest.java index d9f2c536670..c18c8864b4d 100644 --- a/engine/src/test/java/com/arcadedb/query/sql/parser/ProjectionTest.java +++ b/engine/src/test/java/com/arcadedb/query/sql/parser/ProjectionTest.java @@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; +import static org.assertj.core.api.Assertions.assertThatThrownBy; /** * Created by luigidellaquila on 02/07/15. @@ -47,12 +47,9 @@ void validate() throws Exception { final SelectStatement stm = (SelectStatement) new SQLAntlrParser(null).parse("select expand(foo) from V"); stm.getProjection().validate(); - try { + assertThatThrownBy(() -> { final SelectStatement stmInvalid = (SelectStatement) new SQLAntlrParser(null).parse("select expand(foo), bar from V"); - stmInvalid.getProjection().validate(); // this should throw - fail("Expected validate() to throw"); - } catch (final CommandSQLParsingException ex) { - // expected - } + stmInvalid.getProjection().validate(); + }).isInstanceOf(CommandSQLParsingException.class); } } diff --git a/engine/src/test/java/com/arcadedb/query/sql/parser/UpdateStatementTest.java b/engine/src/test/java/com/arcadedb/query/sql/parser/UpdateStatementTest.java index 7b7c816073f..1285fa7a9e4 100755 --- a/engine/src/test/java/com/arcadedb/query/sql/parser/UpdateStatementTest.java +++ b/engine/src/test/java/com/arcadedb/query/sql/parser/UpdateStatementTest.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test; -public class UpdateStatementTest extends AbstractParserTest { +class UpdateStatementTest extends AbstractParserTest { @Test void simpleInsert() { @@ -56,22 +56,22 @@ void json() { } @Test - public void testIncrementOld() { + void incrementOld() { checkRightSyntax("update Foo increment a = 2"); } @Test - public void testIncrement() { + void increment() { checkRightSyntax("update Foo set a += 2"); } @Test - public void testDecrement() { + void decrement() { checkRightSyntax("update Foo set a -= 2"); } @Test - public void testQuotedJson() { + void quotedJson() { checkRightSyntax("UPDATE V SET key = \"test\", value = {\"f12\":\"test\\\\\"} UPSERT WHERE key = \"test\""); } diff --git a/gremlin/src/test/java/com/arcadedb/gremlin/GremlinGroovyEngineTest.java b/gremlin/src/test/java/com/arcadedb/gremlin/GremlinGroovyEngineTest.java index 542e026c14d..2378729dc3c 100644 --- a/gremlin/src/test/java/com/arcadedb/gremlin/GremlinGroovyEngineTest.java +++ b/gremlin/src/test/java/com/arcadedb/gremlin/GremlinGroovyEngineTest.java @@ -23,8 +23,6 @@ import org.apache.tinkerpop.gremlin.jsr223.Customizer; import org.junit.jupiter.api.Test; -import javax.script.ScriptException; - import static org.assertj.core.api.Assertions.assertThat; /** @@ -40,7 +38,7 @@ class GremlinGroovyEngineTest { @Test - void groovyEngineInitializesWithCoreImports() throws ScriptException { + void groovyEngineInitializesWithCoreImports() throws Exception { final Customizer[] customizers = CoreGremlinPlugin.instance() .getCustomizers("gremlin-groovy") .orElse(new Customizer[0]); diff --git a/gremlin/src/test/java/org/apache/tinkerpop/gremlin/util/GremlinValueComparatorTest.java b/gremlin/src/test/java/org/apache/tinkerpop/gremlin/util/GremlinValueComparatorTest.java index e177b146252..472a8669de2 100644 --- a/gremlin/src/test/java/org/apache/tinkerpop/gremlin/util/GremlinValueComparatorTest.java +++ b/gremlin/src/test/java/org/apache/tinkerpop/gremlin/util/GremlinValueComparatorTest.java @@ -1,32 +1,34 @@ package org.apache.tinkerpop.gremlin.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; + import java.time.OffsetDateTime; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Date; -import static org.junit.Assert.assertEquals; -public class GremlinValueComparatorTest { - @Test - public void testOrderabilityOffsetDateTimeAndString() { +import static org.assertj.core.api.Assertions.assertThat; + +class GremlinValueComparatorTest { + @Test + void orderabilityOffsetDateTimeAndString() { OffsetDateTime date = OffsetDateTime.parse("2026-04-15T18:59:01.493937Z"); String str = "bar"; List list = Arrays.asList(str, date); // Orderability priority: Date (3) < String (4) Collections.sort(list, GremlinValueComparator.ORDERABILITY); - assertEquals(date, list.get(0)); - assertEquals(str, list.get(1)); + assertThat(list.get(0)).isEqualTo(date); + assertThat(list.get(1)).isEqualTo(str); } - @Test - public void testOrderabilityMixedDateTypes() { + @Test + void orderabilityMixedDateTypes() { OffsetDateTime date1 = OffsetDateTime.parse("2026-04-15T18:59:01Z"); Date date2 = new Date(date1.toInstant().toEpochMilli() + 1000); // 1 second later List list = Arrays.asList(date2, date1); Collections.sort(list, GremlinValueComparator.ORDERABILITY); - assertEquals(date1, list.get(0)); - assertEquals(date2, list.get(1)); + assertThat(list.get(0)).isEqualTo(date1); + assertThat(list.get(1)).isEqualTo(date2); } } diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/GetClusterHandlerIT.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/GetClusterHandlerIT.java index 33596fd3706..c9d6fbc79ff 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/GetClusterHandlerIT.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/GetClusterHandlerIT.java @@ -37,7 +37,7 @@ protected int getServerCount() { } @Test - void testClusterEndpointReturnsStatus() throws Exception { + void clusterEndpointReturnsStatus() throws Exception { final JSONObject response = queryClusterEndpoint(0); assertThat(response.getString("implementation")).isEqualTo("raft"); @@ -58,7 +58,7 @@ void testClusterEndpointReturnsStatus() throws Exception { } @Test - void testExactlyOneLeaderInCluster() throws Exception { + void exactlyOneLeaderInCluster() throws Exception { int leaderCount = 0; for (int i = 0; i < getServerCount(); i++) { final JSONObject response = queryClusterEndpoint(i); @@ -69,7 +69,7 @@ void testExactlyOneLeaderInCluster() throws Exception { } @Test - void testAllNodesAgreeOnLeader() throws Exception { + void allNodesAgreeOnLeader() throws Exception { final JSONObject response0 = queryClusterEndpoint(0); final JSONObject response1 = queryClusterEndpoint(1); diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftGroupCommitterTest.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftGroupCommitterTest.java index 636161ce337..13cb10b578f 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftGroupCommitterTest.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftGroupCommitterTest.java @@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; class RaftGroupCommitterTest { @@ -93,7 +94,7 @@ void dispatchedEntryWaitsForResultOnTimeout() { try { committer.submitAndWait(new byte[] { 1, 2, 3 }); - org.junit.jupiter.api.Assertions.fail("Expected exception"); + fail("Expected exception"); } catch (final QuorumNotReachedException e) { assertThat(e.getMessage()).contains("not available"); } finally { diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHAInsertBenchmark.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHAInsertBenchmark.java index 888176c2f0e..a307b9eb5db 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHAInsertBenchmark.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHAInsertBenchmark.java @@ -48,7 +48,7 @@ * Run with: {@code mvn test -pl ha-raft -Dtest=RaftHAInsertBenchmark -Dtag=benchmark} */ @Tag("benchmark") -public class RaftHAInsertBenchmark { +class RaftHAInsertBenchmark { private static final int BASE_RAFT_PORT = 3434; private static final int BASE_HTTP_PORT = 3480; diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHAServerIT.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHAServerIT.java index 6fb5ed880dd..a3bc46fdecb 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHAServerIT.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHAServerIT.java @@ -141,7 +141,7 @@ void tearDown() { } @Test - void testLeaderElection() throws Exception { + void leaderElection() throws Exception { // Verify exactly one leader exists int leaderCount = 0; for (final RaftServer server : servers) @@ -152,7 +152,7 @@ void testLeaderElection() throws Exception { } @Test - void testBasicReplication() throws Exception { + void basicReplication() throws Exception { try (final RaftClient client = createClient()) { // Send a single entry final byte[] data = "hello-raft".getBytes(); @@ -172,7 +172,7 @@ void testBasicReplication() throws Exception { } @Test - void testMultipleEntries() throws Exception { + void multipleEntries() throws Exception { final int entryCount = 10; try (final RaftClient client = createClient()) { diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHealthMonitorRecoveryIT.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHealthMonitorRecoveryIT.java index 848d09c6f2a..c9f1b749810 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHealthMonitorRecoveryIT.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftHealthMonitorRecoveryIT.java @@ -61,7 +61,7 @@ protected void onServerConfiguration(final ContextConfiguration config) { } @Test - void healthMonitorRecoversFollowerFromClosedState() throws InterruptedException { + void healthMonitorRecoversFollowerFromClosedState() throws Exception { final int leaderIndex = findLeaderIndex(); assertThat(leaderIndex).as("A Raft leader must be elected").isGreaterThanOrEqualTo(0); diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftLogEntryCodecTest.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftLogEntryCodecTest.java index 9617f32d0c0..3a74d006119 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftLogEntryCodecTest.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftLogEntryCodecTest.java @@ -220,7 +220,7 @@ void roundTripInstallDatabaseEntryWithForceSnapshot() { } @Test - void decodeLegacyInstallDatabaseEntryWithoutFlag() throws java.io.IOException { + void decodeLegacyInstallDatabaseEntryWithoutFlag() throws Exception { // Hand-crafted byte layout matching the pre-forceSnapshot codec: // type byte + UTF(databaseName), no trailing boolean. final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); @@ -273,7 +273,7 @@ void unknownEntryTypeReturnsNull() { } @Test - void decodeUnknownTypeReturnsNullTypeEntry() throws java.io.IOException { + void decodeUnknownTypeReturnsNullTypeEntry() throws Exception { // Build an entry with an unknown type byte (99) final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); try (final java.io.DataOutputStream dos = new java.io.DataOutputStream(baos)) { diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftReplicationIT.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftReplicationIT.java index 341c665c59f..21320aeef88 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftReplicationIT.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/RaftReplicationIT.java @@ -151,7 +151,7 @@ void tearDown() { } @Test - void testLeaderElection() { + void leaderElection() { // Verify exactly one Ratis leader exists int leaderCount = 0; for (final ArcadeDBServer server : servers) @@ -162,7 +162,7 @@ void testLeaderElection() { } @Test - void testWriteOnLeader() { + void writeOnLeader() { // Find the leader server ArcadeDBServer leader = null; for (final ArcadeDBServer server : servers) @@ -207,7 +207,7 @@ void testWriteOnLeader() { } @Test - void testWriteOnFollowerForwardsThroughRaft() { + void writeOnFollowerForwardsThroughRaft() { // Find a follower server (not the leader) ArcadeDBServer follower = null; for (final ArcadeDBServer server : servers) @@ -231,7 +231,7 @@ void testWriteOnFollowerForwardsThroughRaft() { } @Test - void testClusterStatus() { + void clusterStatus() { // Verify cluster status API for (final ArcadeDBServer server : servers) { final RaftHAServer raftHA = ((RaftHAPlugin) server.getHA()).getRaftHAServer(); @@ -250,7 +250,7 @@ void testClusterStatus() { } @Test - void testPeerReplicaAddresses() { + void peerReplicaAddresses() { // Verify replica addresses are populated for (final ArcadeDBServer server : servers) { final RaftHAServer raftHA = ((RaftHAPlugin) server.getHA()).getRaftHAServer(); diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotCompressionRatioTest.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotCompressionRatioTest.java index c32c95ad0e6..328ef10e1b0 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotCompressionRatioTest.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotCompressionRatioTest.java @@ -23,7 +23,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.IOException; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; @@ -44,7 +43,7 @@ class SnapshotCompressionRatioTest { // -- CountingInputStream tests -- @Test - void countingInputStream_tracksReadBytes() throws IOException { + void countingInputStream_tracksReadBytes() throws Exception { final byte[] data = new byte[1024]; Arrays.fill(data, (byte) 0x42); @@ -62,7 +61,7 @@ void countingInputStream_tracksReadBytes() throws IOException { } @Test - void countingInputStream_tracksReadAllBytes() throws IOException { + void countingInputStream_tracksReadAllBytes() throws Exception { final byte[] data = new byte[4096]; Arrays.fill(data, (byte) 0xAB); @@ -74,7 +73,7 @@ void countingInputStream_tracksReadAllBytes() throws IOException { } @Test - void countingInputStream_tracksSingleByteRead() throws IOException { + void countingInputStream_tracksSingleByteRead() throws Exception { final byte[] data = { 0x01, 0x02, 0x03 }; final SnapshotInstaller.CountingInputStream counter = new SnapshotInstaller.CountingInputStream( new ByteArrayInputStream(data)); @@ -87,7 +86,7 @@ void countingInputStream_tracksSingleByteRead() throws IOException { } @Test - void countingInputStream_tracksAcrossMultipleReads() throws IOException { + void countingInputStream_tracksAcrossMultipleReads() throws Exception { final byte[] data = new byte[512]; final SnapshotInstaller.CountingInputStream counter = new SnapshotInstaller.CountingInputStream( new ByteArrayInputStream(data)); @@ -104,7 +103,7 @@ void countingInputStream_tracksAcrossMultipleReads() throws IOException { } @Test - void countingInputStream_eofDoesNotIncrementCount() throws IOException { + void countingInputStream_eofDoesNotIncrementCount() throws Exception { final SnapshotInstaller.CountingInputStream counter = new SnapshotInstaller.CountingInputStream( new ByteArrayInputStream(new byte[0])); @@ -114,7 +113,7 @@ void countingInputStream_eofDoesNotIncrementCount() throws IOException { } @Test - void countingInputStream_markNotSupported() throws IOException { + void countingInputStream_markNotSupported() throws Exception { final SnapshotInstaller.CountingInputStream counter = new SnapshotInstaller.CountingInputStream( new ByteArrayInputStream(new byte[10])); assertThat(counter.markSupported()).isFalse(); @@ -123,7 +122,7 @@ void countingInputStream_markNotSupported() throws IOException { // -- copyWithLimit tests -- @Test - void copyWithLimit_returnsExactByteCopied() throws IOException { + void copyWithLimit_returnsExactByteCopied() throws Exception { final byte[] data = new byte[1000]; Arrays.fill(data, (byte) 0x55); @@ -151,7 +150,7 @@ void copyWithLimit_throwsWhenLimitExceeded() { } @Test - void copyWithLimit_exactlyAtLimitSucceeds() throws IOException { + void copyWithLimit_exactlyAtLimitSucceeds() throws Exception { final byte[] data = new byte[100]; final long copied = SnapshotInstaller.copyWithLimit( @@ -176,7 +175,7 @@ void compressionRatioConstants_haveExpectedValues() { * compresses at ~946:1 with DEFLATE. The ratio guard must not reject it. */ @Test - void sparsePageSizedEntry_doesNotExceedRatioLimit() throws IOException { + void sparsePageSizedEntry_doesNotExceedRatioLimit() throws Exception { // Dictionary.DEF_PAGE_SIZE = 65536 * 5 = 327 680 bytes, freshly initialised → mostly zeros final int dictionaryPageSize = 65_536 * 5; final byte[] sparseData = new byte[dictionaryPageSize]; // all-zeros: highly compressible @@ -215,7 +214,7 @@ void sparsePageSizedEntry_doesNotExceedRatioLimit() throws IOException { // -- Integration: CountingInputStream with ZipInputStream -- @Test - void countingInputStream_measuresCompressedBytesPerEntry() throws IOException { + void countingInputStream_measuresCompressedBytesPerEntry() throws Exception { // Build a small ZIP in memory final byte[] uncompressedData = new byte[10_000]; Arrays.fill(uncompressedData, (byte) 0xCC); // highly compressible diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotInstallerIntegrationIT.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotInstallerIntegrationIT.java index 2948d73a10d..21c6a2f023a 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotInstallerIntegrationIT.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotInstallerIntegrationIT.java @@ -55,7 +55,7 @@ protected int getServerCount() { } @Test - void testFollowerInstallsSnapshotViaCrashSafeFlow() { + void followerInstallsSnapshotViaCrashSafeFlow() { final int leaderIndex = findLeaderIndex(); assertThat(leaderIndex).as("A Raft leader must be elected").isGreaterThanOrEqualTo(0); final int replicaIndex = (leaderIndex + 1) % getServerCount(); diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotInstallerRetryTest.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotInstallerRetryTest.java index 726baef5fa6..39c1f350327 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotInstallerRetryTest.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotInstallerRetryTest.java @@ -58,7 +58,7 @@ void stopServer() { } @Test - void testSuccessOnFirstAttempt(@TempDir final Path tempDir) throws IOException { + void successOnFirstAttempt(@TempDir final Path tempDir) throws Exception { final AtomicInteger callCount = new AtomicInteger(0); httpServer.createContext("/api/v1/ha/snapshot/testdb", exchange -> { callCount.incrementAndGet(); @@ -81,7 +81,7 @@ void testSuccessOnFirstAttempt(@TempDir final Path tempDir) throws IOException { } @Test - void testSuccessAfterTransientFailure(@TempDir final Path tempDir) throws IOException { + void successAfterTransientFailure(@TempDir final Path tempDir) throws Exception { final AtomicInteger callCount = new AtomicInteger(0); httpServer.createContext("/api/v1/ha/snapshot/testdb", exchange -> { final int attempt = callCount.incrementAndGet(); @@ -108,7 +108,7 @@ void testSuccessAfterTransientFailure(@TempDir final Path tempDir) throws IOExce } @Test - void testExhaustedRetriesThrows(@TempDir final Path tempDir) throws IOException { + void exhaustedRetriesThrows(@TempDir final Path tempDir) throws Exception { final AtomicInteger callCount = new AtomicInteger(0); httpServer.createContext("/api/v1/ha/snapshot/testdb", exchange -> { callCount.incrementAndGet(); @@ -130,7 +130,7 @@ void testExhaustedRetriesThrows(@TempDir final Path tempDir) throws IOException } @Test - void testPartialDownloadCleanedUpBeforeRetry(@TempDir final Path tempDir) throws IOException { + void partialDownloadCleanedUpBeforeRetry(@TempDir final Path tempDir) throws Exception { final AtomicInteger callCount = new AtomicInteger(0); httpServer.createContext("/api/v1/ha/snapshot/testdb", exchange -> { final int attempt = callCount.incrementAndGet(); @@ -161,7 +161,7 @@ void testPartialDownloadCleanedUpBeforeRetry(@TempDir final Path tempDir) throws } @Test - void testBackoffTimingIncreases(@TempDir final Path tempDir) throws IOException { + void backoffTimingIncreases(@TempDir final Path tempDir) throws Exception { final AtomicInteger callCount = new AtomicInteger(0); httpServer.createContext("/api/v1/ha/snapshot/testdb", exchange -> { callCount.incrementAndGet(); diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotManagerTest.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotManagerTest.java index 0c03037c029..63b681b775d 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotManagerTest.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotManagerTest.java @@ -21,7 +21,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.Map; @@ -31,7 +30,7 @@ class SnapshotManagerTest { @Test - void computeFileChecksumsForDirectory(@TempDir final Path tempDir) throws IOException { + void computeFileChecksumsForDirectory(@TempDir final Path tempDir) throws Exception { Files.writeString(tempDir.resolve("file1.dat"), "hello"); Files.writeString(tempDir.resolve("file2.dat"), "world"); @@ -43,7 +42,7 @@ void computeFileChecksumsForDirectory(@TempDir final Path tempDir) throws IOExce } @Test - void identicalFilesHaveSameChecksum(@TempDir final Path tempDir) throws IOException { + void identicalFilesHaveSameChecksum(@TempDir final Path tempDir) throws Exception { Files.writeString(tempDir.resolve("a.dat"), "same content"); Files.writeString(tempDir.resolve("b.dat"), "same content"); @@ -53,7 +52,7 @@ void identicalFilesHaveSameChecksum(@TempDir final Path tempDir) throws IOExcept } @Test - void differentFilesHaveDifferentChecksums(@TempDir final Path tempDir) throws IOException { + void differentFilesHaveDifferentChecksums(@TempDir final Path tempDir) throws Exception { Files.writeString(tempDir.resolve("a.dat"), "content A"); Files.writeString(tempDir.resolve("b.dat"), "content B"); diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotSwapRecoveryTest.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotSwapRecoveryTest.java index f6df4d19584..fd9ac8047a3 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotSwapRecoveryTest.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotSwapRecoveryTest.java @@ -21,7 +21,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -34,7 +33,7 @@ class SnapshotSwapRecoveryTest { @Test - void testRecoveryCompletesInterruptedSwap(@TempDir final Path databasesDir) throws IOException { + void recoveryCompletesInterruptedSwap(@TempDir final Path databasesDir) throws Exception { // Simulate: download completed, swap started (backup created) but process crashed before cleanup final Path dbDir = databasesDir.resolve("mydb"); final Path snapshotNew = dbDir.resolve(".snapshot-new"); @@ -59,7 +58,7 @@ void testRecoveryCompletesInterruptedSwap(@TempDir final Path databasesDir) thro } @Test - void testRecoveryRollsBackIncompleteDownload(@TempDir final Path databasesDir) throws IOException { + void recoveryRollsBackIncompleteDownload(@TempDir final Path databasesDir) throws Exception { // Simulate: download was interrupted (no .snapshot-complete), backup exists final Path dbDir = databasesDir.resolve("mydb"); final Path snapshotNew = dbDir.resolve(".snapshot-new"); @@ -83,7 +82,7 @@ void testRecoveryRollsBackIncompleteDownload(@TempDir final Path databasesDir) t } @Test - void testRecoveryCleansUpOrphanedNewDir(@TempDir final Path databasesDir) throws IOException { + void recoveryCleansUpOrphanedNewDir(@TempDir final Path databasesDir) throws Exception { // Simulate: download interrupted before backup was created final Path dbDir = databasesDir.resolve("mydb"); final Path snapshotNew = dbDir.resolve(".snapshot-new"); @@ -104,7 +103,7 @@ void testRecoveryCleansUpOrphanedNewDir(@TempDir final Path databasesDir) throws } @Test - void testNoMarkerNoAction(@TempDir final Path databasesDir) throws IOException { + void noMarkerNoAction(@TempDir final Path databasesDir) throws Exception { // Clean database directory with no markers - should be a no-op final Path dbDir = databasesDir.resolve("mydb"); Files.createDirectories(dbDir); @@ -116,7 +115,7 @@ void testNoMarkerNoAction(@TempDir final Path databasesDir) throws IOException { } @Test - void testMultipleDatabasesRecoveredIndependently(@TempDir final Path databasesDir) throws IOException { + void multipleDatabasesRecoveredIndependently(@TempDir final Path databasesDir) throws Exception { // db1: needs swap completion; db2: needs rollback final Path db1 = databasesDir.resolve("db1"); final Path db1New = db1.resolve(".snapshot-new"); @@ -150,7 +149,7 @@ void testMultipleDatabasesRecoveredIndependently(@TempDir final Path databasesDi } @Test - void incompleteExtractionWithoutMarkerIsDiscarded(@TempDir final Path databasesDir) throws IOException { + void incompleteExtractionWithoutMarkerIsDiscarded(@TempDir final Path databasesDir) throws Exception { // Simulate: .snapshot-new exists (extraction started) but no .snapshot-complete marker inside it, // meaning extraction was interrupted before completing. No backup exists either. final Path dbDir = databasesDir.resolve("mydb"); @@ -175,7 +174,7 @@ void incompleteExtractionWithoutMarkerIsDiscarded(@TempDir final Path databasesD } @Test - void testRecoveryHandlesSwapCompletedButCleanupIncomplete(@TempDir final Path databasesDir) throws IOException { + void recoveryHandlesSwapCompletedButCleanupIncomplete(@TempDir final Path databasesDir) throws Exception { // Simulate: swap was completed (.snapshot-new renamed to live) but .snapshot-pending marker // and leftover .snapshot-new dir (with .snapshot-complete) still exist. No backup. final Path dbDir = databasesDir.resolve("mydb"); diff --git a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotSymlinkProtectionTest.java b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotSymlinkProtectionTest.java index 4626d0491dd..d51e39e6274 100644 --- a/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotSymlinkProtectionTest.java +++ b/ha-raft/src/test/java/com/arcadedb/server/ha/raft/SnapshotSymlinkProtectionTest.java @@ -22,7 +22,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.IOException; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -42,7 +41,7 @@ void copyWithLimitRejectsOversizedEntry() { } @Test - void copyWithLimitAllowsEntryWithinBounds() throws IOException { + void copyWithLimitAllowsEntryWithinBounds() throws Exception { final byte[] data = new byte[50]; final ByteArrayInputStream in = new ByteArrayInputStream(data); final ByteArrayOutputStream out = new ByteArrayOutputStream(); @@ -54,7 +53,7 @@ void copyWithLimitAllowsEntryWithinBounds() throws IOException { } @Test - void countingInputStreamTracksBytes() throws IOException { + void countingInputStreamTracksBytes() throws Exception { final byte[] data = new byte[] { 1, 2, 3, 4, 5 }; final SnapshotInstaller.CountingInputStream cis = new SnapshotInstaller.CountingInputStream(new ByteArrayInputStream(data)); diff --git a/run_adb_1.sh b/run_adb_1.sh deleted file mode 100755 index 542fed01dc9..00000000000 --- a/run_adb_1.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env sh -# -# Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -mkdir -p adb1 - -cd adb1 - -export JAVA_OPTS="-Darcadedb.ha.enabled=true \ --Darcadedb.server.rootPath=./ \ --Darcadedb.typeDefaultBuckets=5 \ --Darcadedb.server.rootPassword=playwithdata \ --Darcadedb.ha.raftPort=2434 \ --Darcadedb.ha.clusterToken=123456789 \ --Darcadedb.ha.implementation=raft \ --Darcadedb.ha.clusterName=mycluster \ --Darcadedb.ha.serverList=localhost:2434:2481:0,localhost:2435:2482:0,localhost:2436:2483:0 \ --Darcadedb.server.httpIncomingPort=2481 \ --Darcadedb.ha.quorum=majority \ --Darcadedb.server.plugins=RaftHAPlugin \ --Darcadedb.server.name=node_0" && \ -../package/target/arcadedb-26.4.1-SNAPSHOT.dir/arcadedb-26.4.1-SNAPSHOT/bin/server.sh \ --Dcom.sun.management.jmxremote=false -Dcom.sun.management.jmxremote.port=8888 -Dcom.sun.management.jmxremote.rmi.port=8887 diff --git a/run_adb_2.sh b/run_adb_2.sh deleted file mode 100755 index 9af93c44d3c..00000000000 --- a/run_adb_2.sh +++ /dev/null @@ -1,36 +0,0 @@ -run_adb_1.sh#!/usr/bin/env sh -# -# Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -mkdir -p adb2 - -cd adb2 - -export JAVA_OPTS="-Darcadedb.ha.enabled=true \ --Darcadedb.server.rootPassword=playwithdata \ --Darcadedb.server.rootPath=./ \ --Darcadedb.typeDefaultBuckets=5 \ --Darcadedb.ha.raftPort=2435 \ --Darcadedb.ha.clusterToken=123456789 \ --Darcadedb.ha.implementation=raft \ --Darcadedb.ha.clusterName=mycluster \ --Darcadedb.ha.serverList=localhost:2434:2481:10,localhost:2435:2482:0,localhost:2436:2483:0 \ --Darcadedb.server.httpIncomingPort=2482 \ --Darcadedb.ha.quorum=majority \ --Darcadedb.server.plugins=RaftHAPlugin \ --Darcadedb.server.name=node_1" && \ -../package/target/arcadedb-26.4.1-SNAPSHOT.dir/arcadedb-26.4.1-SNAPSHOT/bin/server.sh \ --Dcom.sun.management.jmxremote=false -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.rmi.port=9998 diff --git a/run_adb_3.sh b/run_adb_3.sh deleted file mode 100755 index 896933155a1..00000000000 --- a/run_adb_3.sh +++ /dev/null @@ -1,36 +0,0 @@ -run_adb_1.sh#!/usr/bin/env sh -# -# Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -mkdir -p adb3 - -cd adb3 - -export JAVA_OPTS="-Darcadedb.ha.enabled=true \ --Darcadedb.server.rootPassword=playwithdata \ --Darcadedb.server.rootPath=./ \ --Darcadedb.typeDefaultBuckets=5 \ --Darcadedb.ha.raftPort=2436 \ --Darcadedb.ha.clusterToken=123456789 \ --Darcadedb.ha.implementation=raft \ --Darcadedb.ha.clusterName=mycluster \ --Darcadedb.ha.serverList=localhost:2434:2481:10,localhost:2435:2482:0,localhost:2436:2483:0 \ --Darcadedb.server.httpIncomingPort=2483 \ --Darcadedb.ha.quorum=majority \ --Darcadedb.server.plugins=RaftHAPlugin \ --Darcadedb.server.name=node_2" && \ -../package/target/arcadedb-26.4.1-SNAPSHOT.dir/arcadedb-26.4.1-SNAPSHOT/bin/server.sh \ --Dcom.sun.management.jmxremote=false -Dcom.sun.management.jmxremote.port=7777 -Dcom.sun.management.jmxremote.rmi.port=7778 diff --git a/server/src/test/java/com/arcadedb/server/http/IdempotencyCacheTest.java b/server/src/test/java/com/arcadedb/server/http/IdempotencyCacheTest.java index 4847e86f7c3..61ab08102c0 100644 --- a/server/src/test/java/com/arcadedb/server/http/IdempotencyCacheTest.java +++ b/server/src/test/java/com/arcadedb/server/http/IdempotencyCacheTest.java @@ -25,7 +25,7 @@ class IdempotencyCacheTest { @Test - void testPutAndGetSuccess() { + void putAndGetSuccess() { final IdempotencyCache cache = new IdempotencyCache(60_000, 100); cache.putSuccess("req-1", 200, "{\"result\":\"ok\"}", null, "alice"); @@ -38,7 +38,7 @@ void testPutAndGetSuccess() { } @Test - void testNon2xxNotCached() { + void non2xxNotCached() { final IdempotencyCache cache = new IdempotencyCache(60_000, 100); cache.putSuccess("req-2", 400, "Bad Request", null, "alice"); assertThat(cache.get("req-2")).isNull(); @@ -51,7 +51,7 @@ void testNon2xxNotCached() { } @Test - void testNullRequestIdIgnored() { + void nullRequestIdIgnored() { final IdempotencyCache cache = new IdempotencyCache(60_000, 100); cache.putSuccess(null, 200, "body", null, "alice"); assertThat(cache.size()).isEqualTo(0); @@ -61,7 +61,7 @@ void testNullRequestIdIgnored() { } @Test - void testTtlExpiration() throws InterruptedException { + void ttlExpiration() throws Exception { final IdempotencyCache cache = new IdempotencyCache(50, 100); cache.putSuccess("req-5", 200, "body", null, "alice"); assertThat(cache.get("req-5")).isNotNull(); @@ -71,7 +71,7 @@ void testTtlExpiration() throws InterruptedException { } @Test - void testMaxSizeEviction() { + void maxSizeEviction() { final IdempotencyCache cache = new IdempotencyCache(60_000, 3); cache.putSuccess("req-a", 200, "a", null, "alice"); cache.putSuccess("req-b", 200, "b", null, "alice"); @@ -84,7 +84,7 @@ void testMaxSizeEviction() { } @Test - void testCleanupExpired() throws InterruptedException { + void cleanupExpired() throws Exception { final IdempotencyCache cache = new IdempotencyCache(50, 100); cache.putSuccess("req-x", 200, "x", null, "alice"); cache.putSuccess("req-y", 200, "y", null, "alice"); @@ -96,7 +96,7 @@ void testCleanupExpired() throws InterruptedException { } @Test - void testBinaryResponseCached() { + void binaryResponseCached() { final IdempotencyCache cache = new IdempotencyCache(60_000, 100); final byte[] data = new byte[] { 1, 2, 3 }; cache.putSuccess("req-bin", 200, null, data, "bob"); @@ -108,7 +108,7 @@ void testBinaryResponseCached() { } @Test - void testHeaderConstant() { + void headerConstant() { assertThat(IdempotencyCache.HEADER_REQUEST_ID).isEqualTo("X-Request-Id"); } }