You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@provisionr.apache.org by as...@apache.org on 2013/08/29 01:26:17 UTC

git commit: PROVISIONR-48. Fix non-deterministic behavior in assembly / assembly-tests

Updated Branches:
  refs/heads/master 5b82fe46f -> e9c68a81b


PROVISIONR-48. Fix non-deterministic behavior in assembly / assembly-tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-provisionr/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-provisionr/commit/e9c68a81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-provisionr/tree/e9c68a81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-provisionr/diff/e9c68a81

Branch: refs/heads/master
Commit: e9c68a81b5d2b2286adf011563e2357f7e6ab4a8
Parents: 5b82fe4
Author: Andrei Savu <as...@apache.org>
Authored: Thu Aug 29 02:15:58 2013 +0300
Committer: Andrei Savu <as...@apache.org>
Committed: Thu Aug 29 02:15:58 2013 +0300

----------------------------------------------------------------------
 karaf/assembly-tests/pom.xml                    | 16 ++++++++++++++++
 .../karaf/CustomKarafDistributionTest.java      | 16 +++++++++++++---
 .../apache/provisionr/karaf/maven.properties    | 20 ++++++++++++++++++++
 karaf/assembly/pom.xml                          | 20 +++++++++++++++++++-
 4 files changed, 68 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e9c68a81/karaf/assembly-tests/pom.xml
----------------------------------------------------------------------
diff --git a/karaf/assembly-tests/pom.xml b/karaf/assembly-tests/pom.xml
index e9b6a30..8995ae0 100644
--- a/karaf/assembly-tests/pom.xml
+++ b/karaf/assembly-tests/pom.xml
@@ -72,6 +72,12 @@
         </profile>
     </profiles>
     <build>
+        <testResources>
+            <testResource>
+                <directory>src/test/resources</directory>
+                <filtering>true</filtering>
+            </testResource>
+        </testResources>
         <plugins>
             <plugin>
                 <groupId>org.apache.servicemix.tooling</groupId>
@@ -93,6 +99,16 @@
                     <skip>true</skip>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-install-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>default-install</id>
+                        <phase>none</phase>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e9c68a81/karaf/assembly-tests/src/test/java/org/apache/provisionr/karaf/CustomKarafDistributionTest.java
----------------------------------------------------------------------
diff --git a/karaf/assembly-tests/src/test/java/org/apache/provisionr/karaf/CustomKarafDistributionTest.java b/karaf/assembly-tests/src/test/java/org/apache/provisionr/karaf/CustomKarafDistributionTest.java
index c977e95..8a351bc 100644
--- a/karaf/assembly-tests/src/test/java/org/apache/provisionr/karaf/CustomKarafDistributionTest.java
+++ b/karaf/assembly-tests/src/test/java/org/apache/provisionr/karaf/CustomKarafDistributionTest.java
@@ -26,8 +26,11 @@ import java.io.InputStreamReader;
 import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.net.URL;
+import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 import javax.inject.Inject;
+
+import com.google.common.io.Resources;
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
 import static org.apache.karaf.tooling.exam.options.KarafDistributionOption.karafDistributionConfiguration;
@@ -44,6 +47,8 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
 import static org.ops4j.pax.exam.CoreOptions.maven;
+
+import org.ops4j.pax.exam.MavenUtils;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.ExamReactorStrategy;
@@ -93,12 +98,17 @@ public class CustomKarafDistributionTest {
 
     @Configuration
     public Option[] configuration() throws Exception {
-        MavenArtifactUrlReference distributionUrl = maven().groupId("org.apache.provisionr")
-            .artifactId("provisionr-assembly").versionAsInProject().type("tar.gz");
+        String projectVersion = MavenUtils.asInProject().getVersion("org.apache.provisionr", "provisionr-assembly");
+
+        Properties testProperties = new Properties();
+        testProperties.load(Resources.getResource(CustomKarafDistributionTest.class, "maven.properties").openStream());
+
+        File customDistribution = new File(testProperties.getProperty("module.root"),
+                "../assembly/target/provisionr-" + projectVersion + ".tar.gz");
 
         return new Option[]{
             karafDistributionConfiguration()
-                .frameworkUrl(distributionUrl)
+                .frameworkUrl(customDistribution.toURI().toString())
                 .karafVersion(getKarafVersionAsInProject())
                 .name("Apache Provisionr")
                 .unpackDirectory(new File("target/exam")),

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e9c68a81/karaf/assembly-tests/src/test/resources/org/apache/provisionr/karaf/maven.properties
----------------------------------------------------------------------
diff --git a/karaf/assembly-tests/src/test/resources/org/apache/provisionr/karaf/maven.properties b/karaf/assembly-tests/src/test/resources/org/apache/provisionr/karaf/maven.properties
new file mode 100644
index 0000000..d2be260
--- /dev/null
+++ b/karaf/assembly-tests/src/test/resources/org/apache/provisionr/karaf/maven.properties
@@ -0,0 +1,20 @@
+################################################################################
+#
+#    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.
+#
+################################################################################
+
+module.root=${basedir}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e9c68a81/karaf/assembly/pom.xml
----------------------------------------------------------------------
diff --git a/karaf/assembly/pom.xml b/karaf/assembly/pom.xml
index 2ef8e2c..e17d41c 100644
--- a/karaf/assembly/pom.xml
+++ b/karaf/assembly/pom.xml
@@ -17,7 +17,8 @@
   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/xsd/maven-4.0.0.xsd">
+<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/xsd/maven-4.0.0.xsd">
     <parent>
         <artifactId>provisionr-parent</artifactId>
         <groupId>org.apache.provisionr</groupId>
@@ -65,6 +66,23 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-install-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>default-install</id>
+                        <phase>none</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-resources-plugin</artifactId>
                 <configuration>
                     <useDefaultDelimiters>false</useDefaultDelimiters>