Author: dfabulich
Date: Fri Nov 23 19:26:32 2007
New Revision: 597788
URL: http://svn.apache.org/viewvc?rev=597788&view=rev
Log:
Test that can generate failures based on a system property. Passed on my
machine with 100000 tests.
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/
(with props)
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/pom.xml
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/src/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/src/test/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/src/test/java/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/src/test/java/largeTestResults/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/src/test/java/largeTestResults/BasicTest.java
Propchange:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 23 19:26:32 2007
@@ -0,0 +1,5 @@
+.classpath
+.project
+target
+.settings
+log.txt
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/pom.xml
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/pom.xml?rev=597788&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/pom.xml
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/pom.xml
Fri Nov 23 19:26:32 2007
@@ -0,0 +1,54 @@
+<?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>large-test-results</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Test for large test results</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+
<property><name>numTests</name><value>${numTests}</value></property>
+ </systemProperties>
+ <argLine>-Xmx1024m</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <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/large-test-results/src/test/java/largeTestResults/BasicTest.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/src/test/java/largeTestResults/BasicTest.java?rev=597788&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/src/test/java/largeTestResults/BasicTest.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/large-test-results/src/test/java/largeTestResults/BasicTest.java
Fri Nov 23 19:26:32 2007
@@ -0,0 +1,42 @@
+package largeTestResults;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class BasicTest
+ extends TestCase
+{
+
+ private int number;
+
+ public BasicTest( String name , int number)
+ {
+ super( name );
+ this.number = number;
+ }
+
+ public static Test suite()
+ {
+ int tests = Integer.parseInt(System.getProperty("numTests", "20"));
+ TestSuite suite = new TestSuite();
+ for (int i = 0; i < tests; i++)
+ {
+ if ( i % 4 == 0)
+ {
+ suite.addTest( new BasicTest( "testPass", i ) );
+ }
+ else
+ {
+ suite.addTest( new BasicTest( "testFail", i ) );
+ }
+ }
+ return suite;
+ }
+
+ public void testFail() {
+ fail( "failure " + number );
+ }
+
+ public void testPass() {}
+
+}