Author: krosenvold
Date: Sat Sep 15 13:22:36 2012
New Revision: 1385063
URL: http://svn.apache.org/viewvc?rev=1385063&view=rev
Log:
[SUREFIRE-841] Added sample project to test run counts
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/pom.xml
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeClassError.java
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeClassFailure.java
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeError.java
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeFailure.java
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/NoErrors.java
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/OrdinaryError.java
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/RunTests.java
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/pom.xml
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/pom.xml?rev=1385063&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/pom.xml
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/pom.xml
Sat Sep 15 13:22:36 2012
@@ -0,0 +1,44 @@
+<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>maven-surefire</groupId>
+ <artifactId>small-result-counting</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>failure-result-counting</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire.version}</version>
+ <configuration>
+ <forkMode>${forkMode}</forkMode>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <junit.version>4.10</junit.version>
+ <forkMode>once</forkMode>
+ </properties>
+</project>
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeClassError.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeClassError.java?rev=1385063&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeClassError.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeClassError.java
Sat Sep 15 13:22:36 2012
@@ -0,0 +1,43 @@
+package failureresultcounting;
+/*
+ * 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.
+ */
+
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class BeforeClassError
+{
+
+ @BeforeClass
+ public static void beforeClassError()
+ {
+ throw new RuntimeException( "Exception in beforeclass" );
+ }
+
+ @Test
+ public void ok()
+ {
+ System.out.println( "beforeClassError run !!" );
+ }
+
+}
\ No newline at end of file
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeClassFailure.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeClassFailure.java?rev=1385063&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeClassFailure.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeClassFailure.java
Sat Sep 15 13:22:36 2012
@@ -0,0 +1,43 @@
+package failureresultcounting;
+/*
+ * 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.
+ */
+
+import junit.framework.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class BeforeClassFailure
+{
+
+ @BeforeClass
+ public static void failInBeforeClass()
+ {
+ Assert.fail( "Failing in @BeforeClass" );
+ }
+
+ @Test
+ public void ok()
+ {
+ System.out.println( "failInBeforeClass run !!");
+ }
+
+}
\ No newline at end of file
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeError.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeError.java?rev=1385063&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeError.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeError.java
Sat Sep 15 13:22:36 2012
@@ -0,0 +1,48 @@
+package failureresultcounting;
+/*
+ * 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.
+ */
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class BeforeError
+{
+
+ @Before
+ public void exceptionInBefore()
+ {
+ throw new RuntimeException( "Exception in @before" );
+ }
+
+ @Test
+ public void ok()
+ {
+ System.out.println( "exceptionInBefore run!!");
+ }
+
+ /*@Test
+ public void ok2()
+ {
+ System.out.println( "exceptionInBefore2 run!!");
+ } */
+
+}
\ No newline at end of file
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeFailure.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeFailure.java?rev=1385063&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeFailure.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/BeforeFailure.java
Sat Sep 15 13:22:36 2012
@@ -0,0 +1,43 @@
+package failureresultcounting;
+/*
+ * 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.
+ */
+
+import junit.framework.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class BeforeFailure
+{
+
+ @Before
+ public void failInBEfore()
+ {
+ Assert.fail( "Failing in @before" );
+ }
+
+ @Test
+ public void ok()
+ {
+ System.out.println( "failInBEfore run !!");
+ }
+
+}
\ No newline at end of file
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/NoErrors.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/NoErrors.java?rev=1385063&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/NoErrors.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/NoErrors.java
Sat Sep 15 13:22:36 2012
@@ -0,0 +1,43 @@
+package failureresultcounting;
+/*
+ * 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.
+ */
+
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class NoErrors
+{
+
+ @Test
+ @Ignore
+ public void allOk1()
+ {
+ }
+
+ @Test
+ @Ignore
+ public void allOk2()
+ {
+ }
+
+}
\ No newline at end of file
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/OrdinaryError.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/OrdinaryError.java?rev=1385063&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/OrdinaryError.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/OrdinaryError.java
Sat Sep 15 13:22:36 2012
@@ -0,0 +1,42 @@
+package failureresultcounting;
+/*
+ * 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.
+ */
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class OrdinaryError
+{
+
+ @Test
+ public void ordinaryEror()
+ {
+ throw new RuntimeException( "Exception in @before" );
+ }
+
+ @Test
+ public void ordinaryFailure()
+ {
+ Assert.fail();
+ }
+
+}
\ No newline at end of file
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/RunTests.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/RunTests.java?rev=1385063&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/RunTests.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/failure-result-counting/src/test/java/failureresultcounting/RunTests.java
Sat Sep 15 13:22:36 2012
@@ -0,0 +1,33 @@
+package failureresultcounting;
+
+/*
+ * 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.
+ */
+
+public class RunTests
+{
+ public static void main(String args[]) {
+ org.junit.runner.JUnitCore.main(BeforeClassError.class.getName(),
+ BeforeClassFailure.class.getName(),
+ BeforeError.class.getName(),
+ BeforeFailure.class.getName(),
+ OrdinaryError.class.getName(),
+ NoErrors.class.getName()
+ );
+ }
+}