maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1053475 - /maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/
Date Tue, 28 Dec 2010 23:06:26 GMT
Author: krosenvold
Date: Tue Dec 28 23:06:25 2010
New Revision: 1053475

URL: http://svn.apache.org/viewvc?rev=1053475&view=rev
Log:
o Simplified most of the IT's

Changed to a base class that better encapsulates common usage patterns.
Most common test case is now 3 simple lines instead of 15

Modified:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44Dep.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44HamcrestIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit4ForkAlwaysStaticInitPollutionIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit4RunListenerIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit47concurrencyIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4IgnoreIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4VersionsIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlainOldJavaClasspathIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SiblingAggregatorIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire146ForkPerTestNoSetupIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire162CharsetProviderIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire224WellFormedXmlFailuresIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire376TestNgAfterSuiteFailure.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire377TestNgAndJUnitTogetherIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire42NotExtendingTestCaseIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire44InnerClassTestIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire621TestCountingJunit3InParallelIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire628ConsoleOutputBeforeAndAfterClassIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire673MockitoIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SurefireVerifierTestClass.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SystemPropertiesTestIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UseIsolatedClassLoaderIT.java

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44Dep.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44Dep.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44Dep.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44Dep.java Tue Dec 28 23:06:25 2010
@@ -19,29 +19,24 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-
 /**
  * Test project using JUnit4.4 -dep.  junit-dep includes only junit.* classes, and depends explicitly on hamcrest-core
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class JUnit44Dep
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+    public JUnit44Dep()
+    {
+        super( "/junit44-dep" );
+    }
+
     public void testJUnit44Dep()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/junit44-dep" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+        executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44HamcrestIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44HamcrestIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44HamcrestIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44HamcrestIT.java Tue Dec 28 23:06:25 2010
@@ -19,29 +19,24 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-
 /**
  * Test project using JUnit4.4 (including Hamcrest extensions)
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class JUnit44HamcrestIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+    public JUnit44HamcrestIT()
+    {
+        super( "/junit44-hamcrest" );
+    }
+
     public void testJUnit44Hamcrest()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/junit44-hamcrest" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+        executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit4ForkAlwaysStaticInitPollutionIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit4ForkAlwaysStaticInitPollutionIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit4ForkAlwaysStaticInitPollutionIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit4ForkAlwaysStaticInitPollutionIT.java Tue Dec 28 23:06:25 2010
@@ -30,18 +30,19 @@ import java.io.File;
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class JUnit4ForkAlwaysStaticInitPollutionIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public JUnit4ForkAlwaysStaticInitPollutionIT()
+    {
+        super( "/junit4-forkAlways-staticInit" );
+    }
+
     public void testJunit4Ignore()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/junit4-forkAlways-staticInit" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 2, 0, 0, 0, testDir );
+        this.executeTest(  );
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 2, 0, 0, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit4RunListenerIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit4RunListenerIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit4RunListenerIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit4RunListenerIT.java Tue Dec 28 23:06:25 2010
@@ -19,41 +19,36 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
-import java.io.File;
-import java.util.List;
-
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
 import org.apache.maven.reporting.MavenReportException;
 
+import java.io.File;
+
 /**
  * JUnit4 RunListener Integration Test.
  * 
  * @author <a href="mailto:matthew.gilliard@gmail.com">Matthew Gilliard</a>
  */
 public class JUnit4RunListenerIT
