maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1074764 - /maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/
Date Sat, 26 Feb 2011 00:41:52 GMT
Author: hboutemy
Date: Sat Feb 26 00:41:51 2011
New Revision: 1074764

URL: http://svn.apache.org/viewvc?rev=1074764&view=rev
Log:
added generics

Modified:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractSurefireIntegrationTestClass.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsForkModeIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.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/CheckTestNgSuiteXmlSingleIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/HelperAssertions.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ResultCountingIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire141PluggableProvidersIT.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/SurefireVerifierTestClass.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TwoTestCasesIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractSurefireIntegrationTestClass.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractSurefireIntegrationTestClass.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractSurefireIntegrationTestClass.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractSurefireIntegrationTestClass.java
Sat Feb 26 00:41:51 2011
@@ -84,7 +84,7 @@ public abstract class AbstractSurefireIn
     }
 
     @SuppressWarnings( { "unchecked" } )
-    protected void executeGoals( Verifier verifier, List goals )
+    protected void executeGoals( Verifier verifier, List<String> goals )
         throws VerificationException
     {
         if ( !verifier.getCliOptions().contains( "-s" ) )

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportIT.java
Sat Feb 26 00:41:51 2011
@@ -39,7 +39,7 @@ public class AggregateReportIT
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/aggregate-report"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = this.getInitialGoals();
+        List<String> goals = this.getInitialGoals();
         goals.add( "org.apache.maven.plugins:maven-surefire-report-plugin:" + getSurefireVersion()
+ ":report" );
         executeGoals( verifier, goals );
         //DGF even though the build will succeed, the log will contain errors (from the failure)

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
Sat Feb 26 00:41:51 2011
@@ -41,7 +41,7 @@ public class CheckSingleTestIT
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/default-configuration"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = this.getInitialGoals();
+        List<String> goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-Dtest=BasicTest" );
         executeGoals( verifier, goals );
@@ -57,7 +57,7 @@ public class CheckSingleTestIT
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/default-configuration"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = this.getInitialGoals();
+        List<String> goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-Dtest=BasicTest.java" );
         executeGoals( verifier, goals );
@@ -73,7 +73,7 @@ public class CheckSingleTestIT
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/default-configuration"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = this.getInitialGoals();
+        List<String> goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-Dtest=DoesNotExist" );
 
@@ -102,7 +102,7 @@ public class CheckSingleTestIT
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/default-configuration"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = this.getInitialGoals();
+        List<String> goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-Dtest=DoesNotExist" );
         goals.add( "-DfailIfNoTests=false" );

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsForkModeIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsForkModeIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsForkModeIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsForkModeIT.java
Sat Feb 26 00:41:51 2011
@@ -79,7 +79,7 @@ public class CheckTestFailIfNoTestsForkM
             ResourceExtractor.simpleExtractResources( getClass(), "/default-configuration-classWithNoTests"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = this.getInitialGoals();
+        List<String> goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-DforkMode=" + forkMode );
         goals.add( "-DfailIfNoTests=" + failIfNoTests );

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java
Sat Feb 26 00:41:51 2011
@@ -40,7 +40,7 @@ public class CheckTestFailIfNoTestsIT
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/default-configuration-noTests"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = this.getInitialGoals();
+        List<String> goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-DfailIfNoTests" );
 

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=1074764&r1=1074763&r2=1074764&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
Sat Feb 26 00:41:51 2011
@@ -40,7 +40,7 @@ public class CheckTestNgSuiteXmlIT
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/testng-suite-xml"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = getInitialGoals();
+        List<String> goals = getInitialGoals();
         goals.add( "test" );
         executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();
@@ -55,7 +55,7 @@ public class CheckTestNgSuiteXmlIT
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/testng-suite-xml"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = getInitialGoals();
+        List<String> goals = getInitialGoals();
         goals.addAll( Arrays.asList( new String[]{ "test", "-DforkMode=always" } ) );
         executeGoals( verifier, goals );
         verifier.verifyErrorFreeLog();

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java
Sat Feb 26 00:41:51 2011
@@ -22,6 +22,8 @@ package org.apache.maven.surefire.its;
 import java.io.File;
 import java.util.List;
 
+import org.apache.maven.plugins.surefire.report.ReportTestSuite;
+
 /**
  * Use -Dtest to run a single TestNG test, overriding the suite XML parameter.
  *
@@ -42,7 +44,7 @@ public class CheckTestNgSuiteXmlSingleIT
         executeTest();
         verifyErrorFreeLog();
 
-        List reports = HelperAssertions.extractReports( ( new File[]{ getTestDir() } ) );
+        List<ReportTestSuite> reports = HelperAssertions.extractReports( ( new File[]{
getTestDir() } ) );
         IntegrationTestSuiteResults results = HelperAssertions.parseReportList( reports );
         HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, results );
     }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
Sat Feb 26 00:41:51 2011
@@ -153,7 +153,7 @@ public class CheckTestNgVersionsIT
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/testng-simple"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List arguments = this.getInitialGoals( version );
+        List<String> arguments = this.getInitialGoals( version );
         arguments.add( "test" );
 
         executeGoals( verifier, arguments );

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
Sat Feb 26 00:41:51 2011
@@ -110,7 +110,7 @@ public class ForkModeIT
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/fork-mode"
);
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
-        List goals = this.getInitialGoals();
+        List<String> goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-DforkMode=" + forkMode );
         executeGoals( verifier, goals );

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/HelperAssertions.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/HelperAssertions.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/HelperAssertions.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/HelperAssertions.java
Sat Feb 26 00:41:51 2011
@@ -60,7 +60,7 @@ public class HelperAssertions
     protected static IntegrationTestSuiteResults parseTestResults( File[] testDirs )
         throws MavenReportException
     {
-        List reports = extractReports( testDirs );
+        List<ReportTestSuite> reports = extractReports( testDirs );
         IntegrationTestSuiteResults results = parseReportList( reports );
         return results;
     }
@@ -68,7 +68,7 @@ public class HelperAssertions
     /**
      * Converts a list of ReportTestSuites into an IntegrationTestSuiteResults object, suitable
for summary assertions
      */
-    protected static IntegrationTestSuiteResults parseReportList( List reports )
+    protected static IntegrationTestSuiteResults parseReportList( List<ReportTestSuite>
reports )
     {
         Assert.assertTrue( "No reports!", reports.size() > 0 );
         int total = 0, errors = 0, failures = 0, skipped = 0;
@@ -84,7 +84,7 @@ public class HelperAssertions
         return results;
     }
 
-    protected static List extractReports( File testDir )
+    protected static List<ReportTestSuite> extractReports( File testDir )
     {
         return extractReports( new File[]{ testDir } );
     }
@@ -92,9 +92,9 @@ public class HelperAssertions
     /**
      * Extracts a list of ReportTestSuites from the specified testDirs
      */
-    protected static List extractReports( File[] testDirs )
+    protected static List<ReportTestSuite> extractReports( File[] testDirs )
     {
-        List reportsDirs = new ArrayList();
+        List<File> reportsDirs = new ArrayList<File>();
         for ( int i = 0; i < testDirs.length; i++ )
         {
             File testDir = testDirs[i];
@@ -103,7 +103,7 @@ public class HelperAssertions
             reportsDirs.add( reportsDir );
         }
         SurefireReportParser parser = new SurefireReportParser( reportsDirs, Locale.getDefault()
);
-        List reports;
+        List<ReportTestSuite> reports;
         try
         {
             reports = parser.parseXMLReportFiles();

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ResultCountingIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ResultCountingIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ResultCountingIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ResultCountingIT.java
Sat Feb 26 00:41:51 2011
@@ -65,8 +65,8 @@ public class ResultCountingIT
 
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         String[] opts = { "-fn" };
-        verifier.setCliOptions( new ArrayList( Arrays.asList( opts ) ) );
-        List goals = getGoals( forkMode );
+        verifier.setCliOptions( new ArrayList<String>( Arrays.asList( opts ) ) );
+        List<String> goals = getGoals( forkMode );
         this.executeGoals( verifier, goals );
 
         verifier.resetStreams();
@@ -76,9 +76,9 @@ public class ResultCountingIT
         verifier.verifyTextInLog( "Tests run: 36, Failures: 4, Errors: 23, Skipped: 2" );
     }
 
-    private List getGoals( String forkMode )
+    private List<String> getGoals( String forkMode )
     {
-        List goals = this.getInitialGoals();
+        List<String> goals = this.getInitialGoals();
         goals.add( "test" );
         goals.add( "-DforkMode=" + forkMode );
         return goals;

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
Sat Feb 26 00:41:51 2011
@@ -58,57 +58,57 @@ public class RunOrderIT
         throws Exception
     {
         int startHour = Calendar.getInstance().get( Calendar.HOUR_OF_DAY );
-        final List actual = executeWithRunOrder( "hourly" );
+        final List<String> actual = executeWithRunOrder( "hourly" );
         int endHour = Calendar.getInstance().get( Calendar.HOUR_OF_DAY );
         if ( startHour != endHour )
         {
             return; // Race condition, cannot test when hour changed mid-run
         }
 
-        List expected = ( ( startHour % 2 ) == 0 ) ? getAlphabetical() : getReverseAlphabetical();
+        List<String> expected = ( ( startHour % 2 ) == 0 ) ? getAlphabetical() : getReverseAlphabetical();
         if ( !contains( actual, expected ) )
         {
             throw new VerificationException( "Response does not contain expected item" );
         }
     }
 
-    private boolean contains( List items, List expected )
+    private boolean contains( List<String> items, List<String> expected )
     {
-        Iterator expectedIterator = expected.iterator();
+        Iterator<String> expectedIterator = expected.iterator();
         String next = (String) expectedIterator.next();
-        Iterator content = items.iterator();
+        Iterator<String> content = items.iterator();
         while ( content.hasNext() )
         {
-            String line = (String) content.next();
+            String line = content.next();
             if ( line.startsWith( next ) )
             {
                 if ( !expectedIterator.hasNext() )
                 {
                     return true;
                 }
-                next = (String) expectedIterator.next();
+                next = expectedIterator.next();
             }
         }
         return content.hasNext();
     }
 
-    private void checkOrder( String alphabetical, List expected )
+    private void checkOrder( String alphabetical, List<String> expected )
         throws VerificationException, MavenReportException, IOException
     {
-        final List list = executeWithRunOrder( alphabetical );
+        final List<String> list = executeWithRunOrder( alphabetical );
         if ( !contains( list, expected ) )
         {
             throw new VerificationException( "Response does not contain expected item" );
         }
     }
 
-    private List executeWithRunOrder( String runOrder )
+    private List<String> executeWithRunOrder( String runOrder )
         throws IOException, VerificationException, MavenReportException
     {
         File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/runOrder"
);
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
 
-        List goals = getInitialGoals();
+        List<String> goals = getInitialGoals();
         goals.add( "-DrunOrder=" + runOrder );
         goals.add( "test" );
         this.executeGoals( verifier, goals );
@@ -118,12 +118,12 @@ public class RunOrderIT
         return verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false
);
     }
 
-    private List getAlphabetical()
+    private List<String> getAlphabetical()
     {
         return Arrays.asList( new String[]{ "TA", "TB", "TC" } );
     }
 
-    private List getReverseAlphabetical()
+    private List<String> getReverseAlphabetical()
     {
         return Arrays.asList( new String[]{ "TC", "TB", "TA" } );
     }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
Sat Feb 26 00:41:51 2011
@@ -117,9 +117,9 @@ public final class StagedLocalRepoHelper
             settings.addActiveProfile( profile.getId() );
             settings.setLocalRepository( stagedLocalRepo.getAbsolutePath() );
 
-            for ( Iterator it = settings.getProfiles().iterator(); it.hasNext(); )
+            for ( Iterator<Profile> it = settings.getProfiles().iterator(); it.hasNext();
)
             {
-                profile = (Profile) it.next();
+                profile = it.next();
                 disableUpdates( profile.getRepositories() );
                 disableUpdates( profile.getPluginRepositories() );
             }
@@ -134,13 +134,13 @@ public final class StagedLocalRepoHelper
         }
     }
 
