You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2019/04/17 15:51:13 UTC
[maven-antrun-plugin] 01/01: [MANTRUN-208] Added integration test
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 1f43241d702b3bfb11da61db06800a387b990bc2
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Wed Apr 17 17:31:07 2019 +0200
[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..94d549f
--- /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.12</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;