-		extends AbstractSurefireIntegrationTestClass {
-	public void testJUnit4RunListener()
-			throws Exception {
-		final File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/junit4-runlistener");
-
-		final Verifier verifier = new Verifier(testDir.getAbsolutePath());
-        List goals = getInitialGoals();
-        goals.add( "-Dprovider=surefire-junit4" );
-        goals.add( "-DjunitVersion=4.4" );
-        goals.add( "test" );
-        this.executeGoals( verifier, goals );
-		verifier.verifyErrorFreeLog();
-		verifier.resetStreams();
+		extends SurefireVerifierTestClass {
+    public JUnit4RunListenerIT()
+    {
+        super( "/junit4-runlistener" );
+    }
 
-        assertResults( testDir );
+    public void testJUnit4RunListener()
+			throws Exception {
+        addGoal( "-Dprovider=surefire-junit4" );
+        addGoal( "-DjunitVersion=4.4" );
+        executeTest();
+		verifyErrorFreeLog();
+        assertResults();
 	}
 
-    private void assertResults( File testDir )
+    private void assertResults()
         throws MavenReportException
     {
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
-        final File targetDir = new File(testDir, "target");
+        assertTestSuiteResults( 1, 0, 0, 0 );
+        final File targetDir = getSubFile( "target");
 
         assertFileExists(new File(targetDir, "runlistener-output-1.txt"));
         assertFileExists(new File(targetDir, "runlistener-output-2.txt"));
@@ -63,17 +58,11 @@ public class JUnit4RunListenerIT
     public void testRunlistenerJunitCoreProvider()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/junit4-runlistener" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = getInitialGoals();
-        goals.add( "-Dprovider=surefire-junit47" );
-        goals.add( "-DjunitVersion=4.8.1" );
-        goals.add( "test" );
-        this.executeGoals( verifier, goals );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-        assertResults( testDir );
+        addGoal( "-Dprovider=surefire-junit47" );
+        addGoal( "-DjunitVersion=4.8.1" );
+        executeTest();
+        verifyErrorFreeLog();
+        assertResults();
     }
 
     private void assertFileExists(final File file) {

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit47concurrencyIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit47concurrencyIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit47concurrencyIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit47concurrencyIT.java Tue Dec 28 23:06:25 2010
@@ -19,46 +19,28 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-import java.util.List;
-
 /**
  * Basic suite test using all known versions of JUnit 4.x
  *
  * @author Kristian Rosenvold
  */
 public class Junit47concurrencyIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
 
-
-    public void test47()
-        throws Exception
+    public Junit47concurrencyIT()
     {
-        runJUnitTest();
+        super( "/concurrentjunit47" );
     }
 
-
-    public void runJUnitTest()
+    public void test47()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/concurrentjunit47" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List arguments = this.getInitialGoals();
-        arguments.add( "test" );
-        // DGF we have to pass in the version as a command line argument
-        // and NOT as a system property; otherwise our setting will be ignored
-        arguments.add( "-DjunitVersion=4.7" );
-        executeGoals( verifier, arguments );
-
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
+        // todo: Align with others
+        addGoal( "-DjunitVersion=4.7" );
+        executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 0 );
 
-        IntegrationTestSuiteResults suite = HelperAssertions.parseTestResults( new File[]{ testDir } );
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, suite );
     }
 }
\ No newline at end of file

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4IgnoreIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4IgnoreIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4IgnoreIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4IgnoreIT.java Tue Dec 28 23:06:25 2010
@@ -29,18 +29,18 @@ import java.io.File;
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class Junit4IgnoreIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+    public Junit4IgnoreIT()
+    {
+        super( "/junit44-ignore");
+    }
+
     public void testJunit4Ignore()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/junit44-ignore" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 1, testDir );
