File tree Expand file tree Collapse file tree 7 files changed +34
-29
lines changed
driver/src/test/java/org/neo4j/driver
examples/src/test/java/org/neo4j/docs/driver Expand file tree Collapse file tree 7 files changed +34
-29
lines changed Original file line number Diff line number Diff line change 22
22
import java .util .Arrays ;
23
23
import java .util .List ;
24
24
import java .util .concurrent .atomic .AtomicInteger ;
25
+ import org .junit .jupiter .api .condition .DisabledIfSystemProperty ;
25
26
import org .junit .jupiter .api .extension .RegisterExtension ;
26
27
import org .neo4j .driver .AuthToken ;
27
28
import org .neo4j .driver .Config ;
28
29
import org .neo4j .driver .exceptions .SessionExpiredException ;
29
30
import org .neo4j .driver .testutil .cc .LocalOrRemoteClusterExtension ;
30
- import org .testcontainers .junit .jupiter .Testcontainers ;
31
31
32
- @ Testcontainers ( disabledWithoutDocker = true )
32
+ @ DisabledIfSystemProperty ( named = "skipDockerTests" , matches = "^ true$" )
33
33
class CausalClusteringStressIT extends AbstractStressTestBase <CausalClusteringStressIT .Context > {
34
34
@ RegisterExtension
35
35
static final LocalOrRemoteClusterExtension clusterRule = new LocalOrRemoteClusterExtension ();
Original file line number Diff line number Diff line change 20
20
21
21
import org .neo4j .driver .Driver ;
22
22
import org .neo4j .driver .GraphDatabase ;
23
- import org .testcontainers .DockerClientFactory ;
24
23
import org .testcontainers .containers .Neo4jContainer ;
25
24
import org .testng .SkipException ;
26
25
@@ -39,18 +38,10 @@ public Driver getDriver() {
39
38
return GraphDatabase .driver (NEO4J .getBoltUrl ());
40
39
}
41
40
42
- public void skipIfDockerUnavailable () {
43
- if (!isDockerAvailable ()) {
41
+ public void skipIfDockerTestsSkipped () {
42
+ var skip = System .getProperty ("skipDockerTests" );
43
+ if (skip != null && skip .equals (Boolean .TRUE .toString ())) {
44
44
throw new SkipException ("Docker is unavailable" );
45
45
}
46
46
}
47
-
48
- private boolean isDockerAvailable () {
49
- try {
50
- DockerClientFactory .instance ().client ();
51
- return true ;
52
- } catch (Throwable ex ) {
53
- return false ;
54
- }
55
- }
56
47
}
Original file line number Diff line number Diff line change 27
27
import org .reactivestreams .Publisher ;
28
28
import org .reactivestreams .tck .PublisherVerification ;
29
29
import org .reactivestreams .tck .TestEnvironment ;
30
- import org .testcontainers .junit .jupiter .Testcontainers ;
31
30
import org .testng .annotations .AfterClass ;
32
31
import org .testng .annotations .BeforeClass ;
33
32
import reactor .core .publisher .Mono ;
34
33
35
- @ Testcontainers (disabledWithoutDocker = true )
36
34
public class ReactiveResultPublisherVerificationIT extends PublisherVerification <ReactiveResult > {
37
35
private final Neo4jManager NEO4J = new Neo4jManager ();
38
36
private static final Duration TIMEOUT = Duration .ofSeconds (10 );
@@ -49,7 +47,7 @@ public ReactiveResultPublisherVerificationIT() {
49
47
50
48
@ BeforeClass
51
49
public void beforeClass () {
52
- NEO4J .skipIfDockerUnavailable ();
50
+ NEO4J .skipIfDockerTestsSkipped ();
53
51
NEO4J .start ();
54
52
driver = NEO4J .getDriver ();
55
53
}
Original file line number Diff line number Diff line change 28
28
import org .reactivestreams .Publisher ;
29
29
import org .reactivestreams .tck .PublisherVerification ;
30
30
import org .reactivestreams .tck .TestEnvironment ;
31
- import org .testcontainers .junit .jupiter .Testcontainers ;
32
31
import org .testng .annotations .AfterClass ;
33
32
import org .testng .annotations .BeforeClass ;
34
33
import reactor .core .publisher .Flux ;
35
34
import reactor .core .publisher .Mono ;
36
35
37
- @ Testcontainers (disabledWithoutDocker = true )
38
36
public class ReactiveResultRecordPublisherVerificationIT extends PublisherVerification <Record > {
39
37
private final Neo4jManager NEO4J = new Neo4jManager ();
40
38
private static final long MAX_NUMBER_OF_RECORDS = 30000 ;
@@ -55,7 +53,7 @@ public ReactiveResultRecordPublisherVerificationIT() {
55
53
56
54
@ BeforeClass
57
55
public void beforeClass () {
58
- NEO4J .skipIfDockerUnavailable ();
56
+ NEO4J .skipIfDockerTestsSkipped ();
59
57
NEO4J .start ();
60
58
driver = NEO4J .getDriver ();
61
59
}
Original file line number Diff line number Diff line change 28
28
import org .reactivestreams .Publisher ;
29
29
import org .reactivestreams .tck .PublisherVerification ;
30
30
import org .reactivestreams .tck .TestEnvironment ;
31
- import org .testcontainers .junit .jupiter .Testcontainers ;
32
31
import org .testng .annotations .AfterClass ;
33
32
import org .testng .annotations .BeforeClass ;
34
33
35
- @ Testcontainers (disabledWithoutDocker = true )
36
34
@ SuppressWarnings ("deprecation" )
37
35
public class RxResultRecordPublisherVerificationIT extends PublisherVerification <Record > {
38
36
private final Neo4jManager NEO4J = new Neo4jManager ();
@@ -54,7 +52,7 @@ public RxResultRecordPublisherVerificationIT() {
54
52
55
53
@ BeforeClass
56
54
public void beforeClass () {
57
- NEO4J .skipIfDockerUnavailable ();
55
+ NEO4J .skipIfDockerTestsSkipped ();
58
56
NEO4J .start ();
59
57
driver = NEO4J .getDriver ();
60
58
}
Original file line number Diff line number Diff line change 18
18
*/
19
19
package org .neo4j .docs .driver ;
20
20
21
- import static org .junit .jupiter .api .Assertions .assertTrue ;
22
-
23
- import java .net .URI ;
24
- import java .util .Optional ;
25
21
import org .junit .jupiter .api .Test ;
22
+ import org .junit .jupiter .api .condition .DisabledIfSystemProperty ;
26
23
import org .neo4j .driver .AuthTokens ;
27
24
import org .neo4j .driver .net .ServerAddress ;
28
25
import org .testcontainers .containers .Neo4jContainer ;
29
26
import org .testcontainers .junit .jupiter .Container ;
30
- import org .testcontainers .junit .jupiter .Testcontainers ;
31
27
32
- @ Testcontainers (disabledWithoutDocker = true )
28
+ import java .net .URI ;
29
+ import java .util .Optional ;
30
+
31
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
32
+
33
+ @ DisabledIfSystemProperty (named = "skipDockerTests" , matches = "^true$" )
33
34
class RoutingExamplesIT {
34
35
private static final String NEO4J_VERSION =
35
36
Optional .ofNullable (System .getenv ("NEO4J_VERSION" )).orElse ("4.4" );
Original file line number Diff line number Diff line change 261
261
<parallelizable .it.forkCount>1</parallelizable .it.forkCount>
262
262
</properties >
263
263
</profile >
264
+
265
+ <profile >
266
+ <id >skip-docker-tests</id >
267
+ <build >
268
+ <pluginManagement >
269
+ <plugins >
270
+ <plugin >
271
+ <groupId >org.apache.maven.plugins</groupId >
272
+ <artifactId >maven-failsafe-plugin</artifactId >
273
+ <configuration >
274
+ <systemPropertyVariables >
275
+ <skipDockerTests >true</skipDockerTests >
276
+ </systemPropertyVariables >
277
+ </configuration >
278
+ </plugin >
279
+ </plugins >
280
+ </pluginManagement >
281
+ </build >
282
+ </profile >
264
283
</profiles >
265
284
266
285
<build >
You can’t perform that action at this time.
0 commit comments