maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1226312 - in /maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its: CheckTestNgBeforeMethodFailureIT.java CheckTestNgBeforeMethodIT.java CheckTestNgSuiteXmlIT.java ClassPathOrderIT.java
Date Sun, 01 Jan 2012 22:41:26 GMT
Author: krosenvold
Date: Sun Jan  1 22:41:25 2012
New Revision: 1226312

URL: http://svn.apache.org/viewvc?rev=1226312&view=rev
Log:
o Changed tests to use simpler base class

Modified:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodFailureIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ClassPathOrderIT.java

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodFailureIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodFailureIT.java?rev=1226312&r1=1226311&r2=1226312&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodFailureIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodFailureIT.java
Sun Jan  1 22:41:25 2012
@@ -20,11 +20,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 org.apache.maven.surefire.its.misc.HelperAssertions;
-
-import java.io.File;
 
 /**
  * Test failures in @BeforeMethod annotation on TestNg suite
@@ -32,30 +27,26 @@ import java.io.File;
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class CheckTestNgBeforeMethodFailureIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public CheckTestNgBeforeMethodFailureIT()
+    {
+        super( "/testng-beforeMethodFailure" );
+    }
+
     public void testTestNgBeforeMethodFailure()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/testng-beforeMethodFailure"
);
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         try
         {
-            this.executeGoal( verifier, "test" );
-            verifier.resetStreams();
-            verifier.verifyErrorFreeLog();
+            executeTest();
+            verifyErrorFreeLog();
             fail( "Build didn't fail, but it should" );
         }
-        catch ( VerificationException e )
-        {
-            // as expected
-        }
-        finally
+        catch ( VerificationException ignore )
         {
-            verifier.resetStreams();
         }
-
-        HelperAssertions.assertTestSuiteResults( 2, 0, 1, 1, testDir );
+        assertTestSuiteResults( 2, 0, 1, 1 );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodIT.java?rev=1226312&r1=1226311&r2=1226312&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodIT.java
Sun Jan  1 22:41:25 2012
@@ -19,11 +19,8 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-import org.apache.maven.surefire.its.misc.HelperAssertions;
-
 import java.io.File;
+import org.apache.maven.it.util.ResourceExtractor;
 
 /**
  * Test @BeforeMethod annotation on TestNg suite
@@ -31,18 +28,19 @@ import java.io.File;
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class CheckTestNgBeforeMethodIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public CheckTestNgBeforeMethodIT()
+    {
+        super( "/testng-beforeMethod" );
+    }
+
     public void testTestNgBeforeMethod()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/testng-beforeMethod"
);
-
-        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/CheckTestNgSuiteXmlIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlIT.java?rev=1226312&r1=1226311&r2=1226312&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlIT.java
Sun Jan  1 22:41:25 2012
@@ -19,49 +19,32 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-import org.apache.maven.surefire.its.misc.HelperAssertions;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.List;
-
 /**
  * Test simple TestNG suite XML file
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class CheckTestNgSuiteXmlIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public CheckTestNgSuiteXmlIT()
+    {
+        super( "/testng-suite-xml" );
+    }
+
     public void testTestNgSuiteXml()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/testng-suite-xml"
);
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List<String> goals = getInitialGoals();
-        goals.add( "test" );
-        executeGoals( verifier, goals );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+        executeTest();
+        verifyErrorFreeLog();
+        assertTestSuiteResults( 1, 0, 0, 0 );
     }
 
     public void testTestNgSuiteXmlForkModeAlways()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/testng-suite-xml"
);
-
-        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List<String> goals = getInitialGoals();
-        goals.addAll( Arrays.asList( new String[]{ "test", "-DforkMode=always" } ) );
-        executeGoals( verifier, goals );
-        verifier.verifyErrorFreeLog();
-        verifier.resetStreams();
-
-        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );
+        forkAlways();
+        testTestNgSuiteXml();
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ClassPathOrderIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ClassPathOrderIT.java?rev=1226312&r1=1226311&r2=1226312&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ClassPathOrderIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ClassPathOrderIT.java
Sun Jan  1 22:41:25 2012
@@ -19,30 +19,25 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
-import org.apache.maven.it.Verifier;
-import org.apache.maven.it.util.ResourceExtractor;
-import org.apache.maven.surefire.its.misc.HelperAssertions;
-
-import java.io.File;
-
 /**
  * Test for checking the order of class path elements
  *
  * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
  */
 public class ClassPathOrderIT
-    extends AbstractSurefireIntegrationTestClass
+    extends SurefireVerifierTestClass
 {
+
+    public ClassPathOrderIT()
+    {
+        super( "/classpath-order" );
+    }
+
     public void testClassPathOrder()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/classpath-order"
);
-
-        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 );
     }
 }



Mime
View raw message