+        executeTest( );
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 1 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4VersionsIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4VersionsIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4VersionsIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Junit4VersionsIT.java Tue Dec 28 23:06:25 2010
@@ -19,21 +19,20 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-import java.util.List;
-
 /**
  * Basic suite test using all known versions of JUnit 4.x
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class Junit4VersionsIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
 
+    public Junit4VersionsIT()
+    {
+        super( "/junit4" );
+    }
+
     public void test40()
         throws Exception
     {
@@ -92,19 +91,9 @@ public class Junit4VersionsIT
     public void runJUnitTest( String version )
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/junit4" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List arguments = this.getInitialGoals();
-        arguments.add( "test" );
-        // DGF we have to pass in the version as a command line argument
-        // and NOT as a system property; otherwise our setting will be ignored
-        arguments.add( "-DjunitVersion=" + version );
-        executeGoals( verifier, arguments );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        IntegrationTestSuiteResults suite = HelperAssertions.parseTestResults( new File[]{ testDir } );
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, suite );
+        addGoal( "-DjunitVersion=" + version );
+        executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlainOldJavaClasspathIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlainOldJavaClasspathIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlainOldJavaClasspathIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/PlainOldJavaClasspathIT.java Tue Dec 28 23:06:25 2010
@@ -19,29 +19,25 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-
 /**
  * Test useManifestOnlyJar option
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class PlainOldJavaClasspathIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public PlainOldJavaClasspathIT()
+    {
+        super( "/plain-old-java-classpath" );
+    }
+
     public void testPlainOldJavaClasspath()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/plain-old-java-classpath" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+        this.executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SiblingAggregatorIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SiblingAggregatorIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SiblingAggregatorIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SiblingAggregatorIT.java Tue Dec 28 23:06:25 2010
@@ -32,6 +32,7 @@ import java.io.File;
 public class SiblingAggregatorIT
     extends AbstractSurefireIntegrationTestClass
 {
+
     public void testSiblingAggregator()
         throws Exception
     {

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire146ForkPerTestNoSetupIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire146ForkPerTestNoSetupIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire146ForkPerTestNoSetupIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire146ForkPerTestNoSetupIT.java Tue Dec 28 23:06:25 2010
@@ -19,30 +19,25 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-
 /**
  * Test Surefire-146 (forkMode=pertest fails to call setUp)
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class Surefire146ForkPerTestNoSetupIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public Surefire146ForkPerTestNoSetupIT()
+    {
+        super( "/surefire-146-forkPerTestNoSetup" );
+    }
+
     public void testForkPerTestNoSetup()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-146-forkPerTestNoSetup" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+        executeTest();
+        assertTestSuiteResults( 1, 0, 0, 0 );
 
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire162CharsetProviderIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire162CharsetProviderIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire162CharsetProviderIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire162CharsetProviderIT.java Tue Dec 28 23:06:25 2010
@@ -20,7 +20,6 @@ package org.apache.maven.surefire.its;
 
 
 import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
 import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;
@@ -31,23 +30,26 @@ import java.io.File;
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class Surefire162CharsetProviderIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+    public Surefire162CharsetProviderIT()
+    {
+        super( "/surefire-162-charsetProvider" );
+    }
+
+    @SuppressWarnings( { "ResultOfMethodCallIgnored" } )
     public void testCharsetProvider()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-162-charsetProvider" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        Verifier verifier = getVerifier();
         File jarFile = new File( verifier.getArtifactPath( "jcharset", "jcharset", "1.2.1", "jar" ) );
         jarFile.getParentFile().mkdirs();
-        FileUtils.copyFile( new File( testDir, "repo/jcharset/jcharset/1.2.1/jcharset-1.2.1.jar" ), jarFile );
-        FileUtils.copyFile( new File( testDir, "repo/jcharset/jcharset/1.2.1/jcharset-1.2.1.pom" ),
+        FileUtils.copyFile( getSubFile( "repo/jcharset/jcharset/1.2.1/jcharset-1.2.1.jar" ), jarFile );
+        FileUtils.copyFile( getSubFile( "repo/jcharset/jcharset/1.2.1/jcharset-1.2.1.pom" ),
                             new File( verifier.getArtifactPath( "jcharset", "jcharset", "1.2.1", "pom" ) ) );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
+        executeTest();
 
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire224WellFormedXmlFailuresIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire224WellFormedXmlFailuresIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire224WellFormedXmlFailuresIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire224WellFormedXmlFailuresIT.java Tue Dec 28 23:06:25 2010
@@ -33,22 +33,22 @@ import java.util.List;
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class Surefire224WellFormedXmlFailuresIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public Surefire224WellFormedXmlFailuresIT()
+    {
+        super( "/surefire-224-wellFormedXmlFailures" );
+    }
+
     public void testWellFormedXmlFailures()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-224-wellFormedXmlFailures" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        // DGF Don't verify error free log; we expect failures
-        // verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
+        executeTest( );
 
-        HelperAssertions.assertTestSuiteResults( 4, 0, 4, 0, testDir );
+        assertTestSuiteResults( 4, 0, 4, 0 );
 
-        ReportTestSuite suite = (ReportTestSuite) HelperAssertions.extractReports( ( new File[]{ testDir } ) ).get( 0 );
+        ReportTestSuite suite = (ReportTestSuite) HelperAssertions.extractReports( ( new File[]{ getTestDir() } ) ).get( 0 );
         List testCases = suite.getTestCases();
         assertEquals( "Wrong number of test case objects", 4, testCases.size() );
         ReportTestCase current, testQuote = null, testLower = null, testGreater = null, testU0000 = null;

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire376TestNgAfterSuiteFailure.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire376TestNgAfterSuiteFailure.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire376TestNgAfterSuiteFailure.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire376TestNgAfterSuiteFailure.java Tue Dec 28 23:06:25 2010
@@ -19,31 +19,24 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-
 /**
  * Test Surefire-376 (TestNG @AfterSuite failures are ignored)
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class Surefire376TestNgAfterSuiteFailure
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public Surefire376TestNgAfterSuiteFailure()
+    {
+        super( "/testng-afterSuiteFailure" );
+    }
+
     public void testAfterSuiteFailure()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/testng-afterSuiteFailure" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        // DGF Don't verify error free log; we expect failures
-        // verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 2, 0, 1, 0, testDir );
-
+        executeTest();
+        assertTestSuiteResults( 2, 0, 1, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire377TestNgAndJUnitTogetherIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire377TestNgAndJUnitTogetherIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire377TestNgAndJUnitTogetherIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire377TestNgAndJUnitTogetherIT.java Tue Dec 28 23:06:25 2010
@@ -18,29 +18,24 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-
 /**
  * SUREFIRE-377 (When JUnit and TestNG tests are in same project, only one set gets run).
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class Surefire377TestNgAndJUnitTogetherIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+    public Surefire377TestNgAndJUnitTogetherIT()
+    {
+        super( "/testng-junit-together" );
+    }
+
     public void testTestNgAndJUnitTogether()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/testng-junit-together" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 2, 0, 0, 0, testDir );
+        executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 2, 0, 0, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire42NotExtendingTestCaseIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire42NotExtendingTestCaseIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire42NotExtendingTestCaseIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire42NotExtendingTestCaseIT.java Tue Dec 28 23:06:25 2010
@@ -19,29 +19,25 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-
 /**
  * Test JUnit test that contains inner classes
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class Surefire42NotExtendingTestCaseIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public Surefire42NotExtendingTestCaseIT()
+    {
+        super( "/junit-notExtendingTestCase" );
+    }
+
     public void testInnerClass()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/junit-notExtendingTestCase" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+        executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire44InnerClassTestIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire44InnerClassTestIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire44InnerClassTestIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire44InnerClassTestIT.java Tue Dec 28 23:06:25 2010
@@ -19,29 +19,24 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-
 /**
  * Test JUnit test that contains inner classes
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class Surefire44InnerClassTestIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+    public Surefire44InnerClassTestIT()
+    {
+        super( "/junit-innerClass" );
+    }
+
     public void testInnerClass()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/junit-innerClass" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+        executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire621TestCountingJunit3InParallelIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire621TestCountingJunit3InParallelIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire621TestCountingJunit3InParallelIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire621TestCountingJunit3InParallelIT.java Tue Dec 28 23:06:25 2010
@@ -19,32 +19,25 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-
 /**
  * SUREFIRE-621 Asserts proper test counts when running junit 3 tests in parallel
  *
  * @author Kristian Rosenvold
  */
 public class Surefire621TestCountingJunit3InParallelIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public Surefire621TestCountingJunit3InParallelIT()
