This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MANTRUN-208
in repository https://gitbox.apache.org/repos/asf/maven-antrun-plugin.git

commit 2926e246645d9b4fb065162e835e43c5aa578f07
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Mon Feb 10 14:53:05 2020 +0100

    [MANTRUN-208] Added integration test
---
 src/it/MANTRUN-208/pom.xml    | 71 +++++++++++++++++++++++++++++++++++++++++++
 src/it/MANTRUN-208/verify.bsh | 44 +++++++++++++++++++++++++++
 2 files changed, 115 insertions(+)

diff --git a/src/it/MANTRUN-208/pom.xml b/src/it/MANTRUN-208/pom.xml
new file mode 100644
index 0000000..b8cccf9
--- /dev/null
+++ b/src/it/MANTRUN-208/pom.xml
@@ -0,0 +1,71 @@
+<?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>antrun-plugin.test</groupId>
+    <artifactId>antrun-plugin-test</artifactId>
+    <packaging>jar</packaging>
+    <version>mantrun-208</version>
+    <inceptionYear>2006</inceptionYear>
+    <name>Maven Antrun Plugin Test</name>
+    <url>http://maven.apache.org</url>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.13</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>@pom.version@</version>
+                <executions>
+                    <execution>
+                        <id>compile</id>
+                        <phase>compile</phase>
+                        <configuration>
+                            <target>
+                                <property name="compile_classpath" 
refid="maven.compile.classpath"/>
+                                <property name="runtime_classpath" 
refid="maven.runtime.classpath"/>
+                                <property name="test_classpath" 
refid="maven.test.classpath"/>
+                                <property name="plugin_classpath" 
refid="maven.plugin.classpath"/>
+                                <echo message="compile classpath: 
|${compile_classpath}|"/>
+                                <echo message="runtime classpath: 
|${runtime_classpath}|"/>
+                                <echo message="test classpath: 
|${test_classpath}|"/>
+                                <echo message="plugin classpath: 
|${plugin_classpath}|"/>
+                            </target>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/src/it/MANTRUN-208/verify.bsh b/src/it/MANTRUN-208/verify.bsh
new file mode 100644
index 0000000..91cbbe0
--- /dev/null
+++ b/src/it/MANTRUN-208/verify.bsh
@@ -0,0 +1,44 @@
+
+/*
+ * 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.*;
+import java.util.*;
+import java.util.regex.*;
+
+import org.codehaus.plexus.util.*;
+
+try
+{
+    File buildLog = new File( basedir, "build.log" );
+    String log = FileUtils.fileRead( buildLog );
+
+    if ( log.indexOf( "compile classpath: |" ) < 0 || log.indexOf( "compile 
classpath: ||" ) >= 0 )
+    {
+        System.err.println( "Generated console output does not contain compile 
classpath: " + buildLog );
+        return false;
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;

Reply via email to