karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgoody...@apache.org
Subject [41/50] git commit: [KARAF-971] Add itest to test the support of version range in features <repository/>
Date Sat, 26 Jul 2014 01:52:23 GMT
[KARAF-971] Add itest to test the support of version range in features <repository/>


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/2bc415ca
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/2bc415ca
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/2bc415ca

Branch: refs/remotes/karaf-2.3.x
Commit: 2bc415ca961d04535d8967e2eab15b2ce841966d
Parents: 6fea9de
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Tue Jul 22 22:26:48 2014 +0200
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Tue Jul 22 22:26:48 2014 +0200

----------------------------------------------------------------------
 .../org/apache/karaf/itests/FeaturesTest.java   | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/2bc415ca/itests/src/test/java/org/apache/karaf/itests/FeaturesTest.java
----------------------------------------------------------------------
diff --git a/itests/src/test/java/org/apache/karaf/itests/FeaturesTest.java b/itests/src/test/java/org/apache/karaf/itests/FeaturesTest.java
index 89756e9..94276ee 100644
--- a/itests/src/test/java/org/apache/karaf/itests/FeaturesTest.java
+++ b/itests/src/test/java/org/apache/karaf/itests/FeaturesTest.java
@@ -24,6 +24,11 @@ import javax.management.ObjectName;
 import javax.management.openmbean.TabularData;
 import javax.management.remote.JMXConnector;
 
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.net.URI;
+
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
@@ -120,4 +125,25 @@ public class FeaturesTest extends KarafTestSupport {
         assertTrue(repoListOutput.contains("apache-karaf-cellar"));
     }
 
+    @Test
+    public void repoAddContainingInnerRepositoryWithVersionRange() throws Exception {
+        File tmp = File.createTempFile("test", ".feature");
+        PrintWriter pw = new PrintWriter(new FileWriter(tmp));
+        pw.write("<features xmlns=\"http://karaf.apache.org/xmlns/features/v1.0.0\">");
+        pw.write("  <repository>mvn:org.apache.karaf.cellar/apache-karaf-cellar/[2.3,3)/xml/features</repository>");
+        pw.write("  <feature name=\"test\" version=\"1.0\">");
+        pw.write("     <feature>cellar</feature>");
+        pw.write("  </feature>");
+        pw.write("</features>");
+        pw.close();
+
+        URI uri = tmp.toURI();
+        System.out.println(executeCommand("features:addurl " + uri));
+        System.out.println(executeCommand("features:install test", 60000L, false));
+        String featuresListOutput = executeCommand("features:list");
+        System.out.println(featuresListOutput);
+        assertTrue(featuresListOutput.contains("test"));
+        assertTrue(featuresListOutput.contains("cellar"));
+    }
+
 }


Mime
View raw message