+    {
+        super( "/surefire-621-testCounting-junit3-in-parallel" );
+    }
+
     public void testJunit3ParallelBuildResultCount()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-621-testCounting-junit3-in-parallel" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        String[] opts = { "-fn" };
-        verifier.setCliOptions( new ArrayList( Arrays.asList( opts ) ) );
-        this.executeGoal( verifier, "install" );
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 6, 0, 0, 0, testDir );
+        failNever();
+        execute( "install" );
+        assertTestSuiteResults( 6, 0, 0, 0 );
     }
 }
\ No newline at end of file

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire628ConsoleOutputBeforeAndAfterClassIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire628ConsoleOutputBeforeAndAfterClassIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire628ConsoleOutputBeforeAndAfterClassIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire628ConsoleOutputBeforeAndAfterClassIT.java Tue Dec 28 23:06:25 2010
@@ -19,38 +19,32 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-
 /**
  * SUREFIRE-621 Asserts that console output always goes somewhere ;)
  *
  * @author Kristian Rosenvold
  */
 public class Surefire628ConsoleOutputBeforeAndAfterClassIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public Surefire628ConsoleOutputBeforeAndAfterClassIT()
+    {
+        super( "/surefire-628-consoleoutputbeforeandafterclass" );
+    }
+
     public void testJunit3ParallelBuildResultCount()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-628-consoleoutputbeforeandafterclass" );
