Skip to content

Commit

Permalink
Migrate RoutingExamplesIT to Testcontainers (#1215)
Browse files Browse the repository at this point in the history
  • Loading branch information
injectives authored May 10, 2022
1 parent 59600be commit dfb609a
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 1,300 deletions.
10 changes: 10 additions & 0 deletions driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>neo4j</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Flux;

Expand Down Expand Up @@ -88,7 +87,6 @@
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import static org.neo4j.driver.SessionConfig.builder;

@ExtendWith( DumpLogsOnFailureWatcher.class )
abstract class AbstractStressTestBase<C extends AbstractContext>
{
private static final int THREAD_COUNT = Integer.getInteger( "threadCount", 8 );
Expand Down Expand Up @@ -202,8 +200,6 @@ private void runStressTest( Function<C,List<Future<?>>> threadLauncher ) throws
verifyResults( context, resourcesInfo );
}

abstract void dumpLogs();

abstract URI databaseUri();

abstract AuthToken authToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.neo4j.driver.stress;

import org.junit.jupiter.api.extension.RegisterExtension;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.net.URI;
import java.util.Arrays;
Expand All @@ -30,6 +31,7 @@
import org.neo4j.driver.exceptions.SessionExpiredException;
import org.neo4j.driver.util.cc.LocalOrRemoteClusterExtension;

@Testcontainers( disabledWithoutDocker = true )
class CausalClusteringStressIT extends AbstractStressTestBase<CausalClusteringStressIT.Context>
{
@RegisterExtension
Expand Down Expand Up @@ -84,12 +86,6 @@ void printStats( Context context )
System.out.println( "Bookmark failures: " + context.getBookmarkFailures() );
}

@Override
void dumpLogs()
{
clusterRule.dumpClusterLogs();
}

@Override
List<BlockingCommand<Context>> createTestSpecificBlockingCommands()
{
Expand All @@ -112,5 +108,4 @@ int getLeaderSwitchCount()
return leaderSwitches.get();
}
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,4 @@ List<RxCommand<Context>> createTestSpecificRxCommands()
static class Context extends AbstractContext
{
}

@Override
void dumpLogs()
{
neo4j.dumpLogs();
}
}
Loading

0 comments on commit dfb609a

Please sign in to comment.