You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whirr.apache.org by kv...@apache.org on 2012/02/20 13:26:36 UTC

svn commit: r1291229 - in /whirr/trunk: ./ platforms/karaf/itests/ platforms/karaf/itests/src/test/java/org/apache/whirr/karaf/itest/ platforms/karaf/itests/src/test/resources/

Author: kve
Date: Mon Feb 20 12:26:36 2012
New Revision: 1291229

URL: http://svn.apache.org/viewvc?rev=1291229&view=rev
Log:
Avoid hardcoded whirr version number in karaf test.


Added:
    whirr/trunk/platforms/karaf/itests/src/test/resources/
    whirr/trunk/platforms/karaf/itests/src/test/resources/whirr-karaf-itests.properties
Modified:
    whirr/trunk/CHANGES.txt
    whirr/trunk/platforms/karaf/itests/pom.xml
    whirr/trunk/platforms/karaf/itests/src/test/java/org/apache/whirr/karaf/itest/WhirrKarafTestSupport.java

Modified: whirr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/whirr/trunk/CHANGES.txt?rev=1291229&r1=1291228&r2=1291229&view=diff
==============================================================================
--- whirr/trunk/CHANGES.txt (original)
+++ whirr/trunk/CHANGES.txt Mon Feb 20 12:26:36 2012
@@ -9,6 +9,9 @@ Trunk (unreleased changes)
 
   IMPROVEMENTS
 
+    WHIRR-514. Avoid hardcoded Whirr version number in karaf tests (kve)
+    (orig: Update release instructions or fix update-version script?)
+
     WHIRR-421. Handle more role / service lifecycle events as part 
     of the core functionality (asavu)
 

Modified: whirr/trunk/platforms/karaf/itests/pom.xml
URL: http://svn.apache.org/viewvc/whirr/trunk/platforms/karaf/itests/pom.xml?rev=1291229&r1=1291228&r2=1291229&view=diff
==============================================================================
--- whirr/trunk/platforms/karaf/itests/pom.xml (original)
+++ whirr/trunk/platforms/karaf/itests/pom.xml Mon Feb 20 12:26:36 2012
@@ -30,6 +30,12 @@
   <name>Apache Whirr Karaf Integration Tests</name>
 
   <build>
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -121,4 +127,4 @@
           <version>2.3.0.M1</version>
       </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

Modified: whirr/trunk/platforms/karaf/itests/src/test/java/org/apache/whirr/karaf/itest/WhirrKarafTestSupport.java
URL: http://svn.apache.org/viewvc/whirr/trunk/platforms/karaf/itests/src/test/java/org/apache/whirr/karaf/itest/WhirrKarafTestSupport.java?rev=1291229&r1=1291228&r2=1291229&view=diff
==============================================================================
--- whirr/trunk/platforms/karaf/itests/src/test/java/org/apache/whirr/karaf/itest/WhirrKarafTestSupport.java (original)
+++ whirr/trunk/platforms/karaf/itests/src/test/java/org/apache/whirr/karaf/itest/WhirrKarafTestSupport.java Mon Feb 20 12:26:36 2012
@@ -18,6 +18,10 @@
 
 package org.apache.whirr.karaf.itest;
 
+import java.io.IOException;
+
+import java.util.Properties;
+
 import org.apache.felix.service.command.CommandProcessor;
 import org.apache.felix.service.command.CommandSession;
 import org.ops4j.pax.exam.MavenUtils;
@@ -63,7 +67,7 @@ public class WhirrKarafTestSupport {
   static final String GROUP_ID = "org.apache.karaf";
   static final String ARTIFACT_ID = "apache-karaf";
 
-  static final String WHIRR_VERSION = "0.8.0-SNAPSHOT";
+  static final String WHIRR_VERSION = getWhirrVersion();
 
   static final String WHIRR_FEATURE_URL = String.format("mvn:org.apache.whirr.karaf/apache-whirr/%s/xml/features", WHIRR_VERSION);
 
@@ -290,4 +294,14 @@ public class WhirrKarafTestSupport {
     return references != null ? Arrays.asList(references) : Collections.<ServiceReference>emptyList();
   }
 
+  private static String getWhirrVersion() {
+    Properties props = new Properties();
+    try {
+      props.load(WhirrKarafTestSupport.class.getResourceAsStream("/whirr-karaf-itests.properties"));
+      return props.getProperty("version");
+    } catch (IOException e) {
+      throw new RuntimeException("Could not load properties containing whirr version number from classpath:/whirr-karaf-itests.properties");
+    }
+  }
+
 }

Added: whirr/trunk/platforms/karaf/itests/src/test/resources/whirr-karaf-itests.properties
URL: http://svn.apache.org/viewvc/whirr/trunk/platforms/karaf/itests/src/test/resources/whirr-karaf-itests.properties?rev=1291229&view=auto
==============================================================================
--- whirr/trunk/platforms/karaf/itests/src/test/resources/whirr-karaf-itests.properties (added)
+++ whirr/trunk/platforms/karaf/itests/src/test/resources/whirr-karaf-itests.properties Mon Feb 20 12:26:36 2012
@@ -0,0 +1 @@
+version=${project.version}