+        failNever();
+        executeTest();
 
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        String[] opts = { "-fn" };
-        verifier.setCliOptions( new ArrayList( Arrays.asList( opts ) ) );
-        this.executeGoal( verifier, "test" );
-        verifier.resetStreams();
-
-        verifier.verifyTextInLog(  "628Test1");
-        verifier.verifyTextInLog(  "Before628Test1");
-        verifier.verifyTextInLog(  "After628Test1");
-        verifier.verifyTextInLog(  "628Test2");
-        verifier.verifyTextInLog(  "Before628Test2");
-        verifier.verifyTextInLog(  "After628Test2");
+        verifyTextInLog( "628Test1" );
+        verifyTextInLog( "Before628Test1" );
+        verifyTextInLog( "After628Test1" );
+        verifyTextInLog( "628Test2" );
+        verifyTextInLog( "Before628Test2" );
+        verifyTextInLog( "After628Test2" );
     }
 
 }
\ No newline at end of file

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire673MockitoIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire673MockitoIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire673MockitoIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire673MockitoIT.java Tue Dec 28 23:06:25 2010
@@ -19,26 +19,23 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-
 /**
  * SUREFIRE-673 Asserts that a given mockito build works as it should (classloader problem in 2.7)
  *
  * @author Kristian Rosenvold
  */
 public class Surefire673MockitoIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+    public Surefire673MockitoIT()
+    {
+        super( "/surefire-673-mockito" );
+    }
+
     public void testBuildFailingWhenErrors()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-673-mockito" );
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.resetStreams();
-        verifier.verifyErrorFreeLog( );
+        executeTest();
+        verifyErrorFreeLog();
     }
 }
\ No newline at end of file

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire674BuildFailingWhenErrorsIT.java Tue Dec 28 23:06:25 2010
@@ -21,10 +21,6 @@ package org.apache.maven.surefire.its;
 
 import junit.framework.Assert;
 import org.apache.maven.it.VerificationException;
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
 
 /**
  * SUREFIRE-674 Asserts that the build fails when tests have errors
@@ -32,22 +28,25 @@ import java.io.File;
  * @author Kristian Rosenvold
  */
 public class Surefire674BuildFailingWhenErrorsIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public Surefire674BuildFailingWhenErrorsIT()
+    {
+        super( "/surefire-674-buildFailingWhenErrors" );
+    }
+
     public void testBuildFailingWhenErrors()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-674-buildFailingWhenErrors" );
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         try
         {
-            this.executeGoal( verifier, "test" );
-            Assert.fail("The verifier should throw an exception");
+            executeTest();
+            Assert.fail( "The verifier should throw an exception" );
         }
         catch ( VerificationException ignore )
         {
         }
