maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject [2/2] git commit: More java5
Date Thu, 11 Apr 2013 19:11:19 GMT
More java5


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/9b609fe7
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/9b609fe7
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/9b609fe7

Branch: refs/heads/master
Commit: 9b609fe7a435f2e5990406ee594c352e193457ca
Parents: 3a2014f
Author: Kristian Rosenvold <krosenvold@apache.org>
Authored: Thu Apr 11 21:11:11 2013 +0200
Committer: Kristian Rosenvold <krosenvold@apache.org>
Committed: Thu Apr 11 21:11:11 2013 +0200

----------------------------------------------------------------------
 .../surefire/group/match/AndGroupMatcher.java      |    6 +-----
 .../surefire/group/match/InverseGroupMatcher.java  |    4 ++--
 .../maven/surefire/group/match/OrGroupMatcher.java |    6 +-----
 .../surefire/common/junit3/JUnit3Reflector.java    |    2 +-
 .../maven/surefire/junit/JUnit3Provider.java       |    3 +--
 .../apache/maven/surefire/junit/PojoTestSet.java   |   14 ++++++--------
 .../junit/TestListenerInvocationHandler.java       |    2 +-
 .../maven/surefire/junit/JUnitTestSetTest.java     |    2 +-
 8 files changed, 14 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/9b609fe7/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/AndGroupMatcher.java
----------------------------------------------------------------------
diff --git a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/AndGroupMatcher.java
b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/AndGroupMatcher.java
index 474dbae..9fbfcf2 100644
--- a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/AndGroupMatcher.java
+++ b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/AndGroupMatcher.java
@@ -113,11 +113,7 @@ public class AndGroupMatcher
             return false;
         }
         AndGroupMatcher other = (AndGroupMatcher) obj;
-        if ( !getMatchers().equals( other.getMatchers() ) )
-        {
-            return false;
-        }
-        return true;
+        return getMatchers().equals( other.getMatchers() );
     }
 
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/9b609fe7/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/InverseGroupMatcher.java
----------------------------------------------------------------------
diff --git a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/InverseGroupMatcher.java
b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/InverseGroupMatcher.java
index 24f57db..567c328 100644
--- a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/InverseGroupMatcher.java
+++ b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/InverseGroupMatcher.java
@@ -32,12 +32,12 @@ public class InverseGroupMatcher
 
     public boolean enabled( Class<?>... cats )
     {
-        return cats == null ? true : !matcher.enabled( cats );
+        return cats == null || !matcher.enabled( cats );
     }
 
     public boolean enabled( String... cats )
     {
-        return cats == null ? true : !matcher.enabled( cats );
+        return cats == null || !matcher.enabled( cats );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/9b609fe7/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/OrGroupMatcher.java
----------------------------------------------------------------------
diff --git a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/OrGroupMatcher.java
b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/OrGroupMatcher.java
index 9bfce9a..6073b04 100644
--- a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/OrGroupMatcher.java
+++ b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/OrGroupMatcher.java
@@ -113,10 +113,6 @@ public class OrGroupMatcher
             return false;
         }
         AndGroupMatcher other = (AndGroupMatcher) obj;
-        if ( !getMatchers().equals( other.getMatchers() ) )
-        {
-            return false;
-        }
-        return true;
+        return getMatchers().equals( other.getMatchers() );
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/9b609fe7/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3/JUnit3Reflector.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3/JUnit3Reflector.java
b/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3/JUnit3Reflector.java
index 1dd5b64..3ffec88 100644
--- a/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3/JUnit3Reflector.java
+++ b/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3/JUnit3Reflector.java
@@ -137,7 +137,7 @@ public final class JUnit3Reflector
             }
             else
             {
-                testObject = testConstructor.newInstance( new Object[]{ testClass.getName()
} );
+                testObject = testConstructor.newInstance( testClass.getName() );
             }
         }
         return testObject;

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/9b609fe7/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
index 448ba5a..22e7069 100644
--- a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
+++ b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
@@ -102,9 +102,8 @@ public class JUnit3Provider
             System.setSecurityManager( securityManager );
         }
 
-        for ( Iterator iter = testsToRun.iterator(); iter.hasNext(); )
+        for ( Class clazz : testsToRun )
         {
-            Class clazz = (Class) iter.next();
             SurefireTestSet surefireTestSet = createTestSet( clazz );
             executeTestSet( surefireTestSet, reporter, testClassLoader );
         }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/9b609fe7/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoTestSet.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoTestSet.java
b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoTestSet.java
index 464b857..1fe381a 100644
--- a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoTestSet.java
+++ b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoTestSet.java
@@ -40,7 +40,7 @@ public class PojoTestSet
 
     private final Object testObject;
 
-    private List testMethods;
+    private List<Method> testMethods;
 
     private Method setUpMethod;
 
@@ -99,7 +99,7 @@ public class PojoTestSet
 
         for ( int i = 0; i < testMethods.size() && !abort; ++i )
         {
-            abort = executeTestMethod( (Method) testMethods.get( i ), EMPTY_OBJECT_ARRAY,
reportManager );
+            abort = executeTestMethod( testMethods.get( i ), EMPTY_OBJECT_ARRAY, reportManager
);
         }
     }
 
@@ -224,7 +224,7 @@ public class PojoTestSet
     {
         if ( setUpMethod != null )
         {
-            setUpMethod.invoke( testObject, new Object[0] );
+            setUpMethod.invoke( testObject );
         }
     }
 
@@ -233,7 +233,7 @@ public class PojoTestSet
     {
         if ( tearDownMethod != null )
         {
-            tearDownMethod.invoke( testObject, new Object[0] );
+            tearDownMethod.invoke( testObject );
         }
     }
 
@@ -241,14 +241,12 @@ public class PojoTestSet
     {
         if ( testMethods == null )
         {
-            testMethods = new ArrayList();
+            testMethods = new ArrayList<Method>();
 
             Method[] methods = getTestClass().getMethods();
 
-            for ( int i = 0; i < methods.length; ++i )
+            for ( Method m : methods )
             {
-                Method m = methods[i];
-
                 if ( isValidTestMethod( m ) )
                 {
                     String simpleName = m.getName();

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/9b609fe7/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/TestListenerInvocationHandler.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/TestListenerInvocationHandler.java
b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/TestListenerInvocationHandler.java
index dc19b1e..01e564b 100644
--- a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/TestListenerInvocationHandler.java
+++ b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/TestListenerInvocationHandler.java
@@ -41,7 +41,7 @@ public class TestListenerInvocationHandler
 
     private static final String END_TEST = "endTest";
 
-    private final Set failedTestsSet = new HashSet();
+    private final Set<FailedTest> failedTestsSet = new HashSet<FailedTest>();
 
     private RunListener reporter;
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/9b609fe7/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
b/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
index 229ea8b..aac3655 100644
--- a/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
+++ b/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
@@ -61,7 +61,7 @@ public class JUnitTestSetTest
         implements RunListener
     {
 
-        private List succeededTests = new ArrayList();
+        private List<ReportEntry> succeededTests = new ArrayList<ReportEntry>();
 
         public void testSetStarting( ReportEntry report )
         {


Mime
View raw message