You are viewing a plain text version of this content. The canonical link for it is here.
Posted to surefire-commits@maven.apache.org by be...@apache.org on 2008/09/23 16:24:54 UTC

svn commit: r698189 - in /maven/surefire/trunk/surefire-integration-tests/src/test: java/org/apache/maven/surefire/its/ resources/includes-excludes/ resources/includes-excludes/src/ resources/includes-excludes/src/test/ resources/includes-excludes/src/...

Author: bentmann
Date: Tue Sep 23 07:24:54 2008
New Revision: 698189

URL: http://svn.apache.org/viewvc?rev=698189&view=rev
Log:
o Migrated core IT 0050 over to its corresponding plugin project

Added:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/IncludesExcludesTest.java   (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml   (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DefaultTest.java   (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DontRunTest.java   (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/NotIncludedByDefault.java   (with props)

Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/IncludesExcludesTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/IncludesExcludesTest.java?rev=698189&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/IncludesExcludesTest.java (added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/IncludesExcludesTest.java Tue Sep 23 07:24:54 2008
@@ -0,0 +1,55 @@
+package org.apache.maven.surefire.its;
+
+/*
+ * 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 java.io.File;
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * Test include/exclude patterns.
+ * 
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class IncludesExcludesTest
+    extends AbstractSurefireIT
+{
+
+    /**
+     * Test surefire inclusions/exclusions
+     */
+    public void testIncludesExcludes()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/includes-excludes" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        executeGoal( verifier, "test" );
+        verifier.assertFilePresent( "target/testTouchFile.txt" );
+        verifier.assertFilePresent( "target/defaultTestTouchFile.txt" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        HelperAssertions.assertTestSuiteResults( 2, 0, 0, 0, testDir );        
+    }
+
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/IncludesExcludesTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/IncludesExcludesTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml?rev=698189&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml (added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml Tue Sep 23 07:24:54 2008
@@ -0,0 +1,58 @@
+<?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>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.surefire</groupId>
+  <artifactId>maven-it-it0050</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Maven Integration Test :: it0050</name> 
+  <description>Test surefire inclusion/exclusions</description>
+
+  <dependencies>
+    <dependency>
+      <artifactId>junit</artifactId>
+      <groupId>junit</groupId>
+      <version>3.8.2</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${surefire.version}</version>
+        <configuration>
+          <excludes>
+            <exclude>DontRunTest.*</exclude>
+          </excludes>
+          <includes>
+            <include>NotIncludedByDefault.java</include>
+            <include>*Test.java</include>
+          </includes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DefaultTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DefaultTest.java?rev=698189&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DefaultTest.java (added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DefaultTest.java Tue Sep 23 07:24:54 2008
@@ -0,0 +1,13 @@
+import java.io.FileOutputStream;
+
+public class DefaultTest
+{
+    public void testRun()
+        throws Exception
+    {
+        FileOutputStream fout = new FileOutputStream("target/defaultTestTouchFile.txt");
+        fout.write('!');
+        fout.flush();
+        fout.close();
+    }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DefaultTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DefaultTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DontRunTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DontRunTest.java?rev=698189&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DontRunTest.java (added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DontRunTest.java Tue Sep 23 07:24:54 2008
@@ -0,0 +1,9 @@
+import junit.framework.TestCase;
+
+public class DontRunTest extends TestCase
+{
+    public void testRun()
+    {
+        assertEquals(true, false);
+    }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DontRunTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/DontRunTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/NotIncludedByDefault.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/NotIncludedByDefault.java?rev=698189&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/NotIncludedByDefault.java (added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/NotIncludedByDefault.java Tue Sep 23 07:24:54 2008
@@ -0,0 +1,13 @@
+import java.io.FileOutputStream;
+
+public class NotIncludedByDefault
+{
+    public void testRun()
+        throws Exception
+    {
+        FileOutputStream fout = new FileOutputStream("target/testTouchFile.txt");
+        fout.write('!');
+        fout.flush();
+        fout.close();
+    }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/NotIncludedByDefault.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/includes-excludes/src/test/java/NotIncludedByDefault.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision