maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tibordig...@apache.org
Subject [2/3] maven-surefire git commit: [SUREFIRE-1272]:Create better report for AssumptionFailure
Date Tue, 23 Aug 2016 08:29:49 GMT
[SUREFIRE-1272]:Create better report for AssumptionFailure


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/b70cede6
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/b70cede6
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/b70cede6

Branch: refs/heads/master
Commit: b70cede63279112223dc674dc06145f20dd1419f
Parents: 5605ec1
Author: Jim Ma <ema@apache.org>
Authored: Tue Aug 23 15:43:07 2016 +0800
Committer: Tibor17 <tibor17@lycos.com>
Committed: Tue Aug 23 10:25:02 2016 +0200

----------------------------------------------------------------------
 .../surefire/its/AssumptionFailureReportIT.java | 34 +++++++++++
 .../resources/assumpationFailureReport/pom.xml  | 63 ++++++++++++++++++++
 .../src/test/java/assumpationFailure/Test1.java | 35 +++++++++++
 3 files changed, 132 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/b70cede6/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AssumptionFailureReportIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AssumptionFailureReportIT.java
b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AssumptionFailureReportIT.java
new file mode 100644
index 0000000..856cd8c
--- /dev/null
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AssumptionFailureReportIT.java
@@ -0,0 +1,34 @@
+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.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.TestFile;
+import org.junit.Test;
+
+public class AssumptionFailureReportIT extends SurefireJUnit4IntegrationTestCase
+{
+    @Test
+    public void testWriteSkippedMessageToReport()
+    {
+        final OutputValidator outputValidator = unpack( "/assumpationFailureReport" ).executeTest();
+        TestFile xmlReportFile = outputValidator.getSurefireReportsXmlFile( "TEST-assumptionFailure.Test1.xml"
);
+        xmlReportFile.assertContainsText( "The test is skipped if it is false" );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/b70cede6/surefire-integration-tests/src/test/resources/assumpationFailureReport/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/assumpationFailureReport/pom.xml
b/surefire-integration-tests/src/test/resources/assumpationFailureReport/pom.xml
new file mode 100644
index 0000000..069dacf
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/assumpationFailureReport/pom.xml
@@ -0,0 +1,63 @@
+<?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">
+
+  <parent>
+    <groupId>org.apache.maven.surefire</groupId>
+    <artifactId>it-parent</artifactId>
+    <version>1.0</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins.surefire</groupId>
+  <artifactId>assumpationFailure</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>assumpationFailureReportTest</name>
+  <url>http://maven.apache.org</url>
+
+  <dependencies>
+      <dependency>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+          <version>4.12</version>
+      </dependency>
+  </dependencies>
+  <build>
+     <plugins>
+        <plugin>
+           <groupId>org.apache.maven.plugins</groupId>
+           <artifactId>maven-surefire-plugin</artifactId>
+           <configuration>
+             <redirectTestOutputToFile>true</redirectTestOutputToFile>
+             <includes>
+                <include>**/Test*.java</include>
+             </includes>
+           </configuration>
+        </plugin>
+     </plugins>
+  </build>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/b70cede6/surefire-integration-tests/src/test/resources/assumpationFailureReport/src/test/java/assumpationFailure/Test1.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/assumpationFailureReport/src/test/java/assumpationFailure/Test1.java
b/surefire-integration-tests/src/test/resources/assumpationFailureReport/src/test/java/assumpationFailure/Test1.java
new file mode 100644
index 0000000..3653ce6
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/assumpationFailureReport/src/test/java/assumpationFailure/Test1.java
@@ -0,0 +1,35 @@
+package assumptionFailure;
+
+/*
+ * 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.Test;
+import org.junit.Assume;
+
+import static org.junit.Assert.fail;
+
+public class Test1
+{
+    @Test
+    public void testAssumptionFailureReport()
+    {
+        Assume.assumeTrue( "The test is skipped if it is false" , false );
+        fail( "This is not expected to test" );
+    }
+        
+}


Mime
View raw message