-        verifier.resetStreams();
-        verifier.verifyTextInLog( "BUILD FAILURE" );
+        verifyTextInLog( "BUILD FAILURE" );
     }
 }
\ No newline at end of file

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SurefireVerifierTestClass.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SurefireVerifierTestClass.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SurefireVerifierTestClass.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SurefireVerifierTestClass.java Tue Dec 28 23:06:25 2010
@@ -19,6 +19,11 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
+import junit.framework.TestCase;
+import org.apache.maven.artifact.versioning.ArtifactVersion;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.it.VerificationException;
 import org.apache.maven.it.Verifier;
 import org.apache.maven.it.util.ResourceExtractor;
@@ -36,7 +41,7 @@ import java.util.List;
  * @author Kristian Rosenvold
  */
 public abstract class SurefireVerifierTestClass
-    extends AbstractSurefireIntegrationTestClass
+    extends TestCase
 {
     private final File testDir;
 
@@ -46,6 +51,11 @@ public abstract class SurefireVerifierTe
 
     private final Verifier verifier;
 
+    private final String testNgVersion = System.getProperty( "testng.version" );
+
+    private final String surefireVersion = System.getProperty( "surefire.version" );
+
+
 
     protected SurefireVerifierTestClass( String testProject )
     {
@@ -65,6 +75,70 @@ public abstract class SurefireVerifierTe
         }
     }
 
+
+    private List<String> getInitialGoals()
+    {
+        List<String> goals1 = new ArrayList<String>();
+        goals1.add( "-Dsurefire.version=" + surefireVersion );
+
+        if ( testNgVersion != null )
+        {
+            goals1.add( "-DtestNgVersion=" + testNgVersion );
+
+            ArtifactVersion v = new DefaultArtifactVersion( testNgVersion );
+            try
+            {
+                if ( VersionRange.createFromVersionSpec( "(,5.12.1)" ).containsVersion( v ) )
+                {
+                    goals1.add( "-DtestNgClassifier=jdk15" );
+                }
+            }
+            catch ( InvalidVersionSpecificationException e )
+            {
+                throw new RuntimeException( e.getMessage(), e );
+            }
+        }
+
+        return goals1;
+    }
+
+    protected List<String> getInitialGoals( String testNgVersion )
+    {
+        List<String> goals = new ArrayList<String>();
+        goals.add( "-Dsurefire.version=" + surefireVersion );
+
+        if ( testNgVersion != null )
+        {
+            goals.add( "-DtestNgVersion=" + testNgVersion );
+
+            ArtifactVersion v = new DefaultArtifactVersion( testNgVersion );
+            try
+            {
+                if ( VersionRange.createFromVersionSpec( "(,5.12.1)" ).containsVersion( v ) )
+                {
+                    goals.add( "-DtestNgClassifier=jdk15" );
+                }
+            }
+            catch ( InvalidVersionSpecificationException e )
+            {
+                throw new RuntimeException( e.getMessage(), e );
+            }
+        }
+
+        return goals;
+    }
+
+    /**
+     * Returns a file, referenced from the extracted root (where pom.xml is located)
+     *
+     * @param path The subdirectory under basedir
+     * @return A file
+     */
+    protected File getSubFile( String path )
+    {
+        return new File( testDir, path );
+    }
+
     protected void assertPresent( File file )
     {
         verifier.assertFilePresent( file.getAbsolutePath() );
@@ -108,14 +182,20 @@ public abstract class SurefireVerifierTe
     {
         addGoal( goal );
         verifier.setCliOptions( cliOptions );
-        verifier.executeGoals( goals );
-        verifier.resetStreams();
-        return verifier;
+        try
+        {
+            verifier.executeGoals( goals );
+            return verifier;
+        }
+        finally
+        {
+            verifier.resetStreams();
+        }
     }
 
     protected File getSurefireReportsFile( String fileName )
     {
-        File targetDir = new File( testDir, "target/surefire-reports" );
+        File targetDir = getSubFile( "target/surefire-reports" );
         return new File( targetDir, fileName );
     }
 
@@ -161,4 +241,22 @@ public abstract class SurefireVerifierTe
     {
         verifier.verifyTextInLog( text );
     }
+
+    protected void verifyErrorFreeLog()
+        throws VerificationException
+    {
+        verifier.verifyErrorFreeLog();
+    }
+
+    protected Verifier getVerifier()
+    {
+        return verifier;
+    }
+
+    public File getTestDir()
+    {
+        return testDir;
+    }
 }
+
+

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SystemPropertiesTestIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SystemPropertiesTestIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SystemPropertiesTestIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/SystemPropertiesTestIT.java Tue Dec 28 23:06:25 2010
@@ -18,55 +18,41 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * Test system properties
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class SystemPropertiesTestIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public SystemPropertiesTestIT()
+    {
+        super( "/system-properties" );
+    }
+
     public void testSystemProperties()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/system-properties" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List<String> goals = getInitialGoals();
-        goals.add( "test" );
-        goals.add( "-DsetOnMavenCommandLine=baz" );
-        goals.add( "-DsetOnArgLineWorkAround=baz" );
-        executeGoals( verifier, goals );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 7, 0, 0, 0, testDir );
+        addGoal( "-DsetOnMavenCommandLine=baz" );
+        addGoal( "-DsetOnArgLineWorkAround=baz" );
+        executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 7, 0, 0, 0 );
     }
 
     public void testSystemPropertiesNoFork()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/system-properties" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List<String> goals = getInitialGoals();
-        goals.add( "test" );
-        goals.add( "-DforkMode=never" );
-        goals.add( "-DsetOnArgLineWorkAround=baz" );
-        goals.add( "-DsetOnMavenCommandLine=baz" );
+        addGoal( "-DforkMode=never" );
+        addGoal( "-DsetOnArgLineWorkAround=baz" );
+        addGoal( "-DsetOnMavenCommandLine=baz" );
         // DGF fake the argLine, since we're not forking
-        goals.add( "-DsetOnArgLine=bar" );
-        executeGoals( verifier, goals );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
+        addGoal( "-DsetOnArgLine=bar" );
+        executeTest();
+        verifyErrorFreeLog();
 
-        HelperAssertions.assertTestSuiteResults( 7, 0, 0, 0, testDir );
+        assertTestSuiteResults( 7, 0, 0, 0 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java Tue Dec 28 23:06:25 2010
@@ -19,10 +19,6 @@ package org.apache.maven.surefire.its;
  */
 
 import org.apache.maven.it.VerificationException;
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
 
 /**
  * Test
@@ -30,29 +26,25 @@ import java.io.File;
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class TimeoutForkedTestIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public TimeoutForkedTestIT()
+    {
+        super( "/timeout-forked" );
+    }
+
     public void testTimeoutForked()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/timeout-forked" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-
         try
         {
-            this.executeGoal( verifier, "test" );
-            verifier.verifyErrorFreeLog();
+            executeTest();
+            verifyErrorFreeLog();
             fail( "Build didn't fail, but it should have" );
         }
-        catch ( VerificationException e )
+        catch ( VerificationException ignore )
         {
-            // as expected
         }
-        finally
-        {
-            verifier.resetStreams();
-        }
-
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UseIsolatedClassLoaderIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UseIsolatedClassLoaderIT.java?rev=1053475&r1=1053474&r2=1053475&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UseIsolatedClassLoaderIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/UseIsolatedClassLoaderIT.java Tue Dec 28 23:06:25 2010
@@ -19,29 +19,25 @@ package org.apache.maven.surefire.its;
  */
 
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-
-import java.io.File;
-
 /**
  * Test useSystemClassLoader option
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class UseIsolatedClassLoaderIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public UseIsolatedClassLoaderIT()
+    {
+        super( "/isolated-classloader" );
+    }
+
     public void testUseSystemClassLoader()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/isolated-classloader" );
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        this.executeGoal( verifier, "test" );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+        this.executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 0 );
     }
 }



Mime
View raw message