maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r513763 - in /maven/surefire/trunk: maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/ surefire-api/src/test/java/org/apache/maven/surefire/report/ surefire-booter/src/test/java/org/apache/maven/surefire/bo...
Date Fri, 02 Mar 2007 13:51:09 GMT
Author: brett
Date: Fri Mar  2 05:51:08 2007
New Revision: 513763

URL: http://svn.apache.org/viewvc?view=rev&rev=513763
Log:
make tests run in IDE

Added:
    maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTestCase.java
  (contents, props changed)
      - copied, changed from r511486, maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTest.java
    maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTestCase.java
  (contents, props changed)
      - copied, changed from r511486, maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTest.java
Removed:
    maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTest.java
    maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTest.java
Modified:
    maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
    maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
    maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/ForkingConsoleReporterTest.java
    maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/OutputConsumerProxyTest.java
    maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/PrintWriterOutputConsumerTest.java
    maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/StandardOutputConsumerTest.java

Modified: maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java?view=diff&rev=513763&r1=513762&r2=513763
==============================================================================
--- maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
(original)
+++ maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
Fri Mar  2 05:51:08 2007
@@ -23,6 +23,7 @@
 import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;
+import java.net.URL;
 
 /**
  * @author <a href="mailto:aramirez@apache.org">Allan Ramirez</a>
@@ -30,17 +31,10 @@
 public class SurefireReportMojoTest
     extends AbstractMojoTestCase
 {
-    public void setUp()
-        throws Exception
-    {
-        super.setUp();
-    }
-
     public void testBasicSurefireReport()
         throws Exception
     {
-        File testPom =
-            new File( getBasedir(), "target/test-classes/unit/basic-surefire-report-test/plugin-config.xml"
);
+        File testPom = new File( getUnitBaseDir(), "basic-surefire-report-test/plugin-config.xml"
);
 
         SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom );
 
@@ -87,11 +81,16 @@
         assertTrue( idx >= 0 );
     }
 
+    private File getUnitBaseDir()
+    {
+        URL resource = getClass().getResource( "/unit" );
+        return new File( resource.getPath() ).getAbsoluteFile();
+    }
+
     public void testBasicSurefireReportIfShowSuccessIsFalse()
         throws Exception
     {
-        File testPom =
-            new File( getBasedir(), "target/test-classes/unit/basic-surefire-report-success-false/plugin-config.xml"
);
+        File testPom = new File( getUnitBaseDir(), "basic-surefire-report-success-false/plugin-config.xml"
);
 
         SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom );
 
@@ -118,8 +117,7 @@
     public void testBasicSurefireReportIfLinkXrefIsFalse()
         throws Exception
     {
-        File testPom =
-            new File( getBasedir(), "target/test-classes/unit/basic-surefire-report-linkxref-false/plugin-config.xml"
);
+        File testPom = new File( getUnitBaseDir(), "basic-surefire-report-linkxref-false/plugin-config.xml"
);
 
         SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom );
 
@@ -146,8 +144,7 @@
     public void testBasicSurefireReportIfReportingIsNull()
         throws Exception
     {
-        File testPom =
-            new File( getBasedir(), "target/test-classes/unit/basic-surefire-report-reporting-null/plugin-config.xml"
);
+        File testPom = new File( getUnitBaseDir(), "basic-surefire-report-reporting-null/plugin-config.xml"
);
 
         SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom );
 

Modified: maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java?view=diff&rev=513763&r1=513762&r2=513763
==============================================================================
--- maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
(original)
+++ maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
Fri Mar  2 05:51:08 2007
@@ -23,6 +23,7 @@
 import org.apache.maven.reporting.MavenReportException;
 
 import java.io.File;
+import java.net.URL;
 import java.text.NumberFormat;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -48,7 +49,7 @@
     public void testParseXMLReportFiles()
         throws MavenReportException
     {
-        report.setReportsDirectory( new File( System.getProperty( "basedir" ), "target/test-classes/test-reports"
) );
+        report.setReportsDirectory( getTestDir( "/test-reports" ) );
 
         List suites = report.parseXMLReportFiles();
 
@@ -62,6 +63,12 @@
             assertNotNull( suite.getName() );
             assertNotNull( suite.getPackageName() );
         }
+    }
+
+    private File getTestDir( String path )
+    {
+        URL resource = getClass().getResource( path );
+        return new File( resource.getPath() );
     }
 
     public void testParseTestSuiteName()

Copied: maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTestCase.java
(from r511486, maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTest.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTestCase.java?view=diff&rev=513763&p1=maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTest.java&r1=511486&p2=maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTestCase.java&r2=513763
==============================================================================
--- maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTest.java
(original)
+++ maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTestCase.java
Fri Mar  2 05:51:08 2007
@@ -27,7 +27,7 @@
  * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
  * @version $Id$
  */
-public class AbstractConsoleReporterTest
+public abstract class AbstractConsoleReporterTestCase
     extends TestCase
 {
 

Propchange: maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/AbstractConsoleReporterTestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/ForkingConsoleReporterTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/ForkingConsoleReporterTest.java?view=diff&rev=513763&r1=513762&r2=513763
==============================================================================
--- maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/ForkingConsoleReporterTest.java
(original)
+++ maven/surefire/trunk/surefire-api/src/test/java/org/apache/maven/surefire/report/ForkingConsoleReporterTest.java
Fri Mar  2 05:51:08 2007
@@ -26,7 +26,7 @@
  * @version $Id$
  */
 public class ForkingConsoleReporterTest
-    extends AbstractConsoleReporterTest
+    extends AbstractConsoleReporterTestCase
 {
 
     protected void setUp()

Copied: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTestCase.java
(from r511486, maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTest.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTestCase.java?view=diff&rev=513763&p1=maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTest.java&r1=511486&p2=maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTestCase.java&r2=513763
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTest.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTestCase.java
Fri Mar  2 05:51:08 2007
@@ -28,10 +28,9 @@
  * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
  * @version $Id$
  */
-public class AbstractOutputConsumerTest
+public abstract class AbstractOutputConsumerTestCase
     extends TestCase
 {
-
     private OutputConsumer outputConsumer;
 
     private String line;

Propchange: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/AbstractOutputConsumerTestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/OutputConsumerProxyTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/OutputConsumerProxyTest.java?view=diff&rev=513763&r1=513762&r2=513763
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/OutputConsumerProxyTest.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/OutputConsumerProxyTest.java
Fri Mar  2 05:51:08 2007
@@ -30,7 +30,7 @@
  * @version $Id$
  */
 public class OutputConsumerProxyTest
-    extends AbstractOutputConsumerTest
+    extends AbstractOutputConsumerTestCase
 {
     private Mock outputConsumerMock;
 

Modified: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/PrintWriterOutputConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/PrintWriterOutputConsumerTest.java?view=diff&rev=513763&r1=513762&r2=513763
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/PrintWriterOutputConsumerTest.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/PrintWriterOutputConsumerTest.java
Fri Mar  2 05:51:08 2007
@@ -28,7 +28,7 @@
  * @version $Id$
  */
 public class PrintWriterOutputConsumerTest
-    extends AbstractOutputConsumerTest
+    extends AbstractOutputConsumerTestCase
 {
     private StringWriter writer;
 

Modified: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/StandardOutputConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/StandardOutputConsumerTest.java?view=diff&rev=513763&r1=513762&r2=513763
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/StandardOutputConsumerTest.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/output/StandardOutputConsumerTest.java
Fri Mar  2 05:51:08 2007
@@ -26,7 +26,7 @@
  * @version $Id$
  */
 public class StandardOutputConsumerTest
-    extends AbstractOutputConsumerTest
+    extends AbstractOutputConsumerTestCase
 {
 
     protected void setUp()



Mime
View raw message