maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r940762 [3/3] - in /maven/surefire/trunk: surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ surefire-providers/surefire-junit47/src...
Date Tue, 04 May 2010 07:56:40 GMT
Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreTestSetReporter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreTestSetReporter.java?rev=940762&r1=940761&r2=940762&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreTestSetReporter.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreTestSetReporter.java
Tue May  4 07:56:38 2010
@@ -19,11 +19,6 @@
 package org.apache.maven.surefire.junitcore;
 
 
-
-import java.util.ResourceBundle;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 import org.apache.maven.surefire.Surefire;
 import org.apache.maven.surefire.report.ReportEntry;
 import org.apache.maven.surefire.report.ReporterManager;
@@ -32,24 +27,28 @@ import org.junit.runner.Result;
 import org.junit.runner.notification.Failure;
 import org.junit.runner.notification.RunListener;
 
+import java.util.ResourceBundle;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 class JUnitCoreTestSetReporter
     extends RunListener
 {
 
-    private static final Pattern PARENS = Pattern.compile(
-            "^" +
-            "[^\\(\\)]+" + //non-parens
-            "\\((" + // then an open-paren (start matching a group)
-            "[^\\\\(\\\\)]+" + //non-parens
-            ")\\)" +
-            "$" ); // then a close-paren (end group match)
+    private static final Pattern PARENS = Pattern.compile( "^" + "[^\\(\\)]+" + //non-parens
+        "\\((" + // then an open-paren (start matching a group)
+        "[^\\\\(\\\\)]+" + //non-parens
+        ")\\)" + "$" ); // then a close-paren (end group match)
 
     // Constants
+
     private static ResourceBundle bundle = ResourceBundle.getBundle( Surefire.SUREFIRE_BUNDLE_NAME
);
 
 
     private Description currentRunStart;
+
     private String currentClassName;
+
     private ReporterManager reportMgr;
 
     /**
@@ -62,7 +61,7 @@ class JUnitCoreTestSetReporter
      *
      * @param reportManager the report manager to log testing events to
      */
-    JUnitCoreTestSetReporter(ReporterManager reportManager)
+    JUnitCoreTestSetReporter( ReporterManager reportManager )
     {
         this.reportMgr = reportManager;
     }
@@ -76,7 +75,7 @@ class JUnitCoreTestSetReporter
         throws Exception
     {
         String rawString = bundle.getString( "testSetStarting" );
-        currentClassName = extractClassName(description);
+        currentClassName = extractClassName( description );
         currentRunStart = description;
 
         ReportEntry report = new ReportEntry( description.getClassName(), currentClassName,
rawString );
@@ -106,7 +105,8 @@ class JUnitCoreTestSetReporter
         throws Exception
     {
         String rawString = bundle.getString( "testSkipped" );
-        ReportEntry report = new ReportEntry( description.getTestClass().getCanonicalName(),
description.getDisplayName(), rawString );
+        ReportEntry report =
+            new ReportEntry( description.getTestClass().getCanonicalName(), description.getDisplayName(),
rawString );
 
         this.reportMgr.testSkipped( report );
     }
@@ -120,7 +120,8 @@ class JUnitCoreTestSetReporter
         throws Exception
     {
         String rawString = bundle.getString( "testStarting" );
-        ReportEntry report = new ReportEntry( description.getTestClass().getCanonicalName(),
description.getDisplayName(), rawString );
+        ReportEntry report =
+            new ReportEntry( description.getTestClass().getCanonicalName(), description.getDisplayName(),
rawString );
 
         this.reportMgr.testStarting( report );
 
@@ -137,7 +138,8 @@ class JUnitCoreTestSetReporter
     {
         String rawString = bundle.getString( "executeException" );
         ReportEntry report =
-            new ReportEntry( failure.getDescription().getTestClass().getCanonicalName(),
failure.getTestHeader(), rawString, new JUnitCoreStackTraceWriter( failure ) );
+            new ReportEntry( failure.getDescription().getTestClass().getCanonicalName(),
failure.getTestHeader(),
+                             rawString, new JUnitCoreStackTraceWriter( failure ) );
 
         if ( failure.getException() instanceof AssertionError )
         {
@@ -162,7 +164,9 @@ class JUnitCoreTestSetReporter
         if ( failureFlag == false )
         {
             String rawString = bundle.getString( "testSuccessful" );
-            ReportEntry report = new ReportEntry( description.getTestClass().getCanonicalName(),
description.getDisplayName(), rawString );
+            ReportEntry report =
+                new ReportEntry( description.getTestClass().getCanonicalName(), description.getDisplayName(),
+                                 rawString );
 
             this.reportMgr.testSucceeded( report );
         }
@@ -172,7 +176,10 @@ class JUnitCoreTestSetReporter
     {
         String displayName = description.getDisplayName();
         Matcher m = PARENS.matcher( displayName );
-        if (!m.find()) return displayName;
+        if ( !m.find() )
+        {
+            return displayName;
+        }
         return m.group( 1 );
     }
 

Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/TestsToRun.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/TestsToRun.java?rev=940762&r1=940761&r2=940762&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/TestsToRun.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/TestsToRun.java
Tue May  4 07:56:38 2010
@@ -20,51 +20,63 @@ package org.apache.maven.surefire.junitc
 
 import org.apache.maven.surefire.testset.TestSetFailedException;
 
-import java.util.Map;
-import java.util.HashMap;
 import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * Contains all the tests that have been found according to specified include/exclude
  * specification for a given surefire run.
+ *
  * @author Kristian Rosenvold (junit core adaption)
  */
-class TestsToRun {
+class TestsToRun
+{
     final Class[] locatedClasses;
+
     final int totalTests;
+
     Map<String, JUnitCoreTestSet> testSets;
 
-    public TestsToRun(Class... locatedClasses) throws TestSetFailedException {
+    public TestsToRun( Class... locatedClasses )
+        throws TestSetFailedException
+    {
         this.locatedClasses = locatedClasses;
         testSets = new HashMap<String, JUnitCoreTestSet>();
         int testCount = 0;
-        for (int i = 0; i < locatedClasses.length; i++) {
+        for ( int i = 0; i < locatedClasses.length; i++ )
+        {
             Class testClass = locatedClasses[i];
-            JUnitCoreTestSet testSet = new JUnitCoreTestSet(testClass);
+            JUnitCoreTestSet testSet = new JUnitCoreTestSet( testClass );
 
-            if (testSets.containsKey(testSet.getName())) {
-                throw new TestSetFailedException("Duplicate test set '" + testSet.getName()
+ "'");
+            if ( testSets.containsKey( testSet.getName() ) )
+            {
+                throw new TestSetFailedException( "Duplicate test set '" + testSet.getName()
+ "'" );
             }
-            testSets.put(testSet.getName(), testSet);
+            testSets.put( testSet.getName(), testSet );
             testCount++;
         }
         this.totalTests = testCount;
     }
 
-    public Map<String, JUnitCoreTestSet> getTestSets() {
-        return Collections.unmodifiableMap(testSets);
+    public Map<String, JUnitCoreTestSet> getTestSets()
+    {
+        return Collections.unmodifiableMap( testSets );
     }
 
-    public int size() {
+    public int size()
+    {
         return testSets.size();
     }
 
-    public Class[] getLocatedClasses() {
+    public Class[] getLocatedClasses()
+    {
         return locatedClasses;
     }
 
-    public JUnitCoreTestSet getTestSet(String name){
-        return testSets.get( name);
+    public JUnitCoreTestSet getTestSet( String name )
+    {
+        return testSets.get( name );
     }
 
 }

Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DemultiplexingRunListenerTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DemultiplexingRunListenerTest.java?rev=940762&r1=940761&r2=940762&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DemultiplexingRunListenerTest.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DemultiplexingRunListenerTest.java
Tue May  4 07:56:38 2010
@@ -22,12 +22,12 @@ package org.apache.maven.surefire.junitc
 
 import junit.framework.Assert;
 import org.junit.Ignore;
+import org.junit.Test;
 import org.junit.runner.Computer;
 import org.junit.runner.Description;
 import org.junit.runner.JUnitCore;
 import org.junit.runner.Result;
 import org.junit.runner.notification.RunListener;
-import org.junit.Test;
 
 import static junit.framework.Assert.assertEquals;
 import static org.mockito.Mockito.*;
@@ -36,94 +36,112 @@ import static org.mockito.Mockito.*;
  * @author Kristian Rosenvold
  */
 
-public class DemultiplexingRunListenerTest {
+public class DemultiplexingRunListenerTest
+{
     @Test
-    public void testTestStarted() throws Exception {
-        RunListener real = mock(RunListener.class);
-        DemultiplexingRunListener listener = new DemultiplexingRunListener(real);
-
-        Description testRunDescription = Description.createSuiteDescription(DemultiplexingRunListenerTest.class);
-        Description description1 = Description.createTestDescription( DemultiplexingRunListenerTest.class,
"testStub1");
-        Description description2 = Description.createTestDescription( Dummy.class, "testStub2");
+    public void testTestStarted()
+        throws Exception
+    {
+        RunListener real = mock( RunListener.class );
+        DemultiplexingRunListener listener = new DemultiplexingRunListener( real );
+
+        Description testRunDescription = Description.createSuiteDescription( DemultiplexingRunListenerTest.class
);
+        Description description1 =
+            Description.createTestDescription( DemultiplexingRunListenerTest.class, "testStub1"
);
+        Description description2 = Description.createTestDescription( Dummy.class, "testStub2"
);
         testRunDescription.addChild( description1 );
         testRunDescription.addChild( description2 );
 
-        listener.testRunStarted(testRunDescription);
-        listener.testStarted(description1);
-        listener.testStarted(description2);
-        listener.testFinished(description1);
-        listener.testFinished(description2);
+        listener.testRunStarted( testRunDescription );
+        listener.testStarted( description1 );
+        listener.testStarted( description2 );
+        listener.testFinished( description1 );
+        listener.testFinished( description2 );
         Result temp = new Result();
-        listener.testRunFinished( temp);
+        listener.testRunFinished( temp );
 
-        verify(real).testRunStarted( any( Description.class));
-        verify(real).testStarted( description1);
-        verify(real).testFinished( description1);
-        verify(real).testStarted( description2);
-        verify(real).testFinished( description2);
-        verify(real).testRunFinished( any( Result.class));
+        verify( real ).testRunStarted( any( Description.class ) );
+        verify( real ).testStarted( description1 );
+        verify( real ).testFinished( description1 );
+        verify( real ).testStarted( description2 );
+        verify( real ).testFinished( description2 );
+        verify( real ).testRunFinished( any( Result.class ) );
     }
 
     @Test
-    public void testJunitResultCountingReferenceValue() throws Exception {
+    public void testJunitResultCountingReferenceValue()
+        throws Exception
+    {
         Result result = new Result();
-        runACoupleOfClasses(  result );
+        runACoupleOfClasses( result );
 
-        assertEquals( 5, result.getRunCount());
+        assertEquals( 5, result.getRunCount() );
         assertEquals( 1, result.getIgnoreCount() );
         assertEquals( 1, result.getFailureCount() );
     }
 
     @Test
-    public void testJunitResultCountingDemultiplexed() throws Exception {
+    public void testJunitResultCountingDemultiplexed()
+        throws Exception
+    {
         Result result = new Result();
         runACoupleOfClasses( result );
 
-        assertEquals(5, result.getRunCount());
+        assertEquals( 5, result.getRunCount() );
         assertEquals( 1, result.getIgnoreCount() );
         assertEquals( 1, result.getFailureCount() );
     }
 
     private void runACoupleOfClasses( Result result )
     {
-        DemultiplexingRunListener demultiplexingRunListener = new DemultiplexingRunListener(result.createListener());
+        DemultiplexingRunListener demultiplexingRunListener = new DemultiplexingRunListener(
result.createListener() );
 
         JUnitCore jUnitCore = new JUnitCore();
 
-        jUnitCore.addListener( demultiplexingRunListener);
+        jUnitCore.addListener( demultiplexingRunListener );
         Computer computer = new Computer();
 
-        jUnitCore.run(computer, new Class[] { Dummy.class, Dummy2.class});
+        jUnitCore.run( computer, new Class[]{ Dummy.class, Dummy2.class } );
     }
 
-    public static class Dummy {
+    public static class Dummy
+    {
         @Test
-        public void testNotMuch(){
+        public void testNotMuch()
+        {
 
         }
 
         @Ignore
         @Test
-        public void testStub1() {
+        public void testStub1()
+        {
         }
+
         @Test
-        public void testStub2() {
+        public void testStub2()
+        {
         }
     }
 
-    public static class Dummy2 {
+    public static class Dummy2
+    {
 
         @Test
-        public void testNotMuchA(){
+        public void testNotMuchA()
+        {
 
         }
 
         @Test
-        public void testStub1A() {
-            Assert.fail("We will fail");
+        public void testStub1A()
+        {
+            Assert.fail( "We will fail" );
         }
+
         @Test
-        public void testStub2A() {
+        public void testStub2A()
+        {
         }
     }
 

Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java?rev=940762&r1=940761&r2=940762&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java
Tue May  4 07:56:38 2010
@@ -20,118 +20,151 @@ package org.apache.maven.surefire.junitc
 
 
 import org.junit.Test;
-import static org.junit.Assert.*;
 
 import java.util.Properties;
 
+import static org.junit.Assert.*;
+
 /*
  * @author Kristian Rosenvold, kristian.rosenvold@gmail com
  */
 
-public class JUnitCoreParametersTest {
+public class JUnitCoreParametersTest
+{
     @Test
-    public void testIsParallelMethod() throws Exception {
-        assertFalse( getTestSetClasses().isParallelMethod());
-        assertTrue( getTestSetMethods().isParallelMethod());
-        assertFalse( getTestSetBoth().isParallelMethod());
+    public void testIsParallelMethod()
+        throws Exception
+    {
+        assertFalse( getTestSetClasses().isParallelMethod() );
+        assertTrue( getTestSetMethods().isParallelMethod() );
+        assertFalse( getTestSetBoth().isParallelMethod() );
     }
 
     @Test
-    public void testIsParallelClasses() throws Exception {
-        assertTrue( getTestSetClasses().isParallelClasses());
-        assertFalse( getTestSetMethods().isParallelClasses());
-        assertFalse( getTestSetBoth().isParallelClasses());
+    public void testIsParallelClasses()
+        throws Exception
+    {
+        assertTrue( getTestSetClasses().isParallelClasses() );
+        assertFalse( getTestSetMethods().isParallelClasses() );
+        assertFalse( getTestSetBoth().isParallelClasses() );
     }
 
     @Test
-    public void testIsParallelBoth() throws Exception {
-        assertFalse( getTestSetClasses().isParallelBoth());
-        assertFalse( getTestSetMethods().isParallelBoth());
-        assertTrue( getTestSetBoth().isParallelBoth());
+    public void testIsParallelBoth()
+        throws Exception
+    {
+        assertFalse( getTestSetClasses().isParallelBoth() );
+        assertFalse( getTestSetMethods().isParallelBoth() );
+        assertTrue( getTestSetBoth().isParallelBoth() );
     }
 
     @Test
-    public void testIsPerCoreThreadCount() throws Exception {
-        assertFalse( getTestSetClasses().isPerCoreThreadCount());
-        assertFalse( getTestSetMethods().isPerCoreThreadCount());
-        assertTrue( getTestSetBoth().isPerCoreThreadCount());
+    public void testIsPerCoreThreadCount()
+        throws Exception
+    {
+        assertFalse( getTestSetClasses().isPerCoreThreadCount() );
+        assertFalse( getTestSetMethods().isPerCoreThreadCount() );
+        assertTrue( getTestSetBoth().isPerCoreThreadCount() );
     }
 
     @Test
-    public void testGetThreadCount() throws Exception {
-        assertFalse( getTestSetClasses().isPerCoreThreadCount());
-        assertFalse( getTestSetMethods().isPerCoreThreadCount());
-        assertTrue( getTestSetBoth().isPerCoreThreadCount());
+    public void testGetThreadCount()
+        throws Exception
+    {
+        assertFalse( getTestSetClasses().isPerCoreThreadCount() );
+        assertFalse( getTestSetMethods().isPerCoreThreadCount() );
+        assertTrue( getTestSetBoth().isPerCoreThreadCount() );
     }
 
     @Test
-    public void testIsUseUnlimitedThreads() throws Exception {
-        assertFalse( getTestSetClasses().isUseUnlimitedThreads());
-        assertTrue( getTestSetMethods().isUseUnlimitedThreads());
-        assertFalse( getTestSetBoth().isUseUnlimitedThreads());
+    public void testIsUseUnlimitedThreads()
+        throws Exception
+    {
+        assertFalse( getTestSetClasses().isUseUnlimitedThreads() );
+        assertTrue( getTestSetMethods().isUseUnlimitedThreads() );
+        assertFalse( getTestSetBoth().isUseUnlimitedThreads() );
     }
 
     @Test
-    public void testIsNoThreading() throws Exception {
-        assertFalse( getTestSetClasses().isNoThreading());
-        assertFalse( getTestSetMethods().isNoThreading());
-        assertFalse( getTestSetBoth().isNoThreading());
+    public void testIsNoThreading()
+        throws Exception
+    {
+        assertFalse( getTestSetClasses().isNoThreading() );
+        assertFalse( getTestSetMethods().isNoThreading() );
+        assertFalse( getTestSetBoth().isNoThreading() );
     }
 
     @Test
-    public void testIsAnyParallelitySelected() throws Exception {
-        assertTrue( getTestSetClasses().isAnyParallelitySelected());
-        assertTrue( getTestSetMethods().isAnyParallelitySelected());
-        assertTrue( getTestSetBoth().isAnyParallelitySelected());
+    public void testIsAnyParallelitySelected()
+        throws Exception
+    {
+        assertTrue( getTestSetClasses().isAnyParallelitySelected() );
+        assertTrue( getTestSetMethods().isAnyParallelitySelected() );
+        assertTrue( getTestSetBoth().isAnyParallelitySelected() );
     }
 
     @Test
-    public void testIsConfigurableParallelComputerPresent() throws Exception {
-        assertFalse( getTestSetClasses().isConfigurableParallelComputerPresent());
-        assertFalse( getTestSetMethods().isConfigurableParallelComputerPresent());
-        assertTrue( getTestSetBoth().isConfigurableParallelComputerPresent());
+    public void testIsConfigurableParallelComputerPresent()
+        throws Exception
+    {
+        assertFalse( getTestSetClasses().isConfigurableParallelComputerPresent() );
+        assertFalse( getTestSetMethods().isConfigurableParallelComputerPresent() );
+        assertTrue( getTestSetBoth().isConfigurableParallelComputerPresent() );
     }
 
     @Test
-    public void testToString() throws Exception {
-        assertNotNull(getTestSetBoth().toString());
+    public void testToString()
+        throws Exception
+    {
+        assertNotNull( getTestSetBoth().toString() );
     }
 
 
-    public Properties getPropsetClasses(){
+    public Properties getPropsetClasses()
+    {
         Properties props = new Properties();
-        props.setProperty(JUnitCoreParameters.PARALLEL_KEY,  "classes");
-        props.setProperty(JUnitCoreParameters.PERCORETHREADCOUNT_KEY,  "false");
-        props.setProperty(JUnitCoreParameters.THREADCOUNT_KEY,  "2");
-        props.setProperty(JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY,  "false");
-        props.setProperty(JUnitCoreParameters.CONFIGURABLEPARALLELCOMPUTERPRESENT_KEY,  "false");
+        props.setProperty( JUnitCoreParameters.PARALLEL_KEY, "classes" );
+        props.setProperty( JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "false" );
+        props.setProperty( JUnitCoreParameters.THREADCOUNT_KEY, "2" );
+        props.setProperty( JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "false" );
+        props.setProperty( JUnitCoreParameters.CONFIGURABLEPARALLELCOMPUTERPRESENT_KEY, "false"
);
         return props;
     }
-    public Properties getPropsetMethods(){
+
+    public Properties getPropsetMethods()
+    {
         Properties props = new Properties();
-        props.setProperty(JUnitCoreParameters.PARALLEL_KEY,  "methods");
-        props.setProperty(JUnitCoreParameters.PERCORETHREADCOUNT_KEY,  "false");
-        props.setProperty(JUnitCoreParameters.THREADCOUNT_KEY,  "2");
-        props.setProperty(JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY,  "true");
-        props.setProperty(JUnitCoreParameters.CONFIGURABLEPARALLELCOMPUTERPRESENT_KEY,  "false");
+        props.setProperty( JUnitCoreParameters.PARALLEL_KEY, "methods" );
+        props.setProperty( JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "false" );
+        props.setProperty( JUnitCoreParameters.THREADCOUNT_KEY, "2" );
+        props.setProperty( JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "true" );
+        props.setProperty( JUnitCoreParameters.CONFIGURABLEPARALLELCOMPUTERPRESENT_KEY, "false"
);
         return props;
     }
-    public Properties getPropsetBoth(){
+
+    public Properties getPropsetBoth()
+    {
         Properties props = new Properties();
-        props.setProperty(JUnitCoreParameters.PARALLEL_KEY,  "both");
-        props.setProperty(JUnitCoreParameters.PERCORETHREADCOUNT_KEY,  "true");
-        props.setProperty(JUnitCoreParameters.THREADCOUNT_KEY,  "7");
-        props.setProperty(JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY,  "false");
-        props.setProperty(JUnitCoreParameters.CONFIGURABLEPARALLELCOMPUTERPRESENT_KEY,  "true");
+        props.setProperty( JUnitCoreParameters.PARALLEL_KEY, "both" );
+        props.setProperty( JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "true" );
+        props.setProperty( JUnitCoreParameters.THREADCOUNT_KEY, "7" );
+        props.setProperty( JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "false" );
+        props.setProperty( JUnitCoreParameters.CONFIGURABLEPARALLELCOMPUTERPRESENT_KEY, "true"
);
         return props;
     }
-    private JUnitCoreParameters getTestSetBoth(){
-      return new JUnitCoreParameters(getPropsetBoth());
+
+    private JUnitCoreParameters getTestSetBoth()
+    {
+        return new JUnitCoreParameters( getPropsetBoth() );
     }
-    private JUnitCoreParameters getTestSetClasses(){
-      return new JUnitCoreParameters(getPropsetClasses());
+
+    private JUnitCoreParameters getTestSetClasses()
+    {
+        return new JUnitCoreParameters( getPropsetClasses() );
     }
-    private JUnitCoreParameters getTestSetMethods(){
-      return new JUnitCoreParameters(getPropsetMethods());
+
+    private JUnitCoreParameters getTestSetMethods()
+    {
+        return new JUnitCoreParameters( getPropsetMethods() );
     }
 }

Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/TestsToRunTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/TestsToRunTest.java?rev=940762&r1=940761&r2=940762&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/TestsToRunTest.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/TestsToRunTest.java
Tue May  4 07:56:38 2010
@@ -21,49 +21,37 @@ package org.apache.maven.surefire.junitc
 
 import org.junit.Test;
 
-/*
- * Copyright 2002-2009 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Also licensed under CPL http://junit.sourceforge.net/cpl-v10.html
- */
-
-
-import static junit.framework.Assert.*;
-
 import java.util.Map;
 
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+
 /*
  * @author Kristian Rosenvold, kristian.rosenvold@gmail com
  */
 
-public class TestsToRunTest {
+public class TestsToRunTest
+{
     @Test
-    public void testGetTestSets() throws Exception {
-        TestsToRun testsToRun = new TestsToRun(T1.class, T2.class);
-        assertEquals( 2,  testsToRun.size());
-        JUnitCoreTestSet coreTestSet = testsToRun.getTestSet("org.apache.maven.surefire.junitcore.TestsToRunTest$T1");
-        assertNotNull( coreTestSet);
-        assertEquals(T1.class, coreTestSet.getTestClass());
-        Map<String,JUnitCoreTestSet> stringJUnitCoreTestSetMap = testsToRun.getTestSets();
-        assertEquals(2, stringJUnitCoreTestSetMap.size());
+    public void testGetTestSets()
+        throws Exception
+    {
+        TestsToRun testsToRun = new TestsToRun( T1.class, T2.class );
+        assertEquals( 2, testsToRun.size() );
+        JUnitCoreTestSet coreTestSet = testsToRun.getTestSet( "org.apache.maven.surefire.junitcore.TestsToRunTest$T1"
);
+        assertNotNull( coreTestSet );
+        assertEquals( T1.class, coreTestSet.getTestClass() );
+        Map<String, JUnitCoreTestSet> stringJUnitCoreTestSetMap = testsToRun.getTestSets();
+        assertEquals( 2, stringJUnitCoreTestSetMap.size() );
     }
 
-    class T1 {
-        
+    class T1
+    {
+
     }
-    class T2 {
+
+    class T2
+    {
 
     }
 }



Mime
View raw message