-    private static void disableUpdates( List repositories )
+    private static void disableUpdates( List<Repository> repositories )
     {
         if ( repositories != null )
         {
-            for ( Iterator it = repositories.iterator(); it.hasNext(); )
+            for ( Iterator<Repository> it = repositories.iterator(); it.hasNext();
)
             {
-                Repository repo = (Repository) it.next();
+                Repository repo = it.next();
                 repo.setReleases( disableUpdates( repo.getReleases() ) );
                 repo.setSnapshots( disableUpdates( repo.getSnapshots() ) );
             }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire141PluggableProvidersIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire141PluggableProvidersIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire141PluggableProvidersIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire141PluggableProvidersIT.java
Sat Feb 26 00:41:51 2011
@@ -45,7 +45,7 @@ public class Surefire141PluggableProvide
         testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-141-pluggableproviders/test"
);
         verifier = new Verifier( testDir.getAbsolutePath() );
         String[] opts = { "-e" };
-        verifier.setCliOptions( new ArrayList( Arrays.asList( opts ) ) );
+        verifier.setCliOptions( new ArrayList<String>( Arrays.asList( opts ) ) );
         this.executeGoal( verifier, "install" );
 
         verifier.verifyTextInLog( "Using configured provider org.apache.maven.surefire.testprovider.TestProvider"
);

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=1074764&r1=1074763&r2=1074764&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
Sat Feb 26 00:41:51 2011
@@ -47,12 +47,11 @@ public class Surefire224WellFormedXmlFai
         assertTestSuiteResults( 4, 0, 4, 0 );
 
         ReportTestSuite suite = (ReportTestSuite) HelperAssertions.extractReports( ( new
File[]{ getTestDir() } ) ).get( 0 );
-        List testCases = suite.getTestCases();
+        List<ReportTestCase> testCases = suite.getTestCases();
         assertEquals( "Wrong number of test case objects", 4, testCases.size() );
-        ReportTestCase current, testQuote = null, testLower = null, testGreater = null, testU0000
= null;
-        for ( int i = 0; i < testCases.size(); i++ )
+        ReportTestCase testQuote = null, testLower = null, testGreater = null, testU0000
= null;
+        for ( ReportTestCase current : testCases )
         {
-            current = (ReportTestCase) testCases.get( i );
             if ( "testQuote".equals( current.getName() ) )
             {
                 testQuote = current;

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=1074764&r1=1074763&r2=1074764&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
Sat Feb 26 00:41:51 2011
@@ -80,7 +80,7 @@ public abstract class SurefireVerifierTe
         }
     }
 
-    private File simpleExtractResources( Class cl, String resourcePath )
+    private File simpleExtractResources( Class<?> cl, String resourcePath )
         throws IOException
     {
         String tempDirPath = System.getProperty( "maven.test.tmpdir", System.getProperty(
"java.io.tmpdir" ) );

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TwoTestCasesIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TwoTestCasesIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TwoTestCasesIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TwoTestCasesIT.java
Sat Feb 26 00:41:51 2011
@@ -60,8 +60,8 @@ public class TwoTestCasesIT
         this.executeGoal( verifier, "test" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
-        List reports = HelperAssertions.extractReports( ( new File[]{ testDir } ) );
-        Set classNames = extractClassNames( reports );
+        List<ReportTestSuite> reports = HelperAssertions.extractReports( ( new File[]{
testDir } ) );
+        Set<String> classNames = extractClassNames( reports );
         assertContains( classNames, "junit.twoTestCaseSuite.BasicTest" );
         assertContains( classNames, "junit.twoTestCaseSuite.TestTwo" );
         assertEquals( "wrong number of classes", 2, classNames.size() );
@@ -69,7 +69,7 @@ public class TwoTestCasesIT
         HelperAssertions.assertTestSuiteResults( 2, 0, 0, 0, results );
     }
 
-    private void assertContains( Set set, String expected )
+    private void assertContains( Set<String> set, String expected )
     {
         if ( set.contains( expected ) )
         {
@@ -78,13 +78,11 @@ public class TwoTestCasesIT
         fail( "Set didn't contain " + expected );
     }
 
-    private Set extractClassNames( List reports )
+    private Set<String> extractClassNames( List<ReportTestSuite> reports )
     {
-        ReportTestSuite suite;
-        HashSet classNames = new HashSet();
-        for ( int i = 0; i < reports.size(); i++ )
+        HashSet<String> classNames = new HashSet<String>();
+        for ( ReportTestSuite suite : reports )
         {
-            suite = (ReportTestSuite) reports.get( i );
             classNames.add( suite.getFullClassName() );
         }
         return classNames;
@@ -100,8 +98,8 @@ public class TwoTestCasesIT
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
-        List reports = HelperAssertions.extractReports( ( new File[]{ testDir } ) );
-        Set classNames = extractClassNames( reports );
+        List<ReportTestSuite> reports = HelperAssertions.extractReports( ( new File[]{
testDir } ) );
+        Set<String> classNames = extractClassNames( reports );
         assertContains( classNames, "twoTestCaseSuite.BasicTest" );
         assertContains( classNames, "twoTestCaseSuite.Junit4TestTwo" );
         assertEquals( "wrong number of classes", 2, classNames.size() );
@@ -119,8 +117,8 @@ public class TwoTestCasesIT
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
-        List reports = HelperAssertions.extractReports( ( new File[]{ testDir } ) );
-        Set classNames = extractClassNames( reports );
+        List<ReportTestSuite> reports = HelperAssertions.extractReports( ( new File[]{
testDir } ) );
+        Set<String> classNames = extractClassNames( reports );
         assertContains( classNames, "testng.two.TestNGTestTwo" );
         assertContains( classNames, "testng.two.TestNGSuiteTest" );
         assertEquals( "wrong number of classes", 2, classNames.size() );

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java?rev=1074764&r1=1074763&r2=1074764&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java
(original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java
Sat Feb 26 00:41:51 2011
@@ -24,7 +24,6 @@ import java.io.IOException;
 import java.util.List;
 import java.util.Properties;
 
-import org.apache.commons.lang.SystemUtils;
 import org.apache.maven.it.Verifier;
 import org.apache.maven.it.util.ResourceExtractor;
 



Mime
View raw message