maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r596852 - in /maven/surefire/trunk/surefire-integration-tests/src/test: java/org/apache/maven/surefire/its/ resources/junit44-dep/ resources/junit44-dep/src/ resources/junit44-dep/src/test/ resources/junit44-dep/src/test/java/
Date Tue, 20 Nov 2007 22:26:38 GMT
Author: dfabulich
Date: Tue Nov 20 14:26:37 2007
New Revision: 596852

URL: http://svn.apache.org/viewvc?rev=596852&view=rev
Log:
[SUREFIRE-378] junit4.4-dep isn't detected

Added:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44Dep.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/pom.xml
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/src/test/java/BasicTest.java

Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44Dep.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44Dep.java?rev=596852&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44Dep.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/JUnit44Dep.java
Tue Nov 20 14:26:37 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 project using JUnit4.4 -dep.  junit-dep includes only junit.* classes, and depends
explicitly on hamcrest-core
+ * 
+ * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
+ * 
+ */
+public class JUnit44Dep
+    extends AbstractMavenIntegrationTestCase
+{
+    public void testJUnit44Dep ()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/junit44-dep"
);
+
+        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/junit44-dep/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/pom.xml?rev=596852&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/pom.xml
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/pom.xml
Tue Nov 20 14:26:37 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>junit44-dep</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>Test for default configuration</name>
+  <description>Test for junit-dep; the -dep jar includes only junit.* classes, and
depends explicitly on hamcrest-core</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit-dep</artifactId>
+      <version>4.4</version>
+      <scope>test</scope>
+    </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>
+    </plugins>
+  </build>
+
+</project>

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/src/test/java/BasicTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/src/test/java/BasicTest.java?rev=596852&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/src/test/java/BasicTest.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/junit44-dep/src/test/java/BasicTest.java
Tue Nov 20 14:26:37 2007
@@ -0,0 +1,45 @@
+import org.hamcrest.core.Is;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class BasicTest
+{
+
+    private boolean setUpCalled = false;
+
+    private static boolean tearDownCalled = false;
+
+    @Before
+    public void setUp()
+    {
+        setUpCalled = true;
+        tearDownCalled = false;
+        System.out.println( "Called setUp" );
+    }
+
+    @After
+    public void tearDown()
+    {
+        setUpCalled = false;
+        tearDownCalled = true;
+        System.out.println( "Called tearDown" );
+    }
+
+    @Test
+    public void testSetUp()
+    {
+        Assert.assertTrue( "setUp was not called", setUpCalled );
+        Assert.assertThat( true, Is.is( true ) );
+    }
+
+    @AfterClass
+    public static void oneTimeTearDown()
+    {
+        Assert.assertTrue( "tearDown was not called", tearDownCalled );
+    }
+
+}



Mime
View raw message