maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1051627 - in /maven/surefire/trunk/surefire-integration-tests/src/test: java/org/apache/maven/surefire/its/ resources/surefire-673-mockito/ resources/surefire-673-mockito/src/ resources/surefire-673-mockito/src/test/ resources/surefire-673...
Date Tue, 21 Dec 2010 19:58:22 GMT
Author: krosenvold
Date: Tue Dec 21 19:58:22 2010
New Revision: 1051627

URL: http://svn.apache.org/viewvc?rev=1051627&view=rev
Log:
[SUREFIRE-673] Mockito problem

Added:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire673MockitoIT.java
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/pom.xml
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/src/test/java/surefire673/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/src/test/java/surefire673/TestMockito.java
  (with props)

Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire673MockitoIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire673MockitoIT.java?rev=1051627&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire673MockitoIT.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire673MockitoIT.java
Tue Dec 21 19:58:22 2010
@@ -0,0 +1,44 @@
+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 org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+
+/**
+ * SUREFIRE-673 Asserts that a given mockito build works as it should (classloader problem
in 2.7)
+ *
+ * @author Kristian Rosenvold
+ */
+public class Surefire673MockitoIT
+    extends AbstractSurefireIntegrationTestClass
+{
+    public void testBuildFailingWhenErrors()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/surefire-673-mockito"
);
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        this.executeGoal( verifier, "test" );
+        verifier.resetStreams();
+        verifier.verifyErrorFreeLog( );
+    }
+}
\ No newline at end of file

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

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/pom.xml?rev=1051627&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/pom.xml
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/pom.xml
Tue Dec 21 19:58:22 2010
@@ -0,0 +1,31 @@
+<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>MockitoTest</artifactId>
+	<name>surefire-673-mockito</name>
+	<version>1.0.0-SNAPSHOT</version>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<version>${surefire.version}</version>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.8.2</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.mockito</groupId>
+			<artifactId>mockito-core</artifactId>
+			<version>1.8.5</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

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

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/src/test/java/surefire673/TestMockito.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/src/test/java/surefire673/TestMockito.java?rev=1051627&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/src/test/java/surefire673/TestMockito.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/src/test/java/surefire673/TestMockito.java
Tue Dec 21 19:58:22 2010
@@ -0,0 +1,17 @@
+package surefire673;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+
+public class TestMockito
+{
+    @Test
+    public void canMockPrivateStaticClass()
+    {
+        Mockito.mock(PrivateClass.class);
+    }
+
+    private static class PrivateClass
+    {
+    }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-673-mockito/src/test/java/surefire673/TestMockito.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message