]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.osgi.boot/ext/test/org/argeo/osgi/boot/OsgiBootNoRuntimeTest.java
Use unstable RPM factory.
[lgpl/argeo-commons.git] / org.argeo.osgi.boot / ext / test / org / argeo / osgi / boot / OsgiBootNoRuntimeTest.java
1 package org.argeo.osgi.boot;
2
3 import java.util.List;
4
5 import junit.framework.TestCase;
6
7 /** Tests which do not require a runtime. */
8 @SuppressWarnings("rawtypes")
9 public class OsgiBootNoRuntimeTest extends TestCase {
10 public final static String BUNDLES = "src/test/bundles/some;in=*;ex=excluded,"
11 + "src/test/bundles/others;in=**/org.argeo.*";
12
13 /** Tests that location lists are properly parsed. */
14 // public void testLocations() {
15 // String baseUrl = "file:";
16 // String locations = "/mydir/myfile" + File.pathSeparator
17 // + "/myotherdir/myotherfile";
18 //
19 // OsgiBoot osgiBoot = new OsgiBoot(null);
20 // osgiBoot.setExcludeSvn(true);
21 // List urls = osgiBoot.getLocationsUrls(baseUrl, locations);
22 // assertEquals(2, urls.size());
23 // assertEquals("file:/mydir/myfile", urls.get(0));
24 // assertEquals("file:/myotherdir/myotherfile", urls.get(1));
25 // }
26
27 /** Tests that bundle lists are properly parsed. */
28 public void testBundles() {
29 String baseUrl = "file:";
30 String bundles = BUNDLES;
31 OsgiBoot osgiBoot = new OsgiBoot(null);
32 // osgiBoot.setExcludeSvn(true);
33 List urls = osgiBoot.getBundlesUrls(baseUrl, bundles);
34 for (int i = 0; i < urls.size(); i++)
35 System.out.println(urls.get(i));
36 assertEquals(3, urls.size());
37
38 List jarUrls = osgiBoot.getBundlesUrls(baseUrl,
39 "src/test/bundles/jars;in=*.jar");
40 for (int i = 0; i < jarUrls.size(); i++)
41 System.out.println(jarUrls.get(i));
42 assertEquals(1, jarUrls.size());
43 }
44 }