/** Duplicates in runbundles gave a bad error, should be ignored */ public static void testRunbundleDuplicates() throws Exception { Workspace ws = new Workspace(new File("test/ws")); Project top = ws.getProject("p1"); top.clear(); top.setProperty("-runbundles", "org.apache.felix.configadmin,org.apache.felix.configadmin"); Collection<Container> runbundles = top.getRunbundles(); assertTrue(top.check("Multiple bundles with the same final URL")); assertNotNull(runbundles); assertEquals(1, runbundles.size()); }
/** Test 2 equal bsns but diff. versions */ public static void testSameBsnRunBundles() throws Exception { Workspace ws = new Workspace(new File("test/ws")); Project top = ws.getProject("p1"); top.setProperty( "-runbundles", "org.apache.felix.configadmin;version='[1.0.1,1.0.1]',org.apache.felix.configadmin;version='[1.1.0,1.1.0]'"); Collection<Container> runbundles = top.getRunbundles(); assertTrue(top.check()); assertNotNull(runbundles); assertEquals(2, runbundles.size()); }
/** Test bnd.bnd of project `foo`: `-runbundles: foo;version=latest` */ public static void testRunBundlesContainsSelf() throws Exception { Workspace ws = new Workspace(new File("test/ws")); Project top = ws.getProject("p1"); top.setProperty("-runbundles", "p1;version=latest"); top.setChanged(); top.isStale(); Collection<Container> runbundles = top.getRunbundles(); assertTrue(top.check("Circular dependency")); assertNotNull(runbundles); assertEquals(0, runbundles.size()); }