diff --git a/its/core-it-suite/pom.xml b/its/core-it-suite/pom.xml index 7d7d7d5e36..4252e12078 100644 --- a/its/core-it-suite/pom.xml +++ b/its/core-it-suite/pom.xml @@ -498,6 +498,8 @@ under the License. **/MavenIT*.java + + disabled 0 true true diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest.java index e152ab255d..04cc10277a 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest.java @@ -25,7 +25,7 @@ import org.apache.maven.shared.verifier.Verifier; import java.io.File; import java.util.Properties; -import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; /** @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; * * @author Benjamin Bentmann */ -@Disabled +@Tag("disabled") public class MavenITmng4356NoNeedlessRelookupFromActiveCollectionTest extends AbstractMavenIntegrationTestCase { diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4565MultiConditionProfileActivationTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4565MultiConditionProfileActivationTest.java index dbfd8a2324..0316afdff7 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4565MultiConditionProfileActivationTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4565MultiConditionProfileActivationTest.java @@ -24,7 +24,7 @@ import org.apache.maven.shared.verifier.Verifier; import java.io.File; -import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; /** @@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; * When multiple activators are present in a profile they should be AND'd. All activator must * conditions must be satisfied in order for the profile to be activated. */ -@Disabled +@Tag("disabled") public class MavenITmng4565MultiConditionProfileActivationTest extends AbstractMavenIntegrationTestCase { diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4761PluginLevelDependencyScopesTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4761PluginLevelDependencyScopesTest.java index 8ce35220b0..783fad554c 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4761PluginLevelDependencyScopesTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4761PluginLevelDependencyScopesTest.java @@ -24,7 +24,7 @@ import org.apache.maven.shared.verifier.Verifier; import java.io.File; -import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; /** @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; * * @author jdcasey */ -@Disabled +@Tag("disabled") public class MavenITmng4761PluginLevelDependencyScopesTest extends AbstractMavenIntegrationTestCase { diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java index a0e6e27d93..a2c3e2f6f0 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5206PlexusLifecycleHonoured.java @@ -24,7 +24,7 @@ import org.apache.maven.shared.verifier.Verifier; import java.io.File; -import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; /** @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; * * @author Olivier Lamy */ -@Disabled +@Tag("disabled") public class MavenITmng5206PlexusLifecycleHonoured extends AbstractMavenIntegrationTestCase { diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java index 739f664146..4e0e5fef2b 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5418FileProjectPropertiesActivatorTest.java @@ -24,7 +24,7 @@ import org.apache.maven.shared.verifier.Verifier; import java.io.File; -import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; /** @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; * * @author Olivier Lamy */ -@Disabled +@Tag("disabled") public class MavenITmng5418FileProjectPropertiesActivatorTest extends AbstractMavenIntegrationTestCase { diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5503ZipInReactorTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5503ZipInReactorTest.java index b95e3fd810..50994049f6 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5503ZipInReactorTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5503ZipInReactorTest.java @@ -25,6 +25,7 @@ import org.apache.maven.shared.verifier.Verifier; import java.io.File; import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; /** @@ -32,6 +33,7 @@ import org.junit.jupiter.api.Test; * * @author jvz */ +@Tag( "disabled" ) @Disabled public class MavenITmng5503ZipInReactorTest extends AbstractMavenIntegrationTestCase diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java index b7a79c1960..b8a6644c42 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java @@ -25,7 +25,7 @@ import org.apache.maven.shared.verifier.VerificationException; import java.io.File; -import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; /** @@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test; * * @author jvanzyl */ -@Disabled +@Tag("disabled") public class MavenITmng5557ProperlyRestrictedReactor extends AbstractMavenIntegrationTestCase { diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java b/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java index aa361b9cc1..997f0891b7 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java @@ -22,14 +22,17 @@ package org.apache.maven.it; import java.io.PrintStream; import java.nio.file.Files; import java.nio.file.Paths; +import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.apache.maven.shared.verifier.Verifier; import org.junit.jupiter.api.ClassDescriptor; import org.junit.jupiter.api.ClassOrderer; import org.junit.jupiter.api.ClassOrdererContext; +import org.junit.jupiter.api.Tag; /** * The Core IT suite. @@ -39,6 +42,9 @@ public class TestSuiteOrdering implements ClassOrderer private static PrintStream out = System.out; + // store missed test to show info only once + private final static List> MISSED_TESTS = new ArrayList<>(); + final Map, Integer> tests = new HashMap<>(); private static void infoProperty( PrintStream info, String property ) @@ -746,21 +752,36 @@ public class TestSuiteOrdering implements ClassOrderer */ } - void addTestSuite( Class clazz ) { + void addTestSuite( Class clazz ) + { addTestSuite( clazz, tests.size() ); } - void addTestSuite( Class clazz, int order ) { + void addTestSuite( Class clazz, int order ) + { tests.put( clazz, order ); } - int getIndex( ClassDescriptor cd ) { + int getIndex( ClassDescriptor cd ) + { Integer i = tests.get( cd.getTestClass() ); return i != null ? i : -1; } public void orderClasses( ClassOrdererContext context ) { + context.getClassDescriptors().stream() + .filter( cd -> !MISSED_TESTS.contains( cd.getTestClass() ) ) + .filter( cd -> getIndex( cd ) == -1 ) + .filter( cd -> cd.findRepeatableAnnotations( Tag.class ).stream() + .noneMatch( t -> "disabled".equals( t.value() ) ) ) + .forEach( cd -> { + out.println( "Test " + cd.getTestClass() + + " is not present in TestSuiteOrdering " + System.lineSeparator() + + "\t- please add it or annotate with @Tag(\"disabled\")" + System.lineSeparator() ); + MISSED_TESTS.add( cd.getTestClass() ); + } ); + context.getClassDescriptors().sort( Comparator.comparing( this::getIndex ) ); }