use @Testcontainers to disable test if docker not available (#5678)

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
This commit is contained in:
Olivier Lamy 2020-11-17 16:20:16 +10:00 committed by GitHub
parent 213ac63d2c
commit 48b89f9394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 36 additions and 0 deletions

View File

@ -66,6 +66,11 @@
<artifactId>testcontainers</artifactId> <artifactId>testcontainers</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.testcontainers</groupId> <groupId>org.testcontainers</groupId>
<artifactId>gcloud</artifactId> <artifactId>gcloud</artifactId>

View File

@ -23,10 +23,12 @@ import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.testcontainers.junit.jupiter.Testcontainers;
/** /**
* ClusteredOrphanedSessionTest * ClusteredOrphanedSessionTest
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class ClusteredOrphanedSessionTest extends AbstractClusteredOrphanedSessionTest public class ClusteredOrphanedSessionTest extends AbstractClusteredOrphanedSessionTest
{ {

View File

@ -22,10 +22,12 @@ import org.eclipse.jetty.server.session.AbstractClusteredSessionScavengingTest;
import org.eclipse.jetty.server.session.SessionDataStoreFactory; import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.junit.jupiter.Testcontainers;
/** /**
* ClusteredSessionScavengingTest * ClusteredSessionScavengingTest
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class ClusteredSessionScavengingTest extends AbstractClusteredSessionScavengingTest public class ClusteredSessionScavengingTest extends AbstractClusteredSessionScavengingTest
{ {

View File

@ -24,10 +24,12 @@ import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.junit.jupiter.Testcontainers;
/** /**
* GCloudSessionDataStoreTest * GCloudSessionDataStoreTest
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class GCloudSessionDataStoreTest extends AbstractSessionDataStoreTest public class GCloudSessionDataStoreTest extends AbstractSessionDataStoreTest
{ {

View File

@ -22,10 +22,12 @@ import org.eclipse.jetty.server.session.AbstractClusteredInvalidationSessionTest
import org.eclipse.jetty.server.session.SessionDataStoreFactory; import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.junit.jupiter.Testcontainers;
/** /**
* InvalidationSessionTest * InvalidationSessionTest
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class InvalidationSessionTest extends AbstractClusteredInvalidationSessionTest public class InvalidationSessionTest extends AbstractClusteredInvalidationSessionTest
{ {

View File

@ -145,6 +145,11 @@
<artifactId>testcontainers</artifactId> <artifactId>testcontainers</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<profiles> <profiles>
<!-- to test hotrod, configure a cache called "remote-session-test" --> <!-- to test hotrod, configure a cache called "remote-session-test" -->

View File

@ -23,10 +23,12 @@ import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory; import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.junit.jupiter.Testcontainers;
/** /**
* InvalidationSessionTest * InvalidationSessionTest
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class RemoteClusteredInvalidationSessionTest extends AbstractClusteredInvalidationSessionTest public class RemoteClusteredInvalidationSessionTest extends AbstractClusteredInvalidationSessionTest
{ {

View File

@ -23,10 +23,12 @@ import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory; import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.junit.jupiter.Testcontainers;
/** /**
* ClusteredSessionScavengingTest * ClusteredSessionScavengingTest
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class RemoteClusteredSessionScavengingTest extends AbstractClusteredSessionScavengingTest public class RemoteClusteredSessionScavengingTest extends AbstractClusteredSessionScavengingTest
{ {

View File

@ -36,6 +36,7 @@ import org.infinispan.query.dsl.QueryFactory;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.testcontainers.junit.jupiter.Testcontainers;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
@ -43,6 +44,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
/** /**
* RemoteInfinispanSessionDataStoreTest * RemoteInfinispanSessionDataStoreTest
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class RemoteInfinispanSessionDataStoreTest extends AbstractSessionDataStoreTest public class RemoteInfinispanSessionDataStoreTest extends AbstractSessionDataStoreTest
{ {

View File

@ -38,6 +38,7 @@ import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.eclipse.jetty.server.session.TestServer; import org.eclipse.jetty.server.session.TestServer;
import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletContextHandler;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.testcontainers.junit.jupiter.Testcontainers;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
@ -47,6 +48,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
/** /**
* CachingSessionDataStoreTest * CachingSessionDataStoreTest
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class CachingSessionDataStoreTest public class CachingSessionDataStoreTest
{ {

View File

@ -37,6 +37,7 @@ import org.eclipse.jetty.server.session.TestServer;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.testcontainers.junit.jupiter.Testcontainers;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
@ -49,6 +50,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* properly escaped and not accidentally removed. * properly escaped and not accidentally removed.
* See bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=444595 * See bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=444595
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class AttributeNameTest public class AttributeNameTest
{ {

View File

@ -22,7 +22,9 @@ import org.eclipse.jetty.server.session.AbstractClusteredInvalidationSessionTest
import org.eclipse.jetty.server.session.SessionDataStoreFactory; import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.junit.jupiter.Testcontainers;
@Testcontainers(disabledWithoutDocker = true)
public class ClusteredInvalidateSessionTest extends AbstractClusteredInvalidationSessionTest public class ClusteredInvalidateSessionTest extends AbstractClusteredInvalidationSessionTest
{ {

View File

@ -23,10 +23,12 @@ import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.testcontainers.junit.jupiter.Testcontainers;
/** /**
* ClusteredOrphanedSessionTest * ClusteredOrphanedSessionTest
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class ClusteredOrphanedSessionTest extends AbstractClusteredOrphanedSessionTest public class ClusteredOrphanedSessionTest extends AbstractClusteredOrphanedSessionTest
{ {

View File

@ -22,7 +22,9 @@ import org.eclipse.jetty.server.session.AbstractClusteredSessionScavengingTest;
import org.eclipse.jetty.server.session.SessionDataStoreFactory; import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.junit.jupiter.Testcontainers;
@Testcontainers(disabledWithoutDocker = true)
public class ClusteredSessionScavengingTest extends AbstractClusteredSessionScavengingTest public class ClusteredSessionScavengingTest extends AbstractClusteredSessionScavengingTest
{ {

View File

@ -33,6 +33,7 @@ import org.eclipse.jetty.servlet.ServletContextHandler;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.testcontainers.junit.jupiter.Testcontainers;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
@ -40,6 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
/** /**
* MongoSessionDataStoreTest * MongoSessionDataStoreTest
*/ */
@Testcontainers(disabledWithoutDocker = true)
public class MongoSessionDataStoreTest extends AbstractSessionDataStoreTest public class MongoSessionDataStoreTest extends AbstractSessionDataStoreTest
{ {