Add a new integration test that makes sure generated buildfiles from pom.xml interpolate properties
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/e1d982ef Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/e1d982ef Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/e1d982ef Branch: refs/heads/master Commit: e1d982ef58a72e7161b519a1b302fb57de2195ae Parents: 2494289 Author: Antoine Toulme <[email protected]> Authored: Sat Aug 13 16:49:38 2016 -0700 Committer: Antoine Toulme <[email protected]> Committed: Sat Aug 13 16:49:38 2016 -0700 ---------------------------------------------------------------------- tests/generateFromPom/.gitignore | 1 + tests/generateFromPom/pom.xml | 376 ++++++++++++++++++++++++++++++++++ tests/integration_testing.rb | 6 + 3 files changed, 383 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/buildr/blob/e1d982ef/tests/generateFromPom/.gitignore ---------------------------------------------------------------------- diff --git a/tests/generateFromPom/.gitignore b/tests/generateFromPom/.gitignore new file mode 100644 index 0000000..902e180 --- /dev/null +++ b/tests/generateFromPom/.gitignore @@ -0,0 +1 @@ +buildfile http://git-wip-us.apache.org/repos/asf/buildr/blob/e1d982ef/tests/generateFromPom/pom.xml ---------------------------------------------------------------------- diff --git a/tests/generateFromPom/pom.xml b/tests/generateFromPom/pom.xml new file mode 100644 index 0000000..d81d17e --- /dev/null +++ b/tests/generateFromPom/pom.xml @@ -0,0 +1,376 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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.springframework.osgi</groupId> + <artifactId>spring-osgi-tp</artifactId> + <packaging>pom</packaging> + <version>1.2.0-m1</version> + <name>Spring Dynamic Modules</name> + <url>http://www.springframework.org/osgi</url> + <description> + The Spring Dynamic Modules Web-enabled Target Platform + </description> + + <properties> + <!-- IMPORTANT: PLease modify to the absolute path of the root directory + of your Target pLatform --> + <taget-platform.root> + C:\oleg\eclipse\workspace\Spring-DM-Target-Platform\target + </taget-platform.root> + <!-- Spring version --> + <spring.maven.artifact.version> + 2.5.5 + </spring.maven.artifact.version> + <spring.osgi.bundle.version>1.2.0-m1</spring.osgi.bundle.version> + <slf4j.version>1.5.0</slf4j.version> + <!-- platform versions --> + <equinox.ver>3.2.2</equinox.ver> + </properties> + <licenses> + <license> + <name>Apache License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0</url> + <comments> + Copyright 2006-2007 the original author or authors. + + Licensed 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. + </comments> + </license> + </licenses> + <dependencies> + <dependency> + <groupId>org.eclipse.osgi</groupId> + <artifactId>org.eclipse.osgi</artifactId> + <version>3.2.2</version> + </dependency> + <!-- Spring OSGi --> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>spring-osgi-core</artifactId> + <version>1.2.0-m1</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>spring-osgi-annotation</artifactId> + <version>1.2.0-m1</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>spring-osgi-extender</artifactId> + <version>1.2.0-m1</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>spring-osgi-io</artifactId> + <version>1.2.0-m1</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>spring-osgi-mock</artifactId> + <version>1.2.0-m1</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>spring-osgi-test</artifactId> + <version>1.2.0-m1</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>spring-osgi-web</artifactId> + <version>1.2.0-m1</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>spring-osgi-web-extender</artifactId> + <version>1.2.0-m1</version> + </dependency> + + <dependency> + <groupId>org.objectweb.asm</groupId> + <artifactId>com.springsource.org.objectweb.asm</artifactId> + <version>2.2.3</version> + </dependency> + <dependency> + <groupId>org.aopalliance</groupId> + <artifactId>com.springsource.org.aopalliance</artifactId> + <version>1.0.0</version> + </dependency> + <dependency> + <groupId>org.junit</groupId> + <artifactId>com.springsource.junit</artifactId> + <version>3.8.2</version> + </dependency> + <!-- Unfortunately, untill http://jira.springframework.org/browse/OSGI-564 + is resolved we can't use BRITS provided Log4J and have to rely on + dependancy specified by Spring-DM 1.2.0-m1. + Once this bug is fixed, we can switch to BRITS on this dependancy --> + <!-- + <dependency> + <groupId>org.apache.log4j</groupId> + <artifactId>com.springsource.org.apache.log4j</artifactId> + <version>1.2.15</version> + </dependency> + --> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>log4j.osgi</artifactId> + <version>1.2.15-SNAPSHOT</version> + </dependency> + + <!-- SLF4J --> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>com.springsource.slf4j.api</artifactId> + <version>${slf4j.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>com.springsource.slf4j.log4j</artifactId> + <version>${slf4j.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>com.springsource.slf4j.jcl</artifactId> + <version>${slf4j.version}</version> + </dependency> + <!-- SPRING-CORE --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.maven.artifact.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.maven.artifact.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context-support</artifactId> + <version>${spring.maven.artifact.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>${spring.maven.artifact.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring.maven.artifact.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-web</artifactId> + <version>${spring.maven.artifact.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-webmvc</artifactId> + <version>${spring.maven.artifact.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>${spring.maven.artifact.version}</version> + </dependency> + + <!-- WEB --> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>jstl.osgi</artifactId> + <version>1.1.2-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>jasper.osgi</artifactId> + <version>5.5.23-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>catalina.osgi</artifactId> + <version>5.5.23-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>catalina.start.osgi</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>servlet-api.osgi</artifactId> + <version>2.5-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>commons-el.osgi</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.springframework.osgi</groupId> + <artifactId>jsp-api.osgi</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + + <!-- JSF --> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId> + com.springsource.org.apache.commons.beanutils + </artifactId> + <version>1.7.0</version> + </dependency> + + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId> + com.springsource.org.apache.commons.collections + </artifactId> + <version>3.2.0</version> + </dependency> + + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId> + com.springsource.org.apache.commons.digester + </artifactId> + <version>1.8.0</version> + </dependency> + <!-- + <dependency> + <groupId>org.apache.myfaces</groupId> + <artifactId> + com.springsource.org.apache.myfaces.javax.faces + </artifactId> + <version>1.2.2</version> + </dependency> + + <dependency> + <groupId>org.apache.myfaces</groupId> + <artifactId>com.springsource.org.apache.myfaces</artifactId> + <version>1.2.2</version> + </dependency> + + <dependency> + <groupId>javax.el</groupId> + <artifactId>com.springsource.javax.el</artifactId> + <version>2.1.0</version> + </dependency> + --> + </dependencies> + <pluginRepositories> + <pluginRepository> + <id>maven-repo</id> + <name>maven repo</name> + <url>http://repo1.maven.org/maven2/</url> + </pluginRepository> + <pluginRepository> + <id>atlassian-m2-repository</id> + <name>Atlassian Maven 2.x Repository</name> + <url>http://repository.atlassian.com/maven2</url> + </pluginRepository> + </pluginRepositories> + + <repositories> + <repository> + <id>eclipse-repository</id> + <name>Eclipse Repository</name> + <url>http://repo1.maven.org/eclipse/</url> + </repository> + + <repository> + <id>com.springsource.repository.bundles.external</id> + <name> + SpringSource Enterprise Bundle Repository - External + Bundle Releases + </name> + <url>http://repository.springsource.com/maven/bundles/external</url> + </repository> +<repository> +<id>com.springsource.repository.bundles.release</id> +<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name> +<url>http://repository.springsource.com/maven/bundles/release</url> +</repository> + <repository> + <id>spring-release</id> + <name>Spring Portfolio Release Repository</name> + <url>http://maven.springframework.org/release</url> + </repository> + <repository> + <id>spring-external</id> + <name>Spring Portfolio Release Repository</name> + <url>http://maven.springframework.org/external</url> + </repository> + <repository> + <id>spring-milestone</id> + <name>Spring Portfolio Milestone Repository</name> + <url>http://maven.springframework.org/milestone</url> + </repository> + + <repository> + <id>spring-ext</id> + <name>Spring External Dependencies Repository</name> + <url>http://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/</url> + </repository> + + <!-- used when building against Spring snapshots --> + <repository> + <id>spring-snapshot</id> + <name>Spring Portfolio Milestone Repository</name> + <url>http://maven.springframework.org/snapshot</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + + <repository> + <id>i21-s3-osgi-repo</id> + <name>i21 osgi artifacts repo</name> + <snapshots> + <enabled>true</enabled> + </snapshots> + <url>http://maven.springframework.org/osgi</url> + </repository> + </repositories> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-dependencies</id> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <outputDirectory> + ${taget-platform.root} + </outputDirectory> + <overWriteReleases>false</overWriteReleases> + <overWriteSnapshots> + false + </overWriteSnapshots> + <overWriteIfNewer>true</overWriteIfNewer> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> http://git-wip-us.apache.org/repos/asf/buildr/blob/e1d982ef/tests/integration_testing.rb ---------------------------------------------------------------------- diff --git a/tests/integration_testing.rb b/tests/integration_testing.rb index d4f92ca..13800c8 100644 --- a/tests/integration_testing.rb +++ b/tests/integration_testing.rb @@ -83,6 +83,12 @@ assert(!zip.get_entry("lib/logging.jar").nil?) %x[cd #{TEST_DIR}/package_war_as_jar ; #{BUILDR} clean] assert($?.success?) CHECK + + test "generateFromPom", "--generate pom.xml", <<-CHECK + assert(File.exist? "#{TEST_DIR}/generateFromPom/buildfile") + assert(File.read("#{TEST_DIR}/generateFromPom/buildfile") !~ /slf4j.version/) + CHECK end + end
