maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r597574 - in /maven/surefire/trunk/surefire-integration-tests/src/test: java/org/apache/maven/surefire/its/ resources/junit-notExtendingTestCase/ resources/junit-notExtendingTestCase/src/ resources/junit-notExtendingTestCase/src/test/ resou...
Date Fri, 23 Nov 2007 06:39:50 GMT
Author: dfabulich
Date: Thu Nov 22 22:39:46 2007
New Revision: 597574

URL: http://svn.apache.org/viewvc?rev=597574&view=rev
Log:
[SUREFIRE-42] Tests that don't have a getName() (e.g. don't extend TestCase) caused Surefire
to crash; I remember this bug fondly, but it appears to have been fixed.  The test passes
today.

Added:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire42NotExtendingTestCase.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/pom.xml
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/src/test/java/SuiteTest.java

Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire42NotExtendingTestCase.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire42NotExtendingTestCase.java?rev=597574&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire42NotExtendingTestCase.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire42NotExtendingTestCase.java
Thu Nov 22 22:39:46 2007
@@ -0,0 +1,30 @@
+package org.apache.maven.surefire.its;
+
+import java.io.File;
+
+import org.apache.maven.integrationtests.AbstractMavenIntegrationTestCase;
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * Test JUnit test that contains inner classes
+ * 
+ * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
+ * 
+ */
+public class Surefire42NotExtendingTestCase
+    extends AbstractMavenIntegrationTestCase
+{
+    public void testInnerClass ()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/junit-notExtendingTestCase"
);
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.executeGoal( "test" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+        
+        HelperAssertions.assertTestSuiteResults( 1, 0, 0, 0, testDir );        
+    }
+}

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/pom.xml?rev=597574&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/pom.xml
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/pom.xml
Thu Nov 22 22:39:46 2007
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.surefire</groupId>
+  <artifactId>junit-notExtendingTestCase</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>Test for JUnit tests that don't extend TestCase</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+</project>

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/src/test/java/SuiteTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/src/test/java/SuiteTest.java?rev=597574&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/src/test/java/SuiteTest.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit-notExtendingTestCase/src/test/java/SuiteTest.java
Thu Nov 22 22:39:46 2007
@@ -0,0 +1,28 @@
+import junit.framework.Test;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+
+public class SuiteTest
+    extends TestSuite
+{
+    public static Test suite() {
+        SuiteTest suite = new SuiteTest();
+        suite.addTest( new Test() {
+
+            public int countTestCases()
+            {
+                return 1;
+            }
+
+            public void run( TestResult result )
+            {
+                result.startTest( this );
+                result.endTest( this );
+                
+            }
+            
+        } );
+        return suite;
+    }
+}



Mime
View raw message