From 2b1fa80b63e5e0491830c9871fc67e3d41154d3d Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Wed, 27 May 2020 07:35:32 +1000 Subject: [PATCH] always run the test except if Docker not available Signed-off-by: olivier lamy --- .../test-sessions/test-jdbc-sessions/pom.xml | 29 ++----------------- .../ClusteredInvalidationSessionTest.java | 2 ++ .../session/ClusteredOrphanedSessionTest.java | 2 ++ .../ClusteredSessionMigrationTest.java | 2 ++ .../ClusteredSessionScavengingTest.java | 2 ++ .../session/JDBCSessionDataStoreTest.java | 2 ++ .../ReloadedSessionMissingClassTest.java | 2 ++ .../session/SessionTableSchemaTest.java | 2 ++ .../session/WebAppObjectInSessionTest.java | 2 ++ 9 files changed, 19 insertions(+), 26 deletions(-) diff --git a/tests/test-sessions/test-jdbc-sessions/pom.xml b/tests/test-sessions/test-jdbc-sessions/pom.xml index d6fe28174ab..a99398a0601 100644 --- a/tests/test-sessions/test-jdbc-sessions/pom.xml +++ b/tests/test-sessions/test-jdbc-sessions/pom.xml @@ -26,7 +26,9 @@ org.apache.maven.plugins maven-surefire-plugin - true + + ${mariadb.docker.version} + @@ -85,29 +87,4 @@ test - - - remote-session-tests - - - mariadb.enabled - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - - ${mariadb.docker.version} - - - - - - - diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredInvalidationSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredInvalidationSessionTest.java index 5107ed56079..a2d2d3f48ca 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredInvalidationSessionTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredInvalidationSessionTest.java @@ -19,10 +19,12 @@ package org.eclipse.jetty.server.session; import org.junit.jupiter.api.AfterEach; +import org.testcontainers.junit.jupiter.Testcontainers; /** * ClusteredInvalidationSessionTest */ +@Testcontainers(disabledWithoutDocker = true) public class ClusteredInvalidationSessionTest extends AbstractClusteredInvalidationSessionTest { diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredOrphanedSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredOrphanedSessionTest.java index 9ab354ad180..4a55fd495ff 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredOrphanedSessionTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredOrphanedSessionTest.java @@ -19,10 +19,12 @@ package org.eclipse.jetty.server.session; import org.junit.jupiter.api.AfterEach; +import org.testcontainers.junit.jupiter.Testcontainers; /** * ClusteredOrphanedSessionTest */ +@Testcontainers(disabledWithoutDocker = true) public class ClusteredOrphanedSessionTest extends AbstractClusteredOrphanedSessionTest { /** diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionMigrationTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionMigrationTest.java index b1ae366c8b2..2fc4ccb5c21 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionMigrationTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionMigrationTest.java @@ -31,6 +31,7 @@ import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Request; import org.junit.jupiter.api.AfterEach; 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.assertTrue; @@ -45,6 +46,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * Rather, it tests all of the machinery above the SessionDataStore. Thus, * to reduce test time, we only apply it to the JDBCSessionDataStore. */ +@Testcontainers(disabledWithoutDocker = true) public class ClusteredSessionMigrationTest extends AbstractTestBase { diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java index aaab3eac778..45542dacfaa 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java @@ -19,10 +19,12 @@ package org.eclipse.jetty.server.session; import org.junit.jupiter.api.AfterEach; +import org.testcontainers.junit.jupiter.Testcontainers; /** * ClusteredSessionScavengingTest */ +@Testcontainers(disabledWithoutDocker = true) public class ClusteredSessionScavengingTest extends AbstractClusteredSessionScavengingTest { /** diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JDBCSessionDataStoreTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JDBCSessionDataStoreTest.java index 845ddc750e7..6fa37149a8c 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JDBCSessionDataStoreTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JDBCSessionDataStoreTest.java @@ -20,10 +20,12 @@ package org.eclipse.jetty.server.session; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.testcontainers.junit.jupiter.Testcontainers; /** * JDBCSessionDataStoreTest */ +@Testcontainers(disabledWithoutDocker = true) public class JDBCSessionDataStoreTest extends AbstractSessionDataStoreTest { diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java index 27f1fad3c6a..50976c1c131 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java @@ -37,6 +37,7 @@ import org.eclipse.jetty.webapp.WebAppContext; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.testcontainers.junit.jupiter.Testcontainers; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -47,6 +48,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * ReloadedSessionMissingClassTest */ @ExtendWith(WorkDirExtension.class) +@Testcontainers(disabledWithoutDocker = true) public class ReloadedSessionMissingClassTest { public WorkDir testdir; diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java index 224d93cde7d..2319e4e861c 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java @@ -27,6 +27,7 @@ import org.eclipse.jetty.server.handler.ContextHandler; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; 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.assertFalse; @@ -38,6 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; * Test the SessionTableSchema behaviour when the database treats "" as a NULL, * like Oracle does. */ +@Testcontainers(disabledWithoutDocker = true) public class SessionTableSchemaTest { DatabaseAdaptor _da; diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/WebAppObjectInSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/WebAppObjectInSessionTest.java index e17e495002b..85b0525babd 100644 --- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/WebAppObjectInSessionTest.java +++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/WebAppObjectInSessionTest.java @@ -21,10 +21,12 @@ package org.eclipse.jetty.server.session; import org.eclipse.jetty.util.resource.Resource; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.testcontainers.junit.jupiter.Testcontainers; /** * WebAppObjectInSessionTest */ +@Testcontainers(disabledWithoutDocker = true) public class WebAppObjectInSessionTest extends AbstractWebAppObjectInSessionTest {