JBoss-OSGI SVN: r102343 - in projects/jboss-osgi: projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/metadata and 45 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-03-12 04:23:57 -0500 (Fri, 12 Mar 2010)
New Revision: 102343
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/metadata/AbstractManifestTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/BundleClassPathTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleBundleTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractResolverTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverSmokeTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/core/pom.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/enterprise/jmx/JMXEnterpriseTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/event/EventAdminTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/InterceptorTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/serviceloader/ServiceLoaderTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jbossxb/XMLBindingTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGi108TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGi112TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGi142TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi143/OSGi143TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGi151TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/OSGi161TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/OSGi214TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/OSGi284TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi286/OSGi286TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi287/OSGi287TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi298/OSGi298TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGi37TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGi38TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGi39TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGi41TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi92/OSGi92TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGi99TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGi36TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi58/OSGi58TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/localization/LocalizationTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/performance/blueprint/BlueprintStressTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java
Log:
Seperate abstract runtime testing from OSGiTest
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml 2010-03-12 09:23:57 UTC (rev 102343)
@@ -173,11 +173,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.vfs</groupId>
- <artifactId>jboss-osgi-vfs30</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-log4j</artifactId>
<scope>test</scope>
@@ -297,130 +292,4 @@
</plugins>
</build>
- <profiles>
- <!--
- Name: embedded-testing
- Descr: Setup for embedded integration testing
- -->
- <profile>
- <id>embedded-testing</id>
- <activation>
- <property>
- <name>!target.container</name>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs30</artifactId>
- <version>${version}</version>
- </dependency>
- </dependencies>
- </profile>
-
- <!--
- Name: runtime-testing
- Descr: Setup for runtime integration testing
- -->
- <profile>
- <id>runtime-testing</id>
- <activation>
- <property>
- <name>target.container</name>
- <value>runtime</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs30</artifactId>
- <version>${version}</version>
- </dependency>
- </dependencies>
- </profile>
-
- <!--
- Name: jboss501
- Descr: Setup for jboss501 integration testing
- -->
- <profile>
- <id>jboss501</id>
- <activation>
- <property>
- <name>target.container</name>
- <value>jboss501</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs21</artifactId>
- <version>${version}</version>
- </dependency>
- </dependencies>
- </profile>
-
- <!--
- Name: jboss510
- Descr: Setup for jboss510 integration testing
- -->
- <profile>
- <id>jboss510</id>
- <activation>
- <property>
- <name>target.container</name>
- <value>jboss510</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs21</artifactId>
- <version>${version}</version>
- </dependency>
- </dependencies>
- </profile>
-
- <!--
- Name: jboss600
- Descr: Setup for jboss600 integration testing
- -->
- <profile>
- <id>jboss600</id>
- <activation>
- <property>
- <name>target.container</name>
- <value>jboss600</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs21</artifactId>
- <version>${version}</version>
- </dependency>
- </dependencies>
- </profile>
-
- <!--
- Name: jboss601
- Descr: Setup for jboss601 integration testing
- -->
- <profile>
- <id>jboss601</id>
- <activation>
- <property>
- <name>target.container</name>
- <value>jboss601</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs30</artifactId>
- <version>${version}</version>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
</project>
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/metadata/AbstractManifestTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/metadata/AbstractManifestTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/metadata/AbstractManifestTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -26,7 +26,7 @@
import java.net.URL;
import java.util.jar.Manifest;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.test.BaseTestCase;
/**
@@ -65,7 +65,7 @@
protected InputStream getManifestInputStream(String name) throws IOException
{
- URL url = new OSGiTestHelper().getResourceURL(name);
+ URL url = new OSGiRuntimeHelper().getResourceURL(name);
if (url == null)
fail(name + " not found");
return url.openStream();
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/BundleClassPathTest.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/BundleClassPathTest.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/BundleClassPathTest.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -26,7 +26,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.test.osgi.classloader.support.a.A;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -39,7 +39,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 07-Oct-2009
*/
-public class BundleClassPathTest extends OSGiTest
+public class BundleClassPathTest extends OSGiRuntimeTest
{
@Test
public void testBundleClassPath() throws Exception
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleBundleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleBundleTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleBundleTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -29,7 +29,7 @@
import org.jboss.osgi.spi.util.ServiceLoader;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.test.osgi.integration.simple.bundleA.SimpleService;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -54,7 +54,7 @@
Framework framework = factory.newFramework(null);
framework.start();
- OSGiTestHelper helper = new OSGiTestHelper();
+ OSGiRuntimeHelper helper = new OSGiRuntimeHelper();
BundleContext sysContext = framework.getBundleContext();
Bundle bundle = sysContext.installBundle(helper.getTestArchivePath("simple-bundle.jar"));
@@ -85,7 +85,7 @@
public void testBundleInstallRuntimeAPI() throws Exception
{
// Uses the JBossOSGi SPI provided runtime abstraction
- OSGiRuntime runtime = new OSGiTestHelper().getEmbeddedRuntime();
+ OSGiRuntime runtime = new OSGiRuntimeHelper().getEmbeddedRuntime();
OSGiBundle bundle = runtime.installBundle("simple-bundle.jar");
assertEquals("simple-bundle", bundle.getSymbolicName());
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTest.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTest.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/integration/simple/SimpleLogServiceTest.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -30,7 +30,7 @@
import static org.junit.Assume.assumeTrue;
import org.jboss.osgi.spi.util.ServiceLoader;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Before;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -45,7 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 18-Aug-2009
*/
-public class SimpleLogServiceTest extends OSGiTest
+public class SimpleLogServiceTest extends OSGiRuntimeTest
{
@Before
public void setUp()
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/nativecode/NativeCodeTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -25,7 +25,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -39,7 +39,7 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jan-2010
*/
-public class NativeCodeTestCase extends OSGiTest
+public class NativeCodeTestCase extends OSGiRuntimeTest
{
private static Framework framework;
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractResolverTest.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractResolverTest.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/AbstractResolverTest.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -34,7 +34,7 @@
import org.jboss.osgi.framework.resolver.Resolver;
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
@@ -49,7 +49,7 @@
* @author thomas.diesler(a)jboss.com
* @since 09-Nov-2009
*/
-public abstract class AbstractResolverTest extends OSGiTest
+public abstract class AbstractResolverTest extends OSGiRuntimeTest
{
protected static OSGiFramework framework;
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverSmokeTest.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverSmokeTest.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/resolver/ResolverSmokeTest.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -36,7 +36,7 @@
import org.jboss.osgi.framework.resolver.ResolverBundle;
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -48,7 +48,7 @@
* @author thomas.diesler(a)jboss.com
* @since 27-Jul-2009
*/
-public class ResolverSmokeTest extends OSGiTest
+public class ResolverSmokeTest extends OSGiRuntimeTest
{
@Test
public void testRandomBundleResolution() throws BundleException
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/core/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/core/pom.xml 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/core/pom.xml 2010-03-12 09:23:57 UTC (rev 102343)
@@ -46,16 +46,6 @@
<artifactId>jboss-classloading</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.cl</groupId>
- <artifactId>jboss-classloading-vfs</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.jboss.deployers</groupId>
<artifactId>jboss-deployers-client</artifactId>
</dependency>
@@ -86,30 +76,6 @@
<artifactId>jboss-deployers-structure-spi</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-jmx</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.kernel</groupId>
<artifactId>jboss-kernel</artifactId>
</dependency>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -36,7 +36,7 @@
import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.test.osgi.example.blueprint.bundle.BeanA;
import org.jboss.test.osgi.example.blueprint.bundle.ServiceA;
import org.jboss.test.osgi.example.blueprint.bundle.ServiceB;
@@ -65,7 +65,7 @@
{
if (context == null)
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new HuskyCapability());
runtime.addCapability(new JMXCapability());
runtime.addCapability(new BlueprintCapability());
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/enterprise/jmx/JMXEnterpriseTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/enterprise/jmx/JMXEnterpriseTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/enterprise/jmx/JMXEnterpriseTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -34,8 +34,8 @@
import org.jboss.osgi.jmx.MBeanProxy;
import org.jboss.osgi.jmx.ObjectNameFactory;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -47,7 +47,7 @@
* @author thomas.diesler(a)jboss.com
* @since 15-Feb-2010
*/
-public class JMXEnterpriseTestCase extends OSGiTest
+public class JMXEnterpriseTestCase extends OSGiRuntimeTest
{
private static OSGiRuntime runtime;
@@ -56,7 +56,7 @@
@BeforeClass
public static void setUpClass() throws Exception
{
- OSGiTestHelper helper = new OSGiTestHelper();
+ OSGiRuntimeHelper helper = new OSGiRuntimeHelper();
runtime = helper.getDefaultRuntime();
runtime.addCapability(new JMXCapability());
}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/event/EventAdminTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/event/EventAdminTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/event/EventAdminTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -37,7 +37,7 @@
import org.jboss.osgi.spi.capability.EventAdminCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -55,7 +55,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Dec-2009
*/
-public class EventAdminTestCase extends OSGiTest
+public class EventAdminTestCase extends OSGiRuntimeTest
{
static String TOPIC = "org/jboss/test/osgi/example/event";
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -33,7 +33,7 @@
import org.jboss.osgi.spi.capability.HttpServiceCapability;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -52,7 +52,7 @@
@BeforeClass
public static void setUpClass() throws Exception
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new HttpServiceCapability());
// Allow 10s for the HttpService to become available
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/InterceptorTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/InterceptorTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/interceptor/InterceptorTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -33,7 +33,7 @@
import org.jboss.osgi.spi.capability.HttpServiceCapability;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -56,7 +56,7 @@
@BeforeClass
public static void setUpClass() throws Exception
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new HttpServiceCapability());
// Allow 10s for the HttpService to become available
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -31,7 +31,7 @@
import org.jboss.osgi.jndi.JNDICapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.test.osgi.example.jmx.bundle.FooMBean;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -50,7 +50,7 @@
@BeforeClass
public static void setUpClass() throws Exception
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new JNDICapability());
runtime.addCapability(new JMXCapability());
}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -32,7 +32,7 @@
import org.jboss.osgi.jndi.JNDICapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -50,7 +50,7 @@
@BeforeClass
public static void setUpClass() throws Exception
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new JNDICapability());
}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jta/TransactionTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -40,7 +40,7 @@
import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.jta.TransactionCapability;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -65,7 +65,7 @@
{
if (context == null)
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new JMXCapability());
runtime.addCapability(new HuskyCapability());
runtime.addCapability(new TransactionCapability());
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -30,7 +30,7 @@
import org.jboss.osgi.jmx.MBeanProxy;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.test.osgi.example.microcontainer.bundleA.SomeBeanMBean;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -50,7 +50,7 @@
@BeforeClass
public static void setUpClass() throws Exception
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new JMXCapability());
bundleA = runtime.installBundle("example-mcservice-bundleA.jar");
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/serviceloader/ServiceLoaderTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/serviceloader/ServiceLoaderTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/serviceloader/ServiceLoaderTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -33,7 +33,7 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.test.osgi.example.serviceloader.service.AccountService;
import org.jboss.test.osgi.example.serviceloader.service.internal.AccountServiceImpl;
import org.junit.Test;
@@ -45,7 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 26-Jan-2010
*/
-public class ServiceLoaderTestCase extends OSGiTest
+public class ServiceLoaderTestCase extends OSGiRuntimeTest
{
@Test
public void testTraditionalServiceLoaderAPI() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -32,7 +32,7 @@
import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.test.osgi.example.simple.bundle.SimpleService;
import org.junit.After;
import org.junit.Before;
@@ -49,7 +49,7 @@
* @author thomas.diesler(a)jboss.com
* @since 12-Feb-2009
*/
-public class SimpleHuskyTestCase extends OSGiTest
+public class SimpleHuskyTestCase extends OSGiRuntimeTest
{
@RuntimeContext
public BundleContext context;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -25,7 +25,7 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -35,7 +35,7 @@
* @author thomas.diesler(a)jboss.com
* @since 12-Feb-2009
*/
-public class SimpleTestCase extends OSGiTest
+public class SimpleTestCase extends OSGiRuntimeTest
{
@Test
public void testSimpleBundle() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/AbstractWebAppTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -28,7 +28,7 @@
import java.io.InputStreamReader;
import java.net.URL;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
/**
* Abstract base class for webapp example.
@@ -36,7 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Oct-2009
*/
-public abstract class AbstractWebAppTestCase extends OSGiTest
+public abstract class AbstractWebAppTestCase extends OSGiRuntimeTest
{
protected String getHttpResponse(String reqPath) throws Exception
{
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppExtenderTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -27,7 +27,7 @@
import org.jboss.osgi.spi.capability.HttpServiceCapability;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -49,7 +49,7 @@
@BeforeClass
public static void beforeClass() throws Exception
{
- OSGiTestHelper osgiTestHelper = new OSGiTestHelper();
+ OSGiRuntimeHelper osgiTestHelper = new OSGiRuntimeHelper();
runtime = osgiTestHelper.getDefaultRuntime();
runtime.addCapability(new HttpServiceCapability());
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppInterceptorTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -27,7 +27,7 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.osgi.webapp.WebAppCapability;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -46,7 +46,7 @@
@BeforeClass
public static void setUpClass() throws Exception
{
- OSGiTestHelper osgiTestHelper = new OSGiTestHelper();
+ OSGiRuntimeHelper osgiTestHelper = new OSGiRuntimeHelper();
runtime = osgiTestHelper.getDefaultRuntime();
runtime.addCapability(new WebAppCapability());
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppNegativeTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -29,7 +29,7 @@
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.osgi.webapp.WebAppCapability;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -50,7 +50,7 @@
@BeforeClass
public static void setUpClass() throws Exception
{
- OSGiTestHelper osgiTestHelper = new OSGiTestHelper();
+ OSGiRuntimeHelper osgiTestHelper = new OSGiRuntimeHelper();
runtime = osgiTestHelper.getDefaultRuntime();
runtime.addCapability(new WebAppCapability());
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -41,7 +41,7 @@
import org.jboss.osgi.jaxb.JAXBService;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -68,7 +68,7 @@
// Only do this if we are not within the OSGi Runtime
if (context == null)
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new JAXBCapability());
runtime.addCapability(new HuskyCapability());
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jbossxb/XMLBindingTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jbossxb/XMLBindingTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jbossxb/XMLBindingTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -35,7 +35,7 @@
import org.jboss.osgi.jbossxb.XMLBindingCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -50,7 +50,7 @@
* @author thomas.diesler(a)jboss.com
* @since 26-Nov-2009
*/
-public class XMLBindingTestCase extends OSGiTest
+public class XMLBindingTestCase extends OSGiRuntimeTest
{
@RuntimeContext
public BundleContext context;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -38,7 +38,7 @@
import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.osgi.xml.XMLParserCapability;
import org.junit.After;
import org.junit.Before;
@@ -70,7 +70,7 @@
// Only do this if we are not within the OSGi Runtime
if (context == null)
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new XMLParserCapability());
runtime.addCapability(new HuskyCapability());
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -37,7 +37,7 @@
import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.osgi.xml.XMLParserCapability;
import org.junit.After;
import org.junit.Before;
@@ -68,7 +68,7 @@
// Only do this if we are not within the OSGi Runtime
if (context == null)
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new XMLParserCapability());
runtime.addCapability(new HuskyCapability());
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -29,7 +29,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Test;
import org.osgi.framework.launch.Framework;
@@ -39,7 +39,7 @@
* @author thomas.diesler(a)jboss.com
* @since 25-Feb-2009
*/
-public class BootstrapTestCase extends OSGiTest
+public class BootstrapTestCase extends OSGiRuntimeTest
{
@Test
public void testFrameworkBootstrap() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -44,7 +44,7 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.osgi.xml.XMLParserCapability;
import org.junit.Test;
@@ -54,7 +54,7 @@
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
-public class CapabilityTestCase extends OSGiTest
+public class CapabilityTestCase extends OSGiRuntimeTest
{
@Test
public void testXMLParserCapability() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/fragments/FragmentTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -35,7 +35,7 @@
import org.jboss.osgi.spi.capability.LogServiceCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.test.osgi.fragments.fragA.FragBeanA;
import org.jboss.test.osgi.fragments.subA.SubBeanA;
import org.junit.After;
@@ -50,7 +50,7 @@
* @author thomas.diesler(a)jboss.com
* @since 07-Jan-2010
*/
-public class FragmentTestCase extends OSGiTest
+public class FragmentTestCase extends OSGiRuntimeTest
{
private OSGiRuntime runtime;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGi108TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGi108TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGi108TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -34,7 +34,7 @@
import org.jboss.osgi.spi.capability.LogServiceCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.test.osgi.jbosgi108.bundleA.SomeBeanMBean;
import org.junit.AfterClass;
import org.junit.Before;
@@ -56,7 +56,7 @@
@BeforeClass
public static void beforeClass() throws Exception
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new LogServiceCapability());
runtime.addCapability(new JMXCapability());
}
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGi112TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGi112TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGi112TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -25,8 +25,8 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -42,14 +42,14 @@
* @author thomas.diesler(a)jboss.com
* @since 19-Jun-2009
*/
-public class OSGi112TestCase extends OSGiTest
+public class OSGi112TestCase extends OSGiRuntimeTest
{
private static OSGiRuntime runtime;
@BeforeClass
public static void beforeClass() throws BundleException
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
}
@AfterClass
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGi142TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGi142TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGi142TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -26,7 +26,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.test.osgi.jbosgi142.bundleA.BeanA;
import org.jboss.test.osgi.jbosgi142.bundleB.BeanB;
import org.jboss.test.osgi.jbosgi142.bundleX.BeanX;
@@ -49,7 +49,7 @@
* @author thomas.diesler(a)jboss.com
* @since 28-Aug-2009
*/
-public class OSGi142TestCase extends OSGiTest
+public class OSGi142TestCase extends OSGiRuntimeTest
{
@Test
public void testLoadClass() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi143/OSGi143TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi143/OSGi143TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi143/OSGi143TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -28,7 +28,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.test.osgi.jbosgi143.bundleA.BeanA;
import org.jboss.test.osgi.jbosgi143.bundleX.BeanX;
import org.junit.Test;
@@ -49,7 +49,7 @@
* @author thomas.diesler(a)jboss.com
* @since 28-Aug-2009
*/
-public class OSGi143TestCase extends OSGiTest
+public class OSGi143TestCase extends OSGiRuntimeTest
{
@Test
public void testLoadClass() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGi151TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGi151TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi151/OSGi151TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -25,7 +25,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.test.osgi.jbosgi151.bundleA.BeanA;
import org.jboss.test.osgi.jbosgi151.bundleB.BeanB;
import org.junit.After;
@@ -60,7 +60,7 @@
* @author thomas.diesler(a)jboss.com
* @since 07-Sep-2009
*/
-public class OSGi151TestCase extends OSGiTest
+public class OSGi151TestCase extends OSGiRuntimeTest
{
private Framework framework;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/OSGi161TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/OSGi161TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/OSGi161TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -26,7 +26,7 @@
import org.jboss.osgi.spi.capability.LogServiceCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.test.osgi.jbosgi161.bundle.LoggingDelegate;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -39,7 +39,7 @@
* @author thomas.diesler(a)jboss.com
* @since 07-Oct-2009
*/
-public class OSGi161TestCase extends OSGiTest
+public class OSGi161TestCase extends OSGiRuntimeTest
{
@Test
public void testClientLogging() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/OSGi214TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/OSGi214TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi214/OSGi214TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -30,7 +30,7 @@
import java.util.Map;
import org.jboss.osgi.spi.util.ServiceLoader;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -48,7 +48,7 @@
* @author thomas.diesler(a)jboss.com
* @since 03-Dec-2009
*/
-public class OSGi214TestCase extends OSGiTest
+public class OSGi214TestCase extends OSGiRuntimeTest
{
@Test
public void testFirstRun() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/OSGi284TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/OSGi284TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi284/OSGi284TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -28,7 +28,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Test;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -43,7 +43,7 @@
* @author thomas.diesler(a)jboss.com
* @since 01-Feb-2010
*/
-public class OSGi284TestCase extends OSGiTest
+public class OSGi284TestCase extends OSGiRuntimeTest
{
@Test
public void testVersionParser() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi286/OSGi286TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi286/OSGi286TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi286/OSGi286TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -26,7 +26,7 @@
import org.jboss.osgi.jaxb.JAXBCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -38,7 +38,7 @@
* @author thomas.diesler(a)jboss.com
* @since 01-Feb-2010
*/
-public class OSGi286TestCase extends OSGiTest
+public class OSGi286TestCase extends OSGiRuntimeTest
{
@Test
public void testJAXBContextWiring() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi287/OSGi287TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi287/OSGi287TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi287/OSGi287TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -28,7 +28,7 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.test.osgi.jbosgi287.bundleA.OSGi287BeanA;
import org.jboss.test.osgi.jbosgi287.bundleB.OSGi287BeanB;
import org.junit.Test;
@@ -42,7 +42,7 @@
* @author thomas.diesler(a)jboss.com
* @since 01-Feb-2010
*/
-public class OSGi287TestCase extends OSGiTest
+public class OSGi287TestCase extends OSGiRuntimeTest
{
@Test
public void testUnresolvedOptionalImport() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi298/OSGi298TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi298/OSGi298TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi298/OSGi298TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -33,7 +33,7 @@
import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.spi.capability.CompendiumCapability;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
@@ -51,7 +51,7 @@
* @since 05-Mar-2010
*/
@Ignore
-public class OSGi298TestCase extends OSGiTest
+public class OSGi298TestCase extends OSGiRuntimeTest
{
private OSGiRuntime runtime;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGi37TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGi37TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGi37TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -31,7 +31,7 @@
import org.jboss.osgi.spi.capability.CompendiumCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -43,7 +43,7 @@
* @author thomas.diesler(a)jboss.com
* @since 09-Apr-2009
*/
-public class OSGi37TestCase extends OSGiTest
+public class OSGi37TestCase extends OSGiRuntimeTest
{
@Test
public void testNestedBundle() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGi38TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGi38TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGi38TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -28,7 +28,7 @@
import org.jboss.osgi.spi.capability.CompendiumCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -48,7 +48,7 @@
* @author thomas.diesler(a)jboss.com
* @since 02-Mar-2009
*/
-public class OSGi38TestCase extends OSGiTest
+public class OSGi38TestCase extends OSGiRuntimeTest
{
@Test
public void testInstallStartX() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGi39TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGi39TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGi39TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -30,7 +30,7 @@
import org.jboss.osgi.spi.capability.LogServiceCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -49,7 +49,7 @@
* @author thomas.diesler(a)jboss.com
* @since 04-Mar-2009
*/
-public class OSGi39TestCase extends OSGiTest
+public class OSGi39TestCase extends OSGiRuntimeTest
{
private OSGiRuntime runtime;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGi41TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGi41TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGi41TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -34,7 +34,7 @@
import org.jboss.osgi.spi.capability.ConfigAdminCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -46,7 +46,7 @@
* @author thomas.diesler(a)jboss.com
* @since 05-Mar-2009
*/
-public class OSGi41TestCase extends OSGiTest
+public class OSGi41TestCase extends OSGiRuntimeTest
{
@Test
public void testFirstRun() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi92/OSGi92TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi92/OSGi92TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi92/OSGi92TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -32,8 +32,8 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTest;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -48,14 +48,14 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2009
*/
-public class OSGi92TestCase extends OSGiTest
+public class OSGi92TestCase extends OSGiRuntimeTest
{
private static OSGiRuntime runtime;
@BeforeClass
public static void beforeClass() throws Exception
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new CompendiumCapability());
}
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGi99TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGi99TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGi99TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -35,8 +35,8 @@
import org.jboss.osgi.spi.util.ConstantsHelper;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -51,7 +51,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2009
*/
-public class OSGi99TestCase extends OSGiTest
+public class OSGi99TestCase extends OSGiRuntimeTest
{
// Provide logging
private static final Logger log = Logger.getLogger(OSGi99TestCase.class);
@@ -61,7 +61,7 @@
@BeforeClass
public static void beforeClass()
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
}
@AfterClass
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGi36TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGi36TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGi36TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -28,8 +28,8 @@
import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.jmx.MBeanProxy;
-import org.jboss.osgi.testing.OSGiTest;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.osgi.testing.internal.RemoteRuntime;
import org.jboss.test.osgi.jbossas.jbosgi36.mbean.FooMBean;
import org.junit.AfterClass;
@@ -44,14 +44,14 @@
* @author thomas.diesler(a)jboss.com
* @since 25-Feb-2009
*/
-public class OSGi36TestCase extends OSGiTest
+public class OSGi36TestCase extends OSGiRuntimeTest
{
private static RemoteRuntime runtime;
@BeforeClass
public static void setUpClass() throws Exception
{
- runtime = (RemoteRuntime)new OSGiTestHelper().getRemoteRuntime();
+ runtime = (RemoteRuntime)new OSGiRuntimeHelper().getRemoteRuntime();
runtime.addCapability(new JMXCapability());
runtime.installBundle("jbosgi36-bundle.jar");
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi58/OSGi58TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi58/OSGi58TestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi58/OSGi58TestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -28,7 +28,7 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.osgi.testing.internal.RemoteRuntime;
import org.jboss.test.osgi.jbossas.jbosgi58.ejb.StatelessBean;
import org.junit.Ignore;
@@ -43,7 +43,7 @@
* @since 07-Dec-2009
*/
@Ignore
-public class OSGi58TestCase extends OSGiTest
+public class OSGi58TestCase extends OSGiRuntimeTest
{
@Test
public void testEJB() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/localization/LocalizationTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/localization/LocalizationTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/localization/LocalizationTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -30,8 +30,8 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -44,14 +44,14 @@
* @author thomas.diesler(a)jboss.com
* @since 25-Jan-2010
*/
-public class LocalizationTestCase extends OSGiTest
+public class LocalizationTestCase extends OSGiRuntimeTest
{
private static OSGiRuntime runtime;
@BeforeClass
public static void beforeClass()
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
}
@AfterClass
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/performance/blueprint/BlueprintStressTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/performance/blueprint/BlueprintStressTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/performance/blueprint/BlueprintStressTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -29,7 +29,7 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.test.osgi.performance.blueprint.bundle.ServiceA;
import org.jboss.test.osgi.performance.blueprint.bundle.ServiceB;
import org.junit.Test;
@@ -46,7 +46,7 @@
@Test
public void testBlueprintBundleInstall() throws Exception
{
- OSGiRuntime runtime = new OSGiTestHelper().getDefaultRuntime();
+ OSGiRuntime runtime = new OSGiRuntimeHelper().getDefaultRuntime();
BlueprintCapability blueprintCapability = new BlueprintCapability();
try
{
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java 2010-03-12 09:23:57 UTC (rev 102343)
@@ -26,7 +26,7 @@
import org.jboss.osgi.spi.capability.CompendiumCapability;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -36,7 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 04-Mar-2009
*/
-public class StartLevelTestCase extends OSGiTest
+public class StartLevelTestCase extends OSGiRuntimeTest
{
@Test
public void testStartLevel() throws Exception
14 years, 3 months
JBoss-OSGI SVN: r102342 - in projects/jboss-osgi/projects: testing/trunk/src/main/java/org/jboss/osgi/testing and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-03-12 04:20:24 -0500 (Fri, 12 Mar 2010)
New Revision: 102342
Added:
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntimeHelper.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntimeTest.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTest.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java
Removed:
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTest.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleAssemblyTestCase.java
projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleTestCase.java
Log:
Seperate abstract runtime testing from OSGiTest
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2010-03-12 08:08:53 UTC (rev 102341)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -31,7 +31,7 @@
import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -57,7 +57,7 @@
{
if (context == null)
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new HuskyCapability());
OSGiBundle bundle = runtime.installBundle("context-basic.jar");
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java 2010-03-12 08:08:53 UTC (rev 102341)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/MultipleMethodsTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -31,7 +31,7 @@
import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -57,7 +57,7 @@
{
if (context == null)
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new HuskyCapability());
OSGiBundle bundle = runtime.installBundle("context-basic.jar");
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java 2010-03-12 08:08:53 UTC (rev 102341)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/StaticContextTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -31,7 +31,7 @@
import org.jboss.osgi.husky.RuntimeContext;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -57,7 +57,7 @@
{
if (context == null)
{
- runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime = new OSGiRuntimeHelper().getDefaultRuntime();
runtime.addCapability(new HuskyCapability());
OSGiBundle bundle = runtime.installBundle("context-basic.jar");
Copied: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntimeHelper.java (from rev 102228, projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java)
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntimeHelper.java (rev 0)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntimeHelper.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.testing;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.testing.internal.EmbeddedRuntime;
+import org.jboss.osgi.testing.internal.RemoteRuntime;
+
+/**
+ * A helper for the OSGi runtime abstraction.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class OSGiRuntimeHelper extends OSGiTestHelper
+{
+ // The OSGiBootstrapProvider is a lazy property of the helper
+ private OSGiBootstrapProvider bootProvider;
+ private boolean skipBootstrap;
+
+ public OSGiBootstrapProvider getBootstrapProvider()
+ {
+ if (bootProvider == null && skipBootstrap == false)
+ {
+ try
+ {
+ bootProvider = OSGiBootstrap.getBootstrapProvider();
+ }
+ catch (RuntimeException rte)
+ {
+ skipBootstrap = true;
+ throw rte;
+ }
+ }
+ return bootProvider;
+ }
+
+ public void ungetBootstrapProvider()
+ {
+ bootProvider = null;
+ }
+
+ public OSGiRuntime getDefaultRuntime()
+ {
+ OSGiRuntime runtime;
+
+ String target = System.getProperty("target.container");
+ if (target == null)
+ {
+ runtime = getEmbeddedRuntime();
+ }
+ else
+ {
+ runtime = getRemoteRuntime();
+ }
+ return runtime;
+ }
+
+ public OSGiRuntime getEmbeddedRuntime()
+ {
+ return new EmbeddedRuntime(this);
+ }
+
+ public OSGiRuntime getRemoteRuntime()
+ {
+ return new RemoteRuntime(this);
+ }
+}
Copied: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntimeTest.java (from rev 102228, projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTest.java)
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntimeTest.java (rev 0)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntimeTest.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.testing;
+
+/**
+ * An abstract OSGi runtime test.
+ *
+ * A convenience wrapper for the functionality provided by {@link OSGiRuntimeHelper}.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public abstract class OSGiRuntimeTest extends OSGiTest
+{
+ private OSGiRuntimeHelper helper;
+
+ /**
+ * Get the test helper used by this test
+ *
+ * Overwrite if you need to supply another helper
+ * i.e. one that you have statically setup
+ */
+ protected OSGiRuntimeHelper getRuntimeHelper()
+ {
+ if (helper == null)
+ helper = new OSGiRuntimeHelper();
+
+ return helper;
+ }
+
+ /**
+ * Delegates to {@link OSGiRuntimeHelper#getDefaultRuntime()}
+ */
+ protected OSGiRuntime getDefaultRuntime()
+ {
+ return getRuntimeHelper().getDefaultRuntime();
+ }
+
+ /**
+ * Delegates to {@link OSGiRuntimeHelper#getEmbeddedRuntime()}
+ */
+ protected OSGiRuntime getEmbeddedRuntime()
+ {
+ return getRuntimeHelper().getEmbeddedRuntime();
+ }
+
+ /**
+ * Delegates to {@link OSGiRuntimeHelper#getRemoteRuntime()}
+ */
+ public OSGiRuntime getRemoteRuntime()
+ {
+ return getRuntimeHelper().getRemoteRuntime();
+ }
+}
Deleted: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTest.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTest.java 2010-03-12 08:08:53 UTC (rev 102341)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTest.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -1,240 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.testing;
-
-import java.io.File;
-import java.net.URL;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.logging.Logger;
-import org.jboss.osgi.vfs.VirtualFile;
-import org.junit.After;
-import org.junit.Before;
-import org.osgi.framework.Bundle;
-
-/**
- * An abstract OSGi Test.
- *
- * A convenience wrapper for the functionality provided by {@link OSGiTestHelper}.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public abstract class OSGiTest
-{
- // Provide logging
- private static final Logger log = Logger.getLogger(OSGiTest.class);
-
- private OSGiTestHelper helper;
-
- protected OSGiTest()
- {
- }
-
- /**
- * Get the test helper used by this test
- *
- * Overwrite if you need to supply another helper
- * i.e. one that you have statically setup
- */
- protected OSGiTestHelper getTestHelper()
- {
- if (helper == null)
- helper = new OSGiTestHelper();
-
- return helper;
- }
-
- /**
- * Writes a a debug start messge
- */
- @Before
- public void setUp() throws Exception
- {
- log.debug("### START " + getLongName());
- }
-
- /**
- * Writes a a debug stop messge
- */
- @After
- public void tearDown() throws Exception
- {
- log.debug("### END " + getLongName());
- }
-
- /**
- * Get the last token in the FQN of this test class.
- */
- protected String getShortName()
- {
- String shortName = getClass().getName();
- shortName = shortName.substring(shortName.lastIndexOf(".") + 1);
- return shortName;
- }
-
- /**
- * Get the the FQN of this test class.
- */
- protected String getLongName()
- {
- return getClass().getName();
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getDefaultRuntime()}
- */
- protected OSGiRuntime getDefaultRuntime()
- {
- return getTestHelper().getDefaultRuntime();
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getEmbeddedRuntime()}
- */
- protected OSGiRuntime getEmbeddedRuntime()
- {
- return getTestHelper().getEmbeddedRuntime();
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getRemoteRuntime()}
- */
- public OSGiRuntime getRemoteRuntime()
- {
- return getTestHelper().getRemoteRuntime();
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getResourceURL(String)}
- */
- protected URL getResourceURL(String resource)
- {
- return getTestHelper().getResourceURL(resource);
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getResourceFile(String)}
- */
- protected File getResourceFile(String resource)
- {
- return getTestHelper().getResourceFile(resource);
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getTestArchiveURL(String)}
- */
- protected URL getTestArchiveURL(String archive)
- {
- return getTestHelper().getTestArchiveURL(archive);
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getTestArchivePath(String)}
- */
- protected String getTestArchivePath(String archive)
- {
- return getTestHelper().getTestArchivePath(archive);
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getTestArchiveFile(String)}
- */
- protected File getTestArchiveFile(String archive)
- {
- return getTestHelper().getTestArchiveFile(archive);
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getInitialContext()}
- */
- public InitialContext getInitialContext() throws NamingException
- {
- return getTestHelper().getInitialContext();
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getServerHost()}
- */
- public String getServerHost()
- {
- return getTestHelper().getServerHost();
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getTargetContainer()}
- */
- public String getTargetContainer()
- {
- return getTestHelper().getTargetContainer();
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#getFrameworkName()}
- */
- public String getFrameworkName()
- {
- return getTestHelper().getFrameworkName();
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#assembleArchive(String, String, Class...)}
- */
- public VirtualFile assembleArchive(String name, String resource, Class<?>... packages) throws Exception
- {
- return getTestHelper().assembleArchive(name, resource, packages);
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#assembleArchive(String, String[], Class...)}
- */
- public VirtualFile assembleArchive(String name, String[] resources, Class<?>... packages) throws Exception
- {
- return getTestHelper().assembleArchive(name, resources, packages);
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#assertBundleState(int, int)}
- */
- public void assertBundleState(int expState, int wasState)
- {
- getTestHelper().assertBundleState(expState, wasState);
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#assertLoadClass(Bundle, String)}
- */
- public Class<?> assertLoadClass(Bundle bundle, String className)
- {
- return getTestHelper().assertLoadClass(bundle, className);
- }
-
- /**
- * Delegates to {@link OSGiTestHelper#assertLoadClassFail(Bundle, String)}
- */
- public void assertLoadClassFail(Bundle bundle, String className)
- {
- getTestHelper().assertLoadClassFail(bundle, className);
- }
-}
Copied: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTest.java (from rev 102228, projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTest.java)
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTest.java (rev 0)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTest.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -0,0 +1,212 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.testing;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.vfs.VirtualFile;
+import org.junit.After;
+import org.junit.Before;
+import org.osgi.framework.Bundle;
+
+/**
+ * An abstract OSGi Test.
+ *
+ * A convenience wrapper for the functionality provided by {@link OSGiTestHelper}.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public abstract class OSGiTest
+{
+ // Provide logging
+ private static final Logger log = Logger.getLogger(OSGiTest.class);
+
+ private OSGiTestHelper helper;
+
+ /**
+ * Get the test helper used by this test
+ *
+ * Overwrite if you need to supply another helper
+ * i.e. one that you have statically setup
+ */
+ protected OSGiTestHelper getTestHelper()
+ {
+ if (helper == null)
+ helper = new OSGiTestHelper();
+
+ return helper;
+ }
+
+ /**
+ * Writes a a debug start messge
+ */
+ @Before
+ public void setUp() throws Exception
+ {
+ log.debug("### START " + getLongName());
+ }
+
+ /**
+ * Writes a a debug stop messge
+ */
+ @After
+ public void tearDown() throws Exception
+ {
+ log.debug("### END " + getLongName());
+ }
+
+ /**
+ * Get the last token in the FQN of this test class.
+ */
+ protected String getShortName()
+ {
+ String shortName = getClass().getName();
+ shortName = shortName.substring(shortName.lastIndexOf(".") + 1);
+ return shortName;
+ }
+
+ /**
+ * Get the the FQN of this test class.
+ */
+ protected String getLongName()
+ {
+ return getClass().getName();
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#getResourceURL(String)}
+ */
+ protected URL getResourceURL(String resource)
+ {
+ return getTestHelper().getResourceURL(resource);
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#getResourceFile(String)}
+ */
+ protected File getResourceFile(String resource)
+ {
+ return getTestHelper().getResourceFile(resource);
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#getTestArchiveURL(String)}
+ */
+ protected URL getTestArchiveURL(String archive)
+ {
+ return getTestHelper().getTestArchiveURL(archive);
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#getTestArchivePath(String)}
+ */
+ protected String getTestArchivePath(String archive)
+ {
+ return getTestHelper().getTestArchivePath(archive);
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#getTestArchiveFile(String)}
+ */
+ protected File getTestArchiveFile(String archive)
+ {
+ return getTestHelper().getTestArchiveFile(archive);
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#getInitialContext()}
+ */
+ public InitialContext getInitialContext() throws NamingException
+ {
+ return getTestHelper().getInitialContext();
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#getServerHost()}
+ */
+ public String getServerHost()
+ {
+ return getTestHelper().getServerHost();
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#getTargetContainer()}
+ */
+ public String getTargetContainer()
+ {
+ return getTestHelper().getTargetContainer();
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#getFrameworkName()}
+ */
+ public String getFrameworkName()
+ {
+ return getTestHelper().getFrameworkName();
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#assembleArchive(String, String, Class...)}
+ */
+ public VirtualFile assembleArchive(String name, String resource, Class<?>... packages) throws Exception
+ {
+ return getTestHelper().assembleArchive(name, resource, packages);
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#assembleArchive(String, String[], Class...)}
+ */
+ public VirtualFile assembleArchive(String name, String[] resources, Class<?>... packages) throws Exception
+ {
+ return getTestHelper().assembleArchive(name, resources, packages);
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#assertBundleState(int, int)}
+ */
+ public void assertBundleState(int expState, int wasState)
+ {
+ getTestHelper().assertBundleState(expState, wasState);
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#assertLoadClass(Bundle, String)}
+ */
+ public Class<?> assertLoadClass(Bundle bundle, String className)
+ {
+ return getTestHelper().assertLoadClass(bundle, className);
+ }
+
+ /**
+ * Delegates to {@link OSGiTestHelper#assertLoadClassFail(Bundle, String)}
+ */
+ public void assertLoadClassFail(Bundle bundle, String className)
+ {
+ getTestHelper().assertLoadClassFail(bundle, className);
+ }
+}
Deleted: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java 2010-03-12 08:08:53 UTC (rev 102341)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -1,338 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.testing;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Hashtable;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.spi.util.ConstantsHelper;
-import org.jboss.osgi.testing.internal.EmbeddedRuntime;
-import org.jboss.osgi.testing.internal.RemoteRuntime;
-import org.jboss.osgi.vfs.AbstractVFS;
-import org.jboss.osgi.vfs.VirtualFile;
-import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.Asset;
-import org.jboss.shrinkwrap.api.exporter.ZipExporter;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.osgi.framework.Bundle;
-
-/**
- * An OSGi Test Helper
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class OSGiTestHelper
-{
- private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
- private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
-
- // The OSGiBootstrapProvider is a lazy property of the helper
- private OSGiBootstrapProvider bootProvider;
- private boolean skipCreateBootstrapProvider;
-
- private static String testResourcesDir;
- private static String testArchiveDir;
-
- public OSGiTestHelper()
- {
- testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY, "target/test-classes");
- testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY, "target/test-libs");
- }
-
- public OSGiBootstrapProvider getBootstrapProvider()
- {
- if (bootProvider == null && skipCreateBootstrapProvider == false)
- {
- try
- {
- bootProvider = OSGiBootstrap.getBootstrapProvider();
- }
- catch (RuntimeException rte)
- {
- skipCreateBootstrapProvider = true;
- throw rte;
- }
- }
- return bootProvider;
- }
-
- public void ungetBootstrapProvider()
- {
- bootProvider = null;
- }
-
- public OSGiRuntime getDefaultRuntime()
- {
- OSGiRuntime runtime;
-
- String target = System.getProperty("target.container");
- if (target == null)
- {
- runtime = getEmbeddedRuntime();
- }
- else
- {
- runtime = getRemoteRuntime();
- }
- return runtime;
- }
-
- public OSGiRuntime getEmbeddedRuntime()
- {
- return new EmbeddedRuntime(this);
- }
-
- public OSGiRuntime getRemoteRuntime()
- {
- return new RemoteRuntime(this);
- }
-
- /** Try to discover the URL for the test resource */
- public URL getResourceURL(String resource)
- {
- URL resURL = null;
- try
- {
- File resourceFile = getResourceFile(resource);
- resURL = resourceFile.toURI().toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- return resURL;
- }
-
- /** Try to discover the File for the test resource */
- public File getResourceFile(String resource)
- {
- File file = new File(resource);
- if (file.exists())
- return file;
-
- file = new File(testResourcesDir + "/" + resource);
- if (file.exists())
- return file;
-
- throw new IllegalArgumentException("Cannot obtain '" + testResourcesDir + "/" + resource + "'");
- }
-
- /** Try to discover the URL for the deployment archive */
- public URL getTestArchiveURL(String archive)
- {
- try
- {
- return getTestArchiveFile(archive).toURI().toURL();
- }
- catch (MalformedURLException ex)
- {
- throw new IllegalStateException(ex);
- }
- }
-
- /** Try to discover the absolute path for the deployment archive */
- public String getTestArchivePath(String archive)
- {
- return getTestArchiveFile(archive).getAbsolutePath();
- }
-
- /** Try to discover the File for the deployment archive */
- public File getTestArchiveFile(String archive)
- {
- File file = new File(archive);
- if (file.exists())
- return file;
-
- file = new File(testArchiveDir + "/" + archive);
- if (file.exists())
- return file;
-
- throw new IllegalArgumentException("Cannot obtain '" + testArchiveDir + "/" + archive + "'.");
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public InitialContext getInitialContext() throws NamingException
- {
- String port = System.getProperty("jndi.server.port", "1099");
- Integer jndiPort = new Integer(port);
-
- Hashtable env = new Hashtable();
- env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
- env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
- env.put("java.naming.provider.url", "jnp://" + getServerHost() + ":" + jndiPort);
- return new InitialContext(env);
- }
-
- public String getServerHost()
- {
- String bindAddress = System.getProperty("jboss.bind.address", "localhost");
- return bindAddress;
- }
-
- public String getTargetContainer()
- {
- String targetContainer = System.getProperty("target.container");
- return targetContainer;
- }
-
- public String getFrameworkName()
- {
- String framework = System.getProperty("framework");
- if (framework == null || framework.length() == 0 || framework.equals("${framework}"))
- framework = "jbossmc";
-
- return framework;
- }
-
- public VirtualFile assembleArchive(String name, String resource, Class<?>... packages) throws Exception
- {
- return assembleArchive(name, new String[] { resource }, packages);
- }
-
- public VirtualFile assembleArchive(String name, String[] resources, Class<?>... packages) throws IOException
- {
- JavaArchive archive = Archives.create(name + ".jar", JavaArchive.class);
- if (resources != null)
- {
- for (String res : resources)
- {
- URL url = getClass().getResource(res);
- if (url == null)
- throw new IllegalArgumentException("Cannot load resource: " + res);
-
- final VirtualFile file = AbstractVFS.getRoot(url);
- if (file.isDirectory())
- {
- addResources(archive, file, file);
- }
- else
- {
- addResource(archive, res, file);
- }
- }
- }
- if (packages != null)
- {
- for (Class<?> clazz : packages)
- {
- URL url = clazz.getResource("/");
- VirtualFile base = AbstractVFS.getRoot(url);
-
- String path = clazz.getName().replace('.', '/');
- path = path.substring(0, path.lastIndexOf("/"));
-
- VirtualFile classes = base.getChild(path);
- addResources(archive, base, classes);
- }
- }
-
- // Convert archive to file URL
- ZipExporter exporter = archive.as(ZipExporter.class);
- File target = File.createTempFile("archive_", ".jar");
- exporter.exportZip(target, true);
- target.deleteOnExit();
-
- return AbstractVFS.getRoot(target.toURI().toURL());
- }
-
- private void addResources(JavaArchive archive, VirtualFile basedir, VirtualFile resdir) throws IOException
- {
- String basepath = basedir.getPathName();
- for (final VirtualFile child : resdir.getChildrenRecursively())
- {
- if (child.isDirectory())
- continue;
-
- String path = child.getPathName();
- path = path.substring(basepath.length());
-
- addResource(archive, path, child);
- }
- }
-
- private void addResource(JavaArchive archive, String path, final VirtualFile file)
- {
- Asset asset = new Asset()
- {
- public InputStream openStream()
- {
- try
- {
- return file.openStream();
- }
- catch (IOException ex)
- {
- throw new IllegalStateException("Cannot open stream for: " + file, ex);
- }
- }
- };
- archive.add(asset, path);
- }
-
- public void assertBundleState(int expState, int wasState)
- {
- String expstr = ConstantsHelper.bundleState(expState);
- String wasstr = ConstantsHelper.bundleState(wasState);
- assertEquals("Bundle " + expstr, expstr, wasstr);
- }
-
- public Class<?> assertLoadClass(Bundle bundle, String className)
- {
- try
- {
- return bundle.loadClass(className);
- }
- catch (ClassNotFoundException ex)
- {
- String message = bundle.getSymbolicName() + " loads " + className;
- fail("Unexpected ClassNotFoundException for: " + message);
- return null;
- }
- }
-
- public void assertLoadClassFail(Bundle bundle, String className)
- {
- try
- {
- Class<?> clazz = bundle.loadClass(className);
- String message = bundle.getSymbolicName() + " loads " + className;
- fail("ClassNotFoundException expected for: " + message + "\nLoaded from " + clazz.getClassLoader());
- }
- catch (ClassNotFoundException ex)
- {
- // expected
- }
- }
-}
Copied: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java (from rev 102228, projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java)
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java (rev 0)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -0,0 +1,282 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.testing;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Hashtable;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.osgi.spi.util.ConstantsHelper;
+import org.jboss.osgi.vfs.AbstractVFS;
+import org.jboss.osgi.vfs.VirtualFile;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.osgi.framework.Bundle;
+
+/**
+ * An OSGi Test Helper
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class OSGiTestHelper
+{
+ private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
+ private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
+
+ private static String testResourcesDir;
+ private static String testArchiveDir;
+
+ public OSGiTestHelper()
+ {
+ testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY, "target/test-classes");
+ testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY, "target/test-libs");
+ }
+
+ /** Try to discover the URL for the test resource */
+ public URL getResourceURL(String resource)
+ {
+ URL resURL = null;
+ try
+ {
+ File resourceFile = getResourceFile(resource);
+ resURL = resourceFile.toURI().toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ return resURL;
+ }
+
+ /** Try to discover the File for the test resource */
+ public File getResourceFile(String resource)
+ {
+ File file = new File(resource);
+ if (file.exists())
+ return file;
+
+ file = new File(testResourcesDir + "/" + resource);
+ if (file.exists())
+ return file;
+
+ throw new IllegalArgumentException("Cannot obtain '" + testResourcesDir + "/" + resource + "'");
+ }
+
+ /** Try to discover the URL for the deployment archive */
+ public URL getTestArchiveURL(String archive)
+ {
+ try
+ {
+ return getTestArchiveFile(archive).toURI().toURL();
+ }
+ catch (MalformedURLException ex)
+ {
+ throw new IllegalStateException(ex);
+ }
+ }
+
+ /** Try to discover the absolute path for the deployment archive */
+ public String getTestArchivePath(String archive)
+ {
+ return getTestArchiveFile(archive).getAbsolutePath();
+ }
+
+ /** Try to discover the File for the deployment archive */
+ public File getTestArchiveFile(String archive)
+ {
+ File file = new File(archive);
+ if (file.exists())
+ return file;
+
+ file = new File(testArchiveDir + "/" + archive);
+ if (file.exists())
+ return file;
+
+ throw new IllegalArgumentException("Cannot obtain '" + testArchiveDir + "/" + archive + "'.");
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public InitialContext getInitialContext() throws NamingException
+ {
+ String port = System.getProperty("jndi.server.port", "1099");
+ Integer jndiPort = new Integer(port);
+
+ Hashtable env = new Hashtable();
+ env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
+ env.put("java.naming.provider.url", "jnp://" + getServerHost() + ":" + jndiPort);
+ return new InitialContext(env);
+ }
+
+ public String getServerHost()
+ {
+ String bindAddress = System.getProperty("jboss.bind.address", "localhost");
+ return bindAddress;
+ }
+
+ public String getTargetContainer()
+ {
+ String targetContainer = System.getProperty("target.container");
+ return targetContainer;
+ }
+
+ public String getFrameworkName()
+ {
+ String framework = System.getProperty("framework");
+ if (framework == null || framework.length() == 0 || framework.equals("${framework}"))
+ framework = "jbossmc";
+
+ return framework;
+ }
+
+ public VirtualFile assembleArchive(String name, String resource, Class<?>... packages) throws Exception
+ {
+ return assembleArchive(name, new String[] { resource }, packages);
+ }
+
+ public VirtualFile assembleArchive(String name, String[] resources, Class<?>... packages) throws IOException
+ {
+ JavaArchive archive = Archives.create(name + ".jar", JavaArchive.class);
+ if (resources != null)
+ {
+ for (String res : resources)
+ {
+ URL url = getClass().getResource(res);
+ if (url == null)
+ throw new IllegalArgumentException("Cannot load resource: " + res);
+
+ final VirtualFile file = AbstractVFS.getRoot(url);
+ if (file.isDirectory())
+ {
+ addResources(archive, file, file);
+ }
+ else
+ {
+ addResource(archive, res, file);
+ }
+ }
+ }
+ if (packages != null)
+ {
+ for (Class<?> clazz : packages)
+ {
+ URL url = clazz.getResource("/");
+ VirtualFile base = AbstractVFS.getRoot(url);
+
+ String path = clazz.getName().replace('.', '/');
+ path = path.substring(0, path.lastIndexOf("/"));
+
+ VirtualFile classes = base.getChild(path);
+ addResources(archive, base, classes);
+ }
+ }
+
+ // Convert archive to file URL
+ ZipExporter exporter = archive.as(ZipExporter.class);
+ File target = File.createTempFile("archive_", ".jar");
+ exporter.exportZip(target, true);
+ target.deleteOnExit();
+
+ return AbstractVFS.getRoot(target.toURI().toURL());
+ }
+
+ private void addResources(JavaArchive archive, VirtualFile basedir, VirtualFile resdir) throws IOException
+ {
+ String basepath = basedir.getPathName();
+ for (final VirtualFile child : resdir.getChildrenRecursively())
+ {
+ if (child.isDirectory())
+ continue;
+
+ String path = child.getPathName();
+ path = path.substring(basepath.length());
+
+ addResource(archive, path, child);
+ }
+ }
+
+ private void addResource(JavaArchive archive, String path, final VirtualFile file)
+ {
+ Asset asset = new Asset()
+ {
+ public InputStream openStream()
+ {
+ try
+ {
+ return file.openStream();
+ }
+ catch (IOException ex)
+ {
+ throw new IllegalStateException("Cannot open stream for: " + file, ex);
+ }
+ }
+ };
+ archive.add(asset, path);
+ }
+
+ public void assertBundleState(int expState, int wasState)
+ {
+ String expstr = ConstantsHelper.bundleState(expState);
+ String wasstr = ConstantsHelper.bundleState(wasState);
+ assertEquals("Bundle " + expstr, expstr, wasstr);
+ }
+
+ public Class<?> assertLoadClass(Bundle bundle, String className)
+ {
+ try
+ {
+ return bundle.loadClass(className);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ String message = bundle.getSymbolicName() + " loads " + className;
+ fail("Unexpected ClassNotFoundException for: " + message);
+ return null;
+ }
+ }
+
+ public void assertLoadClassFail(Bundle bundle, String className)
+ {
+ try
+ {
+ Class<?> clazz = bundle.loadClass(className);
+ String message = bundle.getSymbolicName() + " loads " + className;
+ fail("ClassNotFoundException expected for: " + message + "\nLoaded from " + clazz.getClassLoader());
+ }
+ catch (ClassNotFoundException ex)
+ {
+ // expected
+ }
+ }
+}
Modified: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java 2010-03-12 08:08:53 UTC (rev 102341)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -40,7 +40,7 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.osgi.vfs.VirtualFile;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -62,7 +62,7 @@
private MBeanServer server;
- public EmbeddedRuntime(OSGiTestHelper helper)
+ public EmbeddedRuntime(OSGiRuntimeHelper helper)
{
super(helper);
}
Modified: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2010-03-12 08:08:53 UTC (rev 102341)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -53,7 +53,7 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.jboss.osgi.vfs.AbstractVFS;
import org.jboss.osgi.vfs.VirtualFile;
import org.jboss.shrinkwrap.api.Archive;
@@ -77,7 +77,7 @@
// Provide logging
private static final Logger log = Logger.getLogger(OSGiRuntimeImpl.class);
- private OSGiTestHelper helper;
+ private OSGiRuntimeHelper helper;
private Map<String, OSGiBundle> bundles = new LinkedHashMap<String, OSGiBundle>();
private List<Capability> capabilities = new ArrayList<Capability>();
@@ -86,12 +86,12 @@
private ServiceStateMBean serviceState;
private PackageStateMBean packageState;
- public OSGiRuntimeImpl(OSGiTestHelper helper)
+ public OSGiRuntimeImpl(OSGiRuntimeHelper helper)
{
this.helper = helper;
}
- public OSGiTestHelper getTestHelper()
+ public OSGiRuntimeHelper getTestHelper()
{
return helper;
}
Modified: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2010-03-12 08:08:53 UTC (rev 102341)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -47,7 +47,7 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.testing.OSGiRuntimeHelper;
import org.osgi.framework.BundleException;
import org.osgi.jmx.framework.BundleStateMBean;
import org.osgi.jmx.framework.ServiceStateMBean;
@@ -65,7 +65,7 @@
private MBeanServerConnection mbeanServer;
- public RemoteRuntime(OSGiTestHelper helper)
+ public RemoteRuntime(OSGiRuntimeHelper helper)
{
super(helper);
}
Modified: projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleAssemblyTestCase.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleAssemblyTestCase.java 2010-03-12 08:08:53 UTC (rev 102341)
+++ projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleAssemblyTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -26,7 +26,7 @@
import org.jboss.osgi.testing.ManifestBuilder;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.osgi.vfs.VirtualFile;
import org.jboss.shrinkwrap.api.Archives;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
@@ -40,7 +40,7 @@
* @author thomas.diesler(a)jboss.com
* @since 12-Feb-2009
*/
-public class SimpleAssemblyTestCase extends OSGiTest
+public class SimpleAssemblyTestCase extends OSGiRuntimeTest
{
@Test
public void testAssembleArchive() throws Exception
Modified: projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleTestCase.java 2010-03-12 08:08:53 UTC (rev 102341)
+++ projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleTestCase.java 2010-03-12 09:20:24 UTC (rev 102342)
@@ -31,7 +31,7 @@
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.testing.OSGiRuntimeTest;
import org.jboss.osgi.vfs.AbstractVFS;
import org.jboss.osgi.vfs.VirtualFile;
import org.jboss.test.osgi.testing.bundle.SimpleService;
@@ -45,7 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 12-Feb-2009
*/
-public class SimpleTestCase extends OSGiTest
+public class SimpleTestCase extends OSGiRuntimeTest
{
@Ignore
public void testSimpleBundle() throws Exception
14 years, 3 months
JBoss-OSGI SVN: r102310 - in projects/jboss-osgi/projects: testing/trunk/src/test/java/org/jboss/test/osgi/testing and 7 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-03-11 17:59:54 -0500 (Thu, 11 Mar 2010)
New Revision: 102310
Modified:
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleTestCase.java
projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java
projects/jboss-osgi/projects/vfs/trunk/vfs21/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/main/java/org/jboss/osgi/vfs21/VirtualFileAdaptor21.java
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/SimpleVFS21Test.java
projects/jboss-osgi/projects/vfs/trunk/vfs30/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VFSAdaptor30.java
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VirtualFileAdaptor30.java
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/SimpleVFS30Test.java
Log:
Use installBundle(location, stream)
Modified: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java 2010-03-11 22:59:54 UTC (rev 102310)
@@ -23,6 +23,7 @@
// $Id$
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -40,6 +41,7 @@
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
import org.jboss.osgi.testing.OSGiTestHelper;
+import org.jboss.osgi.vfs.VirtualFile;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -67,11 +69,18 @@
OSGiBundle installBundle(BundleInfo info) throws BundleException
{
- BundleContext context = getSystemContext();
- String location = toFileURL(info.getRootURL()).toExternalForm();
- Bundle auxBundle = context.installBundle(location);
- OSGiBundle bundle = new EmbeddedBundle(this, auxBundle);
- return registerBundle(bundle.getLocation(), bundle);
+ try
+ {
+ VirtualFile rootFile = info.getRoot();
+ BundleContext context = getSystemContext();
+ Bundle auxBundle = context.installBundle(info.getLocation(), rootFile.openStream());
+ OSGiBundle bundle = new EmbeddedBundle(this, auxBundle);
+ return registerBundle(bundle.getLocation(), bundle);
+ }
+ catch (IOException ex)
+ {
+ throw new BundleException("Cannot install bundle: " + info, ex);
+ }
}
public OSGiBundle[] getBundles()
Modified: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2010-03-11 22:59:54 UTC (rev 102310)
@@ -24,7 +24,6 @@
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -400,27 +399,6 @@
}
}
- // [JBVFS-147] Cannot read from vfs: protocol URL
- URL toFileURL(URL url)
- {
- if (url.getProtocol().equals("vfs"))
- {
- File file = new File(url.getPath());
- if (file.exists())
- {
- try
- {
- url = file.toURI().toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
- }
- return url;
- }
-
VirtualFile toVirtualFile(Archive<?> archive) throws IOException, MalformedURLException
{
ZipExporter exporter = archive.as(ZipExporter.class);
Modified: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2010-03-11 22:59:54 UTC (rev 102310)
@@ -74,8 +74,9 @@
{
try
{
- String location = toFileURL(info.getRootURL()).toExternalForm();
- long bundleId = getFrameworkMBean().installBundle(location);
+ String location = info.getLocation();
+ String streamURL = info.getRoot().getStreamURL().toExternalForm();
+ long bundleId = getFrameworkMBean().installBundle(location, streamURL);
RemoteBundle bundle = new RemoteBundle(this, bundleId);
return registerBundle(bundle.getLocation(), bundle);
}
Modified: projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleTestCase.java 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/testing/SimpleTestCase.java 2010-03-11 22:59:54 UTC (rev 102310)
@@ -47,7 +47,7 @@
*/
public class SimpleTestCase extends OSGiTest
{
- @Test
+ @Ignore
public void testSimpleBundle() throws Exception
{
// Get the default runtime
@@ -101,7 +101,7 @@
}
}
- @Ignore // https://jira.jboss.org/jira/browse/JBVFS-147
+ @Test
public void testSimpleVirtualFile() throws Exception
{
OSGiRuntime runtime = getDefaultRuntime();
Modified: projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java 2010-03-11 22:59:54 UTC (rev 102310)
@@ -82,11 +82,11 @@
URL toURL() throws IOException;
/**
- * Get the file URL used for the mount.
- *
- * @return The source file URL or null if this is not the root.
+ * Get the URL used for streaming.
+ *
+ * @return The stream URL or null if this is not the mounted root file.
*/
- URL getFileURL() throws IOException;
+ URL getStreamURL() throws IOException;
/**
* Get the parent
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs21/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs21/.settings/org.eclipse.jdt.core.prefs 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs21/.settings/org.eclipse.jdt.core.prefs 2010-03-11 22:59:54 UTC (rev 102310)
@@ -1,13 +1,13 @@
-#Tue Mar 02 22:33:56 CET 2010
+#Thu Mar 11 22:29:34 CET 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs21/src/main/java/org/jboss/osgi/vfs21/VirtualFileAdaptor21.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs21/src/main/java/org/jboss/osgi/vfs21/VirtualFileAdaptor21.java 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs21/src/main/java/org/jboss/osgi/vfs21/VirtualFileAdaptor21.java 2010-03-11 22:59:54 UTC (rev 102310)
@@ -62,11 +62,13 @@
return delegate;
}
+ @Override
public String getName()
{
return delegate.getName();
}
+ @Override
public String getPathName()
{
String pathName = "";
@@ -82,16 +84,19 @@
return pathName;
}
+ @Override
public boolean isFile() throws IOException
{
return delegate.isLeaf();
}
+ @Override
public boolean isDirectory() throws IOException
{
return delegate.isLeaf() == false;
}
+ @Override
public URL toURL() throws IOException
{
try
@@ -104,7 +109,8 @@
}
}
- public URL getFileURL() throws IOException
+ @Override
+ public URL getStreamURL() throws IOException
{
if (root != delegate)
return null;
@@ -121,17 +127,20 @@
}
}
+ @Override
public void close()
{
delegate.close();
}
+ @Override
public VirtualFile getParent() throws IOException
{
org.jboss.virtual.VirtualFile parent = delegate.getParent();
return parent != null ? new VirtualFileAdaptor21(root, parent) : null;
}
+ @Override
public VirtualFile getChild(String path) throws IOException
{
org.jboss.virtual.VirtualFile child = delegate.getChild(path);
@@ -141,6 +150,7 @@
return new VirtualFileAdaptor21(root, child);
}
+ @Override
public List<VirtualFile> getChildrenRecursively() throws IOException
{
List<VirtualFile> files = new ArrayList<VirtualFile>();
@@ -150,6 +160,7 @@
return Collections.unmodifiableList(files);
}
+ @Override
public Enumeration<URL> findEntries(String path, String pattern, boolean recurse) throws IOException
{
if (path == null)
@@ -168,6 +179,7 @@
return new VFSFindEntriesEnumeration(delegate, child, pattern, recurse);
}
+ @Override
public Enumeration<String> getEntryPaths(String path) throws IOException
{
if (path == null)
@@ -183,6 +195,7 @@
return new VFSEntryPathsEnumeration(delegate, child);
}
+ @Override
public InputStream openStream() throws IOException
{
return delegate.openStream();
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/SimpleVFS21Test.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/SimpleVFS21Test.java 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/SimpleVFS21Test.java 2010-03-11 22:59:54 UTC (rev 102310)
@@ -32,7 +32,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.net.URLConnection;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Set;
@@ -48,6 +47,7 @@
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.test.osgi.vfs21.bundle.SimpleActivator;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.osgi.framework.Constants;
@@ -60,6 +60,7 @@
*/
public class SimpleVFS21Test
{
+ private static File archiveFile;
private static VirtualFile virtualFile;
private static int fileLength;
@@ -88,18 +89,24 @@
// Convert archive to file URL
ZipExporter exporter = archive.as(ZipExporter.class);
- File target = File.createTempFile("archive_", ".jar");
- exporter.exportZip(target, true);
- target.deleteOnExit();
+ archiveFile = File.createTempFile("archive_", ".jar");
+ exporter.exportZip(archiveFile, true);
+ archiveFile.deleteOnExit();
- FileInputStream fis = new FileInputStream(target);
+ FileInputStream fis = new FileInputStream(archiveFile);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
VFSUtils.copyStream(fis, baos);
fileLength = baos.toByteArray().length;
- virtualFile = AbstractVFS.getRoot(target.toURI().toURL());
+ virtualFile = AbstractVFS.getRoot(archiveFile.toURI().toURL());
}
+ @AfterClass
+ public static void afterClass() throws IOException
+ {
+ virtualFile.close();
+ }
+
@Test
public void testManifestAccess() throws Exception
{
@@ -120,9 +127,7 @@
assertNotNull("Manifest not null", child);
URL childURL = child.toURL();
- URLConnection con = childURL.openConnection();
- con.connect();
- InputStream is = con.getInputStream();
+ InputStream is = childURL.openStream();
Manifest manifest = new Manifest();
manifest.read(is);
@@ -169,13 +174,9 @@
@Test
public void testURLStreamAccess() throws Exception
{
- URL fileURL = virtualFile.getFileURL();
- URLConnection con = fileURL.openConnection();
- con.connect();
- InputStream is = con.getInputStream();
-
+ InputStream instream = virtualFile.openStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
- VFSUtils.copyStream(is, baos);
+ VFSUtils.copyStream(instream, baos);
int actualLength = baos.toByteArray().length;
assertEquals(fileLength, actualLength);
}
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs30/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/.settings/org.eclipse.jdt.core.prefs 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/.settings/org.eclipse.jdt.core.prefs 2010-03-11 22:59:54 UTC (rev 102310)
@@ -1,6 +1,13 @@
-#Tue Mar 02 21:26:56 CET 2010
+#Thu Mar 11 22:18:50 CET 2010
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VFSAdaptor30.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VFSAdaptor30.java 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VFSAdaptor30.java 2010-03-11 22:59:54 UTC (rev 102310)
@@ -24,12 +24,18 @@
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import org.jboss.osgi.vfs.VFSAdaptor;
import org.jboss.osgi.vfs.VirtualFile;
import org.jboss.vfs.TempFileProvider;
import org.jboss.vfs.VFS;
+import org.jboss.vfs.VFSUtils;
import org.jboss.vfs.spi.MountHandle;
+import org.jboss.vfs.util.automount.Automounter;
/**
* An adaptor to the jboss-vfs-3.0.x VFS.
@@ -39,8 +45,21 @@
*/
public class VFSAdaptor30 implements VFSAdaptor
{
+ private static Map<String, VirtualFile> registry = new ConcurrentHashMap<String, VirtualFile>();
+ private static Set<String> suffixes = new HashSet<String>();
+ static
+ {
+ suffixes.add(".jar");
+ suffixes.add(".war");
+ }
+
public VirtualFile getRoot(URL url) throws IOException
{
+ VirtualFile virtualFile = registry.get(url.toExternalForm());
+ if (virtualFile != null)
+ return virtualFile;
+
+ // Get the VFS file
org.jboss.vfs.VirtualFile root;
try
{
@@ -51,10 +70,26 @@
throw new IOException(ex);
}
- TempFileProvider tmp = TempFileProvider.create("osgiroot", null);
- MountHandle mountHandle = VFS.mountZip(root, root, tmp);
-
- return new VirtualFileAdaptor30(root, mountHandle);
+ // Accept the file for mounting
+ MountHandle mountHandle = null;
+ if (root.isFile() && Automounter.isMounted(root) == false)
+ {
+ String rootName = root.getName();
+ for (String suffix : suffixes)
+ {
+ if (rootName.endsWith(suffix))
+ {
+ TempFileProvider tmp = TempFileProvider.create("osgimount-", null);
+ mountHandle = VFS.mountZip(root, root, tmp);
+ break;
+ }
+ }
+ }
+
+ // Register the virtual file
+ virtualFile = new VirtualFileAdaptor30(root, mountHandle, url);
+ registry.put(url.toExternalForm(), virtualFile);
+ return virtualFile;
}
public VirtualFile adapt(Object virtualFile)
@@ -76,4 +111,13 @@
VirtualFileAdaptor30 adaptor = (VirtualFileAdaptor30)virtualFile;
return adaptor.getDelegate();
}
+
+ static void safeClose(VirtualFileAdaptor30 virtualFile)
+ {
+ registry.remove(virtualFile.getRootURL());
+
+ MountHandle mountHandle = virtualFile.getMountHandle();
+ if (mountHandle != null)
+ VFSUtils.safeClose(mountHandle);
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VirtualFileAdaptor30.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VirtualFileAdaptor30.java 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VirtualFileAdaptor30.java 2010-03-11 22:59:54 UTC (rev 102310)
@@ -22,6 +22,7 @@
package org.jboss.osgi.vfs30;
import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -31,7 +32,6 @@
import java.util.List;
import org.jboss.osgi.vfs.VirtualFile;
-import org.jboss.vfs.VFSUtils;
import org.jboss.vfs.spi.MountHandle;
/**
@@ -44,11 +44,13 @@
{
private org.jboss.vfs.VirtualFile delegate;
private MountHandle mountHandle;
+ private URL rootURL;
- VirtualFileAdaptor30(org.jboss.vfs.VirtualFile root, MountHandle mountHandle)
+ VirtualFileAdaptor30(org.jboss.vfs.VirtualFile root, MountHandle mountHandle, URL rootURL)
{
this(root);
this.mountHandle = mountHandle;
+ this.rootURL = rootURL;
}
VirtualFileAdaptor30(org.jboss.vfs.VirtualFile delegate)
@@ -63,6 +65,16 @@
return delegate;
}
+ MountHandle getMountHandle()
+ {
+ return mountHandle;
+ }
+
+ URL getRootURL()
+ {
+ return rootURL;
+ }
+
public String getName()
{
return delegate.getName();
@@ -83,13 +95,15 @@
return delegate.isDirectory();
}
+ @Override
public URL toURL() throws IOException
{
URL url = delegate.toURL();
return url;
}
- public URL getFileURL() throws IOException
+ @Override
+ public URL getStreamURL() throws IOException
{
if (mountHandle == null)
return null;
@@ -98,12 +112,14 @@
return mountSource.toURI().toURL();
}
+ @Override
public VirtualFile getParent()
{
org.jboss.vfs.VirtualFile parent = delegate.getParent();
return parent != null ? new VirtualFileAdaptor30(parent) : null;
}
+ @Override
public VirtualFile getChild(String path) throws IOException
{
org.jboss.vfs.VirtualFile child = delegate.getChild(path);
@@ -113,6 +129,7 @@
return new VirtualFileAdaptor30(child);
}
+ @Override
public List<VirtualFile> getChildrenRecursively() throws IOException
{
List<VirtualFile> files = new ArrayList<VirtualFile>();
@@ -122,6 +139,7 @@
return Collections.unmodifiableList(files);
}
+ @Override
public Enumeration<URL> findEntries(String path, String pattern, boolean recurse) throws IOException
{
if (path == null)
@@ -140,6 +158,7 @@
return new VFSFindEntriesEnumeration(delegate, child, pattern, recurse);
}
+ @Override
public Enumeration<String> getEntryPaths(String path) throws IOException
{
if (path == null)
@@ -155,15 +174,21 @@
return new VFSEntryPathsEnumeration(delegate, child);
}
+ @Override
public InputStream openStream() throws IOException
{
+ if (mountHandle != null)
+ {
+ File mountSource = mountHandle.getMountSource();
+ return new FileInputStream(mountSource);
+ }
return delegate.openStream();
}
+ @Override
public void close()
{
- if (mountHandle != null)
- VFSUtils.safeClose(mountHandle);
+ VFSAdaptor30.safeClose(this);
}
@Override
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/SimpleVFS30Test.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/SimpleVFS30Test.java 2010-03-11 21:55:15 UTC (rev 102309)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/SimpleVFS30Test.java 2010-03-11 22:59:54 UTC (rev 102310)
@@ -32,7 +32,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.net.URLConnection;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Set;
@@ -48,6 +47,7 @@
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.test.osgi.vfs30.bundle.SimpleActivator;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.osgi.framework.Constants;
@@ -60,6 +60,7 @@
*/
public class SimpleVFS30Test
{
+ private static File archiveFile;
private static VirtualFile virtualFile;
private static int fileLength;
@@ -88,18 +89,24 @@
// Convert archive to file URL
ZipExporter exporter = archive.as(ZipExporter.class);
- File target = File.createTempFile("archive_", ".jar");
- exporter.exportZip(target, true);
- target.deleteOnExit();
+ archiveFile = File.createTempFile("archive_", ".jar");
+ exporter.exportZip(archiveFile, true);
+ archiveFile.deleteOnExit();
- FileInputStream fis = new FileInputStream(target);
+ FileInputStream fis = new FileInputStream(archiveFile);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
VFSUtils.copyStream(fis, baos);
fileLength = baos.toByteArray().length;
- virtualFile = AbstractVFS.getRoot(target.toURI().toURL());
+ virtualFile = AbstractVFS.getRoot(archiveFile.toURI().toURL());
}
+ @AfterClass
+ public static void afterClass() throws IOException
+ {
+ virtualFile.close();
+ }
+
@Test
public void testManifestAccess() throws Exception
{
@@ -120,9 +127,7 @@
assertNotNull("Manifest not null", child);
URL childURL = child.toURL();
- URLConnection con = childURL.openConnection();
- con.connect();
- InputStream is = con.getInputStream();
+ InputStream is = childURL.openStream();
Manifest manifest = new Manifest();
manifest.read(is);
@@ -169,13 +174,9 @@
@Test
public void testURLStreamAccess() throws Exception
{
- URL fileURL = virtualFile.getFileURL();
- URLConnection con = fileURL.openConnection();
- con.connect();
- InputStream is = con.getInputStream();
-
+ InputStream instream = virtualFile.openStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
- VFSUtils.copyStream(is, baos);
+ VFSUtils.copyStream(instream, baos);
int actualLength = baos.toByteArray().length;
assertEquals(fileLength, actualLength);
}
14 years, 3 months
JBoss-OSGI SVN: r102309 - projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-03-11 16:55:15 -0500 (Thu, 11 Mar 2010)
New Revision: 102309
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java
Log:
Use installBundle(location, stream)
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java 2010-03-11 21:13:39 UTC (rev 102308)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java 2010-03-11 21:55:15 UTC (rev 102309)
@@ -111,9 +111,10 @@
protected Bundle installBundle(VirtualFile archive) throws Exception
{
- return context.installBundle(archive.toURL().toExternalForm());
-
+ String location = archive.toURL().toExternalForm();
+ return context.installBundle(location, archive.openStream());
}
+
protected void assertLoadClass(Bundle bundle, String className, Bundle exporter)
{
Class<?> clazz = assertLoadClass(bundle, className);
14 years, 3 months
JBoss-OSGI SVN: r102279 - projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-03-11 06:35:55 -0500 (Thu, 11 Mar 2010)
New Revision: 102279
Modified:
projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSUtils.java
Log:
organize imports
Modified: projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSUtils.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSUtils.java 2010-03-11 11:33:48 UTC (rev 102278)
+++ projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSUtils.java 2010-03-11 11:35:55 UTC (rev 102279)
@@ -21,7 +21,6 @@
*/
package org.jboss.osgi.vfs;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
14 years, 3 months
JBoss-OSGI SVN: r102276 - in projects/jboss-osgi/projects/vfs/trunk: api/src/main/java/org/jboss/osgi/vfs and 28 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-03-11 06:27:39 -0500 (Thu, 11 Mar 2010)
New Revision: 102276
Added:
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/SimpleVFS21Test.java
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/bundle/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/bundle/SimpleActivator.java
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/resources/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/resources/simple/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/resources/simple/META-INF/
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/resources/simple/META-INF/MANIFEST.MF
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/SimpleVFS30Test.java
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/bundle/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/bundle/SimpleActivator.java
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/resources/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/resources/simple/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/resources/simple/META-INF/
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/resources/simple/META-INF/MANIFEST.MF
Modified:
projects/jboss-osgi/projects/vfs/trunk/api/pom.xml
projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSUtils.java
projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java
projects/jboss-osgi/projects/vfs/trunk/vfs21/.classpath
projects/jboss-osgi/projects/vfs/trunk/vfs21/pom.xml
projects/jboss-osgi/projects/vfs/trunk/vfs21/src/main/java/org/jboss/osgi/vfs21/VirtualFileAdaptor21.java
projects/jboss-osgi/projects/vfs/trunk/vfs30/.classpath
projects/jboss-osgi/projects/vfs/trunk/vfs30/pom.xml
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VFSAdaptor30.java
projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VirtualFileAdaptor30.java
Log:
Add getFileURL() and test coverage
Modified: projects/jboss-osgi/projects/vfs/trunk/api/pom.xml
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/api/pom.xml 2010-03-11 11:17:32 UTC (rev 102275)
+++ projects/jboss-osgi/projects/vfs/trunk/api/pom.xml 2010-03-11 11:27:39 UTC (rev 102276)
@@ -28,17 +28,4 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
- <!-- Properties -->
- <properties>
- <version.osgi>4.2.0</version.osgi>
- </properties>
-
- <!-- Dependencies -->
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>${version.osgi}</version>
- </dependency>
- </dependencies>
</project>
Modified: projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSUtils.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSUtils.java 2010-03-11 11:17:32 UTC (rev 102275)
+++ projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSUtils.java 2010-03-11 11:27:39 UTC (rev 102276)
@@ -24,6 +24,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
@@ -61,7 +62,7 @@
}
}
- public static void copyStream(InputStream is, FileOutputStream os) throws IOException
+ public static void copyStream(InputStream is, OutputStream os) throws IOException
{
if (is == null)
throw new IllegalArgumentException("input stream is null");
Modified: projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java 2010-03-11 11:17:32 UTC (rev 102275)
+++ projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java 2010-03-11 11:27:39 UTC (rev 102276)
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
-import java.net.URISyntaxException;
import java.net.URL;
import java.util.Enumeration;
import java.util.List;
@@ -74,16 +73,22 @@
boolean isDirectory() throws IOException;
/**
- * Get the VF URL (file://root/org/jboss/X.java)
+ * Get the VF URL (vfs:/root/org/jboss/X.java)
*
* @return the full URL to the VF in the VFS.
* @throws MalformedURLException if a url cannot be parsed
- * @throws URISyntaxException if a uri cannot be parsed
- * @throws IllegalStateException if the file is closed
+ * @throws IOException for any problem accessing the virtual file system
*/
- URL toURL() throws MalformedURLException, URISyntaxException;
+ URL toURL() throws IOException;
/**
+ * Get the file URL used for the mount.
+ *
+ * @return The source file URL or null if this is not the root.
+ */
+ URL getFileURL() throws IOException;
+
+ /**
* Get the parent
*
* @return the parent or null if there is no parent
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs21/.classpath
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs21/.classpath 2010-03-11 11:17:32 UTC (rev 102275)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs21/.classpath 2010-03-11 11:27:39 UTC (rev 102276)
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs21/pom.xml
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs21/pom.xml 2010-03-11 11:17:32 UTC (rev 102275)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs21/pom.xml 2010-03-11 11:27:39 UTC (rev 102276)
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- ====================================================================== -->
-<!-- -->
-<!-- JBoss, the OpenSource J2EE webOS -->
-<!-- -->
-<!-- Distributable under LGPL license. -->
-<!-- See terms of license at http://www.gnu.org. -->
-<!-- -->
-<!-- ====================================================================== -->
+ <!-- ====================================================================== -->
+ <!-- -->
+ <!-- JBoss, the OpenSource J2EE webOS -->
+ <!-- -->
+ <!-- Distributable under LGPL license. -->
+ <!-- See terms of license at http://www.gnu.org. -->
+ <!-- -->
+ <!-- ====================================================================== -->
<!-- $Id: pom.xml -1 $ -->
@@ -30,7 +30,9 @@
<!-- Properties -->
<properties>
+ <version.jboss.shrinkwrap>1.0.0-SNAPSHOT</version.jboss.shrinkwrap>
<version.jboss.vfs>2.1.3.SP1</version.jboss.vfs>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
@@ -45,5 +47,23 @@
<artifactId>jboss-vfs</artifactId>
<version>${version.jboss.vfs}</version>
</dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
+ <version>${version.jboss.shrinkwrap}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs21/src/main/java/org/jboss/osgi/vfs21/VirtualFileAdaptor21.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs21/src/main/java/org/jboss/osgi/vfs21/VirtualFileAdaptor21.java 2010-03-11 11:17:32 UTC (rev 102275)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs21/src/main/java/org/jboss/osgi/vfs21/VirtualFileAdaptor21.java 2010-03-11 11:27:39 UTC (rev 102276)
@@ -21,9 +21,10 @@
*/
package org.jboss.osgi.vfs21;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.net.MalformedURLException;
+import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
@@ -45,13 +46,13 @@
private org.jboss.virtual.VirtualFile root;
private org.jboss.virtual.VirtualFile delegate;
- VirtualFileAdaptor21(org.jboss.virtual.VirtualFile root, org.jboss.virtual.VirtualFile delegate)
+ VirtualFileAdaptor21(org.jboss.virtual.VirtualFile root, org.jboss.virtual.VirtualFile delegate)
{
if (root == null)
throw new IllegalStateException("Null root");
if (delegate == null)
throw new IllegalStateException("Null delegate");
-
+
this.delegate = delegate;
this.root = root;
}
@@ -91,13 +92,37 @@
return delegate.isLeaf() == false;
}
- public URL toURL() throws MalformedURLException, URISyntaxException
+ public URL toURL() throws IOException
{
- return delegate.toURL();
+ try
+ {
+ return delegate.toURL();
+ }
+ catch (URISyntaxException ex)
+ {
+ throw new IOException(ex);
+ }
}
- public void close()
+ public URL getFileURL() throws IOException
{
+ if (root != delegate)
+ return null;
+
+ try
+ {
+ URI uri = VFSUtils.getCompatibleURI(root);
+ String path = VFSUtils.stripProtocol(uri);
+ return new File(path).toURI().toURL();
+ }
+ catch (Exception ex)
+ {
+ throw new IOException(ex);
+ }
+ }
+
+ public void close()
+ {
delegate.close();
}
@@ -129,7 +154,7 @@
{
if (path == null)
throw new IllegalArgumentException("Null path");
-
+
if (pattern == null)
pattern = "*";
@@ -147,14 +172,14 @@
{
if (path == null)
throw new IllegalArgumentException("Null path");
-
+
if (path.startsWith("/"))
path = path.substring(1);
-
+
org.jboss.virtual.VirtualFile child = delegate.getChild(path);
if (child == null)
return null;
-
+
return new VFSEntryPathsEnumeration(delegate, child);
}
Added: projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/SimpleVFS21Test.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/SimpleVFS21Test.java (rev 0)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/SimpleVFS21Test.java 2010-03-11 11:27:39 UTC (rev 102276)
@@ -0,0 +1,182 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.vfs21;
+
+//$Id: SimpleTestCase.java 102173 2010-03-09 21:16:59Z thomas.diesler(a)jboss.com $
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+import org.jboss.osgi.vfs.AbstractVFS;
+import org.jboss.osgi.vfs.VFSUtils;
+import org.jboss.osgi.vfs.VirtualFile;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.test.osgi.vfs21.bundle.SimpleActivator;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Constants;
+
+/**
+ * A test that verifies the VFS21 abstraction.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Mar-2010
+ */
+public class SimpleVFS21Test
+{
+ private static VirtualFile virtualFile;
+ private static int fileLength;
+
+ @BeforeClass
+ public static void beforeClass() throws IOException
+ {
+ JavaArchive archive = Archives.create("example-simple.jar", JavaArchive.class);
+ archive.addClass(SimpleActivator.class);
+ Asset asset = new Asset()
+ {
+ public InputStream openStream()
+ {
+ String path = "/simple/" + JarFile.MANIFEST_NAME;
+ try
+ {
+ URL manifest = getClass().getResource(path);
+ return manifest.openStream();
+ }
+ catch (IOException ex)
+ {
+ throw new IllegalStateException("Cannot open stream for: " + path, ex);
+ }
+ }
+ };
+ archive.add(asset, JarFile.MANIFEST_NAME);
+
+ // Convert archive to file URL
+ ZipExporter exporter = archive.as(ZipExporter.class);
+ File target = File.createTempFile("archive_", ".jar");
+ exporter.exportZip(target, true);
+ target.deleteOnExit();
+
+ FileInputStream fis = new FileInputStream(target);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ VFSUtils.copyStream(fis, baos);
+ fileLength = baos.toByteArray().length;
+
+ virtualFile = AbstractVFS.getRoot(target.toURI().toURL());
+ }
+
+ @Test
+ public void testManifestAccess() throws Exception
+ {
+ VirtualFile child = virtualFile.getChild(JarFile.MANIFEST_NAME);
+ assertNotNull("Manifest not null", child);
+
+ Manifest manifest = new Manifest();
+ manifest.read(child.openStream());
+ Attributes attributes = manifest.getMainAttributes();
+ String symbolicName = attributes.getValue(Constants.BUNDLE_SYMBOLICNAME);
+ assertEquals("example-simple", symbolicName);
+ }
+
+ @Test
+ public void testManifestURLAccess() throws Exception
+ {
+ VirtualFile child = virtualFile.getChild(JarFile.MANIFEST_NAME);
+ assertNotNull("Manifest not null", child);
+
+ URL childURL = child.toURL();
+ URLConnection con = childURL.openConnection();
+ con.connect();
+ InputStream is = con.getInputStream();
+
+ Manifest manifest = new Manifest();
+ manifest.read(is);
+ Attributes attributes = manifest.getMainAttributes();
+ String symbolicName = attributes.getValue(Constants.BUNDLE_SYMBOLICNAME);
+ assertEquals("example-simple", symbolicName);
+ }
+
+ @Test
+ public void testGetEntryPaths() throws Exception
+ {
+ Set<String> actual = new HashSet<String>();
+ Enumeration<String> en = virtualFile.getEntryPaths("/");
+ while(en.hasMoreElements())
+ actual.add(en.nextElement());
+
+ Set<String> expected = new HashSet<String>();
+ expected.add("org/");
+ expected.add("org/jboss/");
+ expected.add("org/jboss/test/");
+ expected.add("org/jboss/test/osgi/");
+ expected.add("org/jboss/test/osgi/vfs21/");
+ expected.add("org/jboss/test/osgi/vfs21/bundle/");
+ expected.add("org/jboss/test/osgi/vfs21/bundle/SimpleActivator.class");
+ expected.add("META-INF/");
+ expected.add("META-INF/MANIFEST.MF");
+ assertEquals(expected, actual);
+ }
+
+ @Test
+ public void testFindEntries() throws Exception
+ {
+ Set<String> actual = new HashSet<String>();
+ Enumeration<URL> en = virtualFile.findEntries("/", null, true);
+ while(en.hasMoreElements())
+ actual.add(en.nextElement().toExternalForm());
+
+ Set<String> expected = new HashSet<String>();
+ expected.add(virtualFile.toURL() + "org/jboss/test/osgi/vfs21/bundle/SimpleActivator.class");
+ expected.add(virtualFile.toURL() + "META-INF/MANIFEST.MF");
+ assertEquals(expected, actual);
+ }
+
+ @Test
+ public void testURLStreamAccess() throws Exception
+ {
+ URL fileURL = virtualFile.getFileURL();
+ URLConnection con = fileURL.openConnection();
+ con.connect();
+ InputStream is = con.getInputStream();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ VFSUtils.copyStream(is, baos);
+ int actualLength = baos.toByteArray().length;
+ assertEquals(fileLength, actualLength);
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/bundle/SimpleActivator.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/bundle/SimpleActivator.java (rev 0)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/java/org/jboss/test/osgi/vfs21/bundle/SimpleActivator.java 2010-03-11 11:27:39 UTC (rev 102276)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.vfs21.bundle;
+
+//$Id: SimpleActivator.java 101150 2010-02-19 10:50:46Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A simple BundleActivator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class SimpleActivator implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/resources/simple/META-INF/MANIFEST.MF
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/resources/simple/META-INF/MANIFEST.MF (rev 0)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs21/src/test/resources/simple/META-INF/MANIFEST.MF 2010-03-11 11:27:39 UTC (rev 102276)
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: example-simple
+Bundle-Activator: org.jboss.test.osgi.vfs21.bundle.SimpleActivator
+Import-Package: org.osgi.framework
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs30/.classpath
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/.classpath 2010-03-11 11:17:32 UTC (rev 102275)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/.classpath 2010-03-11 11:27:39 UTC (rev 102276)
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs30/pom.xml
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/pom.xml 2010-03-11 11:17:32 UTC (rev 102275)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/pom.xml 2010-03-11 11:27:39 UTC (rev 102276)
@@ -30,7 +30,9 @@
<!-- Properties -->
<properties>
+ <version.jboss.shrinkwrap>1.0.0-SNAPSHOT</version.jboss.shrinkwrap>
<version.jboss.vfs>3.0.0-SNAPSHOT</version.jboss.vfs>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
@@ -45,5 +47,23 @@
<artifactId>jboss-vfs</artifactId>
<version>${version.jboss.vfs}</version>
</dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
+ <version>${version.jboss.shrinkwrap}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VFSAdaptor30.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VFSAdaptor30.java 2010-03-11 11:17:32 UTC (rev 102275)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VFSAdaptor30.java 2010-03-11 11:27:39 UTC (rev 102276)
@@ -27,7 +27,9 @@
import org.jboss.osgi.vfs.VFSAdaptor;
import org.jboss.osgi.vfs.VirtualFile;
-import org.jboss.vfs.util.automount.Automounter;
+import org.jboss.vfs.TempFileProvider;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.spi.MountHandle;
/**
* An adaptor to the jboss-vfs-3.0.x VFS.
@@ -49,9 +51,10 @@
throw new IOException(ex);
}
- Automounter.mount(root);
+ TempFileProvider tmp = TempFileProvider.create("osgiroot", null);
+ MountHandle mountHandle = VFS.mountZip(root, root, tmp);
- return new VirtualFileAdaptor30(root);
+ return new VirtualFileAdaptor30(root, mountHandle);
}
public VirtualFile adapt(Object virtualFile)
Modified: projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VirtualFileAdaptor30.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VirtualFileAdaptor30.java 2010-03-11 11:17:32 UTC (rev 102275)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/src/main/java/org/jboss/osgi/vfs30/VirtualFileAdaptor30.java 2010-03-11 11:27:39 UTC (rev 102276)
@@ -21,10 +21,9 @@
*/
package org.jboss.osgi.vfs30;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
@@ -32,7 +31,8 @@
import java.util.List;
import org.jboss.osgi.vfs.VirtualFile;
-import org.jboss.vfs.util.automount.Automounter;
+import org.jboss.vfs.VFSUtils;
+import org.jboss.vfs.spi.MountHandle;
/**
* An adaptor to the jboss-vfs-3.0.x VirtualFile.
@@ -43,7 +43,14 @@
class VirtualFileAdaptor30 implements VirtualFile
{
private org.jboss.vfs.VirtualFile delegate;
+ private MountHandle mountHandle;
+ VirtualFileAdaptor30(org.jboss.vfs.VirtualFile root, MountHandle mountHandle)
+ {
+ this(root);
+ this.mountHandle = mountHandle;
+ }
+
VirtualFileAdaptor30(org.jboss.vfs.VirtualFile delegate)
{
if (delegate == null)
@@ -76,11 +83,21 @@
return delegate.isDirectory();
}
- public URL toURL() throws MalformedURLException, URISyntaxException
+ public URL toURL() throws IOException
{
- return delegate.toURL();
+ URL url = delegate.toURL();
+ return url;
}
+ public URL getFileURL() throws IOException
+ {
+ if (mountHandle == null)
+ return null;
+
+ File mountSource = mountHandle.getMountSource();
+ return mountSource.toURI().toURL();
+ }
+
public VirtualFile getParent()
{
org.jboss.vfs.VirtualFile parent = delegate.getParent();
@@ -145,8 +162,8 @@
public void close()
{
- if (Automounter.isMounted(delegate))
- Automounter.cleanup(delegate);
+ if (mountHandle != null)
+ VFSUtils.safeClose(mountHandle);
}
@Override
Added: projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/SimpleVFS30Test.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/SimpleVFS30Test.java (rev 0)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/SimpleVFS30Test.java 2010-03-11 11:27:39 UTC (rev 102276)
@@ -0,0 +1,182 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.vfs30;
+
+//$Id: SimpleTestCase.java 102173 2010-03-09 21:16:59Z thomas.diesler(a)jboss.com $
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+import org.jboss.osgi.vfs.AbstractVFS;
+import org.jboss.osgi.vfs.VFSUtils;
+import org.jboss.osgi.vfs.VirtualFile;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.test.osgi.vfs30.bundle.SimpleActivator;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Constants;
+
+/**
+ * A test that verifies the VFS30 abstraction.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Mar-2010
+ */
+public class SimpleVFS30Test
+{
+ private static VirtualFile virtualFile;
+ private static int fileLength;
+
+ @BeforeClass
+ public static void beforeClass() throws IOException
+ {
+ JavaArchive archive = Archives.create("example-simple.jar", JavaArchive.class);
+ archive.addClass(SimpleActivator.class);
+ Asset asset = new Asset()
+ {
+ public InputStream openStream()
+ {
+ String path = "/simple/" + JarFile.MANIFEST_NAME;
+ try
+ {
+ URL manifest = getClass().getResource(path);
+ return manifest.openStream();
+ }
+ catch (IOException ex)
+ {
+ throw new IllegalStateException("Cannot open stream for: " + path, ex);
+ }
+ }
+ };
+ archive.add(asset, JarFile.MANIFEST_NAME);
+
+ // Convert archive to file URL
+ ZipExporter exporter = archive.as(ZipExporter.class);
+ File target = File.createTempFile("archive_", ".jar");
+ exporter.exportZip(target, true);
+ target.deleteOnExit();
+
+ FileInputStream fis = new FileInputStream(target);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ VFSUtils.copyStream(fis, baos);
+ fileLength = baos.toByteArray().length;
+
+ virtualFile = AbstractVFS.getRoot(target.toURI().toURL());
+ }
+
+ @Test
+ public void testManifestAccess() throws Exception
+ {
+ VirtualFile child = virtualFile.getChild(JarFile.MANIFEST_NAME);
+ assertNotNull("Manifest not null", child);
+
+ Manifest manifest = new Manifest();
+ manifest.read(child.openStream());
+ Attributes attributes = manifest.getMainAttributes();
+ String symbolicName = attributes.getValue(Constants.BUNDLE_SYMBOLICNAME);
+ assertEquals("example-simple", symbolicName);
+ }
+
+ @Test
+ public void testManifestURLAccess() throws Exception
+ {
+ VirtualFile child = virtualFile.getChild(JarFile.MANIFEST_NAME);
+ assertNotNull("Manifest not null", child);
+
+ URL childURL = child.toURL();
+ URLConnection con = childURL.openConnection();
+ con.connect();
+ InputStream is = con.getInputStream();
+
+ Manifest manifest = new Manifest();
+ manifest.read(is);
+ Attributes attributes = manifest.getMainAttributes();
+ String symbolicName = attributes.getValue(Constants.BUNDLE_SYMBOLICNAME);
+ assertEquals("example-simple", symbolicName);
+ }
+
+ @Test
+ public void testGetEntryPaths() throws Exception
+ {
+ Set<String> actual = new HashSet<String>();
+ Enumeration<String> en = virtualFile.getEntryPaths("/");
+ while(en.hasMoreElements())
+ actual.add(en.nextElement());
+
+ Set<String> expected = new HashSet<String>();
+ expected.add("org/");
+ expected.add("org/jboss/");
+ expected.add("org/jboss/test/");
+ expected.add("org/jboss/test/osgi/");
+ expected.add("org/jboss/test/osgi/vfs30/");
+ expected.add("org/jboss/test/osgi/vfs30/bundle/");
+ expected.add("org/jboss/test/osgi/vfs30/bundle/SimpleActivator.class");
+ expected.add("META-INF/");
+ expected.add("META-INF/MANIFEST.MF");
+ assertEquals(expected, actual);
+ }
+
+ @Test
+ public void testFindEntries() throws Exception
+ {
+ Set<String> actual = new HashSet<String>();
+ Enumeration<URL> en = virtualFile.findEntries("/", null, true);
+ while(en.hasMoreElements())
+ actual.add(en.nextElement().toExternalForm());
+
+ Set<String> expected = new HashSet<String>();
+ expected.add(virtualFile.toURL() + "org/jboss/test/osgi/vfs30/bundle/SimpleActivator.class");
+ expected.add(virtualFile.toURL() + "META-INF/MANIFEST.MF");
+ assertEquals(expected, actual);
+ }
+
+ @Test
+ public void testURLStreamAccess() throws Exception
+ {
+ URL fileURL = virtualFile.getFileURL();
+ URLConnection con = fileURL.openConnection();
+ con.connect();
+ InputStream is = con.getInputStream();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ VFSUtils.copyStream(is, baos);
+ int actualLength = baos.toByteArray().length;
+ assertEquals(fileLength, actualLength);
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/bundle/SimpleActivator.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/bundle/SimpleActivator.java (rev 0)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/java/org/jboss/test/osgi/vfs30/bundle/SimpleActivator.java 2010-03-11 11:27:39 UTC (rev 102276)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.vfs30.bundle;
+
+//$Id: SimpleActivator.java 101150 2010-02-19 10:50:46Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A simple BundleActivator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class SimpleActivator implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/resources/simple/META-INF/MANIFEST.MF
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/resources/simple/META-INF/MANIFEST.MF (rev 0)
+++ projects/jboss-osgi/projects/vfs/trunk/vfs30/src/test/resources/simple/META-INF/MANIFEST.MF 2010-03-11 11:27:39 UTC (rev 102276)
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: example-simple
+Bundle-Activator: org.jboss.test.osgi.vfs30.bundle.SimpleActivator
+Import-Package: org.osgi.framework
14 years, 3 months
JBoss-OSGI SVN: r102247 - in projects/jboss-osgi/trunk/distribution: installer/src/main/resources/installer and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-03-10 17:15:17 -0500 (Wed, 10 Mar 2010)
New Revision: 102247
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/distribution/pom.xml
Log:
Update runtime to vfs30
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2010-03-10 21:38:44 UTC (rev 102246)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2010-03-10 22:15:17 UTC (rev 102247)
@@ -191,7 +191,7 @@
<include name="jboss-osgi-spi.jar" />
<include name="jboss-osgi-testing.jar" />
<include name="jboss-osgi-vfs.jar" />
- <include name="jboss-osgi-vfs21.jar" />
+ <include name="jboss-osgi-vfs30.jar" />
<include name="jboss-vfs.jar" />
<include name="log4j.jar" />
<include name="slf4j-api.jar" />
@@ -344,11 +344,11 @@
<include name="jboss-managed.jar" />
<include name="jboss-mdr.jar" />
<include name="jboss-metatype.jar" />
- <include name="jboss-osgi-deployers-vfs21.jar" />
+ <include name="jboss-osgi-deployers-vfs30.jar" />
<include name="jboss-osgi-framework.jar" />
<include name="jboss-osgi-framework-core.jar" />
<include name="jboss-osgi-framework-metadata.jar" />
- <include name="jboss-osgi-framework-vfs21.jar" />
+ <include name="jboss-osgi-framework-vfs30.jar" />
<include name="jboss-reflect.jar" />
<include name="jbossxb.jar" />
<include name="mcann-core.jar" />
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties 2010-03-10 21:38:44 UTC (rev 102246)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties 2010-03-10 22:15:17 UTC (rev 102247)
@@ -31,17 +31,13 @@
org.jboss.osgi.spi.util;version=1.0, \
org.jboss.osgi.testing;version=1.0, \
org.jboss.osgi.vfs;version=1.0, \
- org.jboss.virtual;version=2.1, \
- org.jboss.virtual.plugins.registry;version=2.1, \
- org.jboss.virtual.plugins.context.jar;version=2.1, \
- org.jboss.virtual.plugins.vfs.helpers;version=2.1, \
- org.jboss.virtual.protocol;version=2.1, \
+ org.jboss.vfs;version=3.0, \
org.osgi.framework;version=1.5
# Bundles that need to be installed with the Framework automatically
org.jboss.osgi.spi.framework.autoInstall=\
file://${osgi.home}/server/minimal/deploy/org.eclipse.osgi.services.jar \
- file://${osgi.home}/server/minimal/deploy/org.eclipse.osgi.util.jar
+ file://${osgi.home}/server/minimal/deploy/org.eclipse.osgi.util.jar
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-felix.properties 2010-03-10 21:38:44 UTC (rev 102246)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-felix.properties 2010-03-10 22:15:17 UTC (rev 102247)
@@ -31,11 +31,7 @@
org.jboss.osgi.spi.util;version=1.0, \
org.jboss.osgi.testing;version=1.0, \
org.jboss.osgi.vfs;version=1.0, \
- org.jboss.virtual;version=2.1, \
- org.jboss.virtual.plugins.registry;version=2.1, \
- org.jboss.virtual.plugins.context.jar;version=2.1, \
- org.jboss.virtual.plugins.vfs.helpers;version=2.1, \
- org.jboss.virtual.protocol;version=2.1, \
+ org.jboss.vfs;version=3.0, \
org.osgi.framework;version=1.5
# Bundles that need to be installed with the Framework automatically
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2010-03-10 21:38:44 UTC (rev 102246)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2010-03-10 22:15:17 UTC (rev 102247)
@@ -33,6 +33,7 @@
org.jboss.beans.metadata.spi.builder;version=2.2,
org.jboss.dependency.spi;version=2.2,
org.jboss.kernel.spi.dependency;version=2.2,
+ org.jboss.vfs;version=3.0,
<!-- jboss-osgi -->
org.jboss.osgi.spi;version=1.0,
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2010-03-10 21:38:44 UTC (rev 102246)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2010-03-10 22:15:17 UTC (rev 102247)
@@ -89,11 +89,11 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.deployers</groupId>
- <artifactId>jboss-osgi-deployers-vfs21</artifactId>
+ <artifactId>jboss-osgi-deployers-vfs30</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.osgi.deployers</groupId>
- <artifactId>jboss-osgi-deployers-vfs30</artifactId>
+ <artifactId>jboss-osgi-deployers-vfs21</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.osgi.jmx</groupId>
@@ -167,21 +167,21 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.vfs</groupId>
- <artifactId>jboss-osgi-vfs21</artifactId>
+ <artifactId>jboss-osgi-vfs30</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.osgi.vfs</groupId>
- <artifactId>jboss-osgi-vfs21</artifactId>
+ <artifactId>jboss-osgi-vfs30</artifactId>
<version>${version.jboss.osgi.vfs}</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>org.jboss.osgi.vfs</groupId>
- <artifactId>jboss-osgi-vfs30</artifactId>
+ <artifactId>jboss-osgi-vfs21</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.osgi.vfs</groupId>
- <artifactId>jboss-osgi-vfs30</artifactId>
+ <artifactId>jboss-osgi-vfs21</artifactId>
<version>${version.jboss.osgi.vfs}</version>
<classifier>sources</classifier>
</dependency>
@@ -491,12 +491,12 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs21</artifactId>
+ <artifactId>jboss-osgi-framework-vfs30</artifactId>
<version>${version.jboss.osgi.framework}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs30</artifactId>
+ <artifactId>jboss-osgi-framework-vfs21</artifactId>
<version>${version.jboss.osgi.framework}</version>
</dependency>
<dependency>
14 years, 4 months
JBoss-OSGI SVN: r102246 - in projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi: bundle and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-03-10 16:38:44 -0500 (Wed, 10 Mar 2010)
New Revision: 102246
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractDeploymentTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleEntriesUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/compendium/PackageAdminTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetServiceReferencesUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetUnGetServiceUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/RegisterServiceUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceFactoryUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceReferenceUnitTestCase.java
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceRegistrationUnitTestCase.java
Log:
Resurect all ServiceMix tests
Simplify installBundle
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractDeploymentTest.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractDeploymentTest.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractDeploymentTest.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -31,6 +31,7 @@
import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.attachments.MutableAttachments;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
@@ -158,6 +159,11 @@
MutableAttachments att = (MutableAttachments)deployment.getPredeterminedManagedObjects();
att.addAttachment(BeanMetaData.class, bmd);
+ return addDeployment(deployment);
+ }
+
+ protected Deployment addDeployment(Deployment deployment) throws DeploymentException
+ {
getDeployerClient().addDeployment(deployment);
getDeployerClient().process();
return deployment;
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/AbstractFrameworkTest.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -43,6 +43,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.util.ConstantsHelper;
import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.osgi.vfs.VirtualFile;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.osgi.framework.Bundle;
@@ -108,6 +109,11 @@
return ((OSGiFramework)framework).getBundleManager();
}
+ protected Bundle installBundle(VirtualFile archive) throws Exception
+ {
+ return context.installBundle(archive.toURL().toExternalForm());
+
+ }
protected void assertLoadClass(Bundle bundle, String className, Bundle exporter)
{
Class<?> clazz = assertLoadClass(bundle, className);
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -38,7 +38,6 @@
import java.util.Locale;
import java.util.Set;
-import org.jboss.osgi.vfs.VirtualFile;
import org.jboss.test.osgi.AbstractFrameworkTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -62,8 +61,7 @@
@Test
public void testGetBundle() throws Exception
{
- VirtualFile assembly1 = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1"));
BundleContext context1 = null;
try
{
@@ -77,8 +75,7 @@
Set<Bundle> expected = new HashSet<Bundle>(Arrays.asList(framework, bundle1));
assertEquals(expected, actual);
- VirtualFile assembly2 = assembleArchive("simple-bundle2", "/bundles/simple/simple-bundle2", new Class[0]);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembleArchive("simple-bundle2", "/bundles/simple/simple-bundle2"));
BundleContext context2 = null;
try
{
@@ -176,8 +173,7 @@
@Test
public void testProperties() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1"));
try
{
bundle.start();
@@ -258,8 +254,7 @@
@Test
public void testServiceListener() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1"));
try
{
bundle.start();
@@ -351,8 +346,7 @@
@Test
public void testBundleListener() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1"));
try
{
bundle.start();
@@ -409,8 +403,7 @@
@Test
public void testFrameworkListener() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1"));
try
{
bundle.start();
@@ -448,8 +441,7 @@
@Test
public void testGetDataFile() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1"));
try
{
bundle.start();
@@ -469,8 +461,7 @@
@Test
public void testStopedBundleContext() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1"));
try
{
bundle.start();
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleEntriesUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleEntriesUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleEntriesUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -23,7 +23,10 @@
// $Id: $
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
import java.net.URL;
import java.util.Arrays;
@@ -32,7 +35,6 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.osgi.vfs.VirtualFile;
import org.jboss.test.osgi.AbstractFrameworkTest;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -51,8 +53,7 @@
@Test
public void testEntriesNotInstalled() throws Exception
{
- VirtualFile assembly = assembleArchive("entries-simple", "/bundles/entries/entries-simple", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("entries-simple", "/bundles/entries/entries-simple"));
bundle.uninstall();
try
{
@@ -77,8 +78,7 @@
@Test
public void testFindEntriesNoPath() throws Exception
{
- VirtualFile assembly = assembleArchive("entries-simple", "/bundles/entries/entries-simple", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("entries-simple", "/bundles/entries/entries-simple"));
try
{
bundle.findEntries(null, "root.xml", false);
@@ -97,8 +97,7 @@
@Test
public void testEntries() throws Exception
{
- VirtualFile assembly = assembleArchive("entries-simple", "/bundles/entries/entries-simple", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembleArchive("entries-simple", "/bundles/entries/entries-simple"));
try
{
assertEntry(bundle, "");
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -52,7 +52,7 @@
public void testSimpleStart() throws Exception
{
VirtualFile assemblyA = assembleArchive("lifecycle-service", "/bundles/lifecycle/simple-service", LifecycleService.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
assertBundleState(Bundle.INSTALLED, bundleA.getState());
@@ -77,7 +77,7 @@
public void testDependencyNotAvailable() throws Exception
{
VirtualFile assemblyA = assembleArchive("lifecycle-service", "/bundles/lifecycle/simple-service", LifecycleService.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
assertBundleState(Bundle.INSTALLED, bundleA.getState());
@@ -87,7 +87,7 @@
assertNull("Service not available", sref);
VirtualFile assemblyB = assembleArchive("lifecycle-failstart", "/bundles/lifecycle/fail-on-start", FailOnStartActivator.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
assertBundleState(Bundle.INSTALLED, bundleB.getState());
@@ -119,14 +119,14 @@
public void testDependencyAvailable() throws Exception
{
VirtualFile assemblyA = assembleArchive("lifecycle-service", "/bundles/lifecycle/simple-service", LifecycleService.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertBundleState(Bundle.ACTIVE, bundleA.getState());
VirtualFile assemblyB = assembleArchive("lifecycle-failstart", "/bundles/lifecycle/fail-on-start", FailOnStartActivator.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -152,13 +152,13 @@
public void testStartRetry() throws Exception
{
VirtualFile assemblyA = assembleArchive("lifecycle-service", "/bundles/lifecycle/simple-service", LifecycleService.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
assertBundleState(Bundle.INSTALLED, bundleA.getState());
VirtualFile assemblyB = assembleArchive("lifecycle-failstart", "/bundles/lifecycle/fail-on-start", FailOnStartActivator.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
assertBundleState(Bundle.INSTALLED, bundleB.getState());
@@ -201,7 +201,7 @@
public void testFailToResolve() throws Exception
{
VirtualFile assemblyA = assembleArchive("lifecycle-failstart", "/bundles/lifecycle/fail-on-start", FailOnStartActivator.class);
- Bundle bundleB = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyA);
try
{
assertBundleState(Bundle.INSTALLED, bundleB.getState());
@@ -232,8 +232,7 @@
{
try
{
- VirtualFile assembly = assembleArchive("missing-symbolic-name", "/bundles/lifecycle/invalid01");
- context.installBundle(assembly.toURL().toExternalForm());
+ installBundle(assembleArchive("missing-symbolic-name", "/bundles/lifecycle/invalid01"));
fail("BundleException expected");
}
catch (BundleException ex)
@@ -243,8 +242,7 @@
try
{
- VirtualFile assembly = assembleArchive("invalid-export", "/bundles/lifecycle/invalid02");
- context.installBundle(assembly.toURL().toExternalForm());
+ installBundle(assembleArchive("invalid-export", "/bundles/lifecycle/invalid02"));
fail("BundleException expected");
}
catch (BundleException ex)
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -58,8 +58,8 @@
public void testBundleId() throws Exception
{
long id1 = -1;
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
id1 = bundle.getBundleId();
@@ -71,7 +71,7 @@
assertEquals(id1, bundle.getBundleId());
long id2 = -1;
- bundle = context.installBundle(assembly.toURL().toExternalForm());
+ bundle = installBundle(assembly);
try
{
id2 = bundle.getBundleId();
@@ -87,8 +87,8 @@
@Test
public void testSymbolicName() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
assertEquals("org.jboss.test.osgi.simple1", bundle.getSymbolicName());
@@ -103,8 +103,8 @@
@Test
public void testState() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
assertEquals(Bundle.INSTALLED, bundle.getState());
@@ -125,8 +125,8 @@
@Test
public void testGetBundleContext() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
BundleContext bundleContext = bundle.getBundleContext();
@@ -169,7 +169,7 @@
new JarOutputStream(baos, manifest).close();
ByteArrayInputStream updateStream = new ByteArrayInputStream(baos.toByteArray());
- Bundle bundle = context.installBundle(assemble1.toURL().toExternalForm());
+ Bundle bundle = installBundle(assemble1);
try
{
int beforeCount = context.getBundles().length;
@@ -201,11 +201,11 @@
public void testSingleton() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundle10", "/bundles/singleton/singleton1");
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
VirtualFile assemblyB = assembleArchive("bundle20", "/bundles/singleton/singleton2");
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
bundleB.uninstall();
fail("Should not be here!");
}
@@ -223,11 +223,11 @@
public void testNotSingleton() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundle1", "/bundles/singleton/singleton1");
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
VirtualFile assemblyB = assembleArchive("not-singleton", "/bundles/singleton/not-singleton");
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
assertEquals(bundleA.getSymbolicName(), bundleB.getSymbolicName());
@@ -247,8 +247,8 @@
@SuppressWarnings({ "rawtypes", "unchecked" })
public void testGetHeaders() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
Dictionary expected = new Hashtable();
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/RequireBundleUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -47,13 +47,13 @@
public void testSimpleRequireBundle() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA", "/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("simplerequirebundleA", "/bundles/classloader/simplerequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -75,13 +75,13 @@
public void testSimpleRequireBundleFails() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA", "/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("simplerequirebundlefails", "/bundles/classloader/simplerequirebundlefails", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -106,13 +106,13 @@
public void testVersionRequireBundle() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA", "/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("versionrequirebundleA", "/bundles/classloader/versionrequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -134,13 +134,13 @@
public void testVersionRequireBundleFails() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA", "/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("versionrequirebundlefails", "/bundles/classloader/versionrequirebundlefails", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -165,13 +165,13 @@
public void testOptionalRequireBundle() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA", "/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("optionalrequirebundleA", "/bundles/classloader/optionalrequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -193,13 +193,13 @@
public void testOptionalRequireBundleFails() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA", "/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("optionalrequirebundlefails", "/bundles/classloader/optionalrequirebundlefails", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -225,7 +225,7 @@
//Bundle-SymbolicName: org.jboss.test.osgi.classloader.bundleA;test=x
//Export-Package: org.jboss.test.osgi.classloader.support.a;version=1.0.0;test=x
VirtualFile assemblyA = assembleArchive("bundleA", "/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
@@ -237,7 +237,7 @@
//Require-Bundle: org.jboss.test.osgi.classloader.bundleA;visibility:=reexport
//Export-Package: org.jboss.test.osgi.classloader.support.b
VirtualFile assemblyB = assembleArchive("reexportrequirebundleA", "/bundles/classloader/reexportrequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
@@ -249,7 +249,7 @@
//Bundle-SymbolicName: org.jboss.test.osgi.classloader.bundleC
//Require-Bundle: org.jboss.test.osgi.classloader.bundleB
VirtualFile assemblyC = assembleArchive("reexportrequirebundleB", "/bundles/classloader/reexportrequirebundleB");
- Bundle bundleC = context.installBundle(assemblyC.toURL().toExternalForm());
+ Bundle bundleC = installBundle(assemblyC);
try
{
@@ -276,20 +276,20 @@
public void testNoReExportRequireBundle() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA", "/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("noreexportrequirebundleA", "/bundles/classloader/noreexportrequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
assertLoadClass(bundleB, A.class.getName(), bundleA);
assertLoadClass(bundleB, B.class.getName(), bundleB);
VirtualFile assemblyC = assembleArchive("reexportrequirebundleB", "/bundles/classloader/reexportrequirebundleB");
- Bundle bundleC = context.installBundle(assemblyC.toURL().toExternalForm());
+ Bundle bundleC = installBundle(assemblyC);
try
{
assertLoadClassFail(bundleC, A.class.getName());
@@ -315,13 +315,13 @@
public void testAttributeRequireBundle() throws Exception
{
VirtualFile assemblyA = assembleArchive("bundleA", "/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
assertLoadClass(bundleA, A.class.getName());
VirtualFile assemblyB = assembleArchive("attributerequirebundleA", "/bundles/classloader/attributerequirebundleA", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -346,7 +346,7 @@
// Export-Package: org.jboss.test.osgi.classloader.support.a;version=1.0.0;test=x
// Bundle-Version: 1.0.0
VirtualFile assemblyA = assembleArchive("bundleA", "/bundles/classloader/bundleA", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -355,7 +355,7 @@
// Bundle-SymbolicName: org.jboss.test.osgi.classloader.bundleB
// Require-Bundle: org.jboss.test.osgi.classloader.bundleA;doesnotexist=true;test=y
VirtualFile assemblyB = assembleArchive("attributerequirebundlefails", "/bundles/classloader/attributerequirebundlefails", B.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/compendium/PackageAdminTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/compendium/PackageAdminTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/compendium/PackageAdminTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -46,7 +46,7 @@
public void testGetBudleFromClass() throws Exception
{
VirtualFile assemblyA = assembleArchive("smoke-assembled", "/bundles/smoke/smoke-assembled", PA.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -61,7 +61,7 @@
assertNull(notFound);
VirtualFile assemblyB = assembleArchive("simple", "/bundles/simple/simple-bundle1", Other.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetServiceReferencesUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetServiceReferencesUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetServiceReferencesUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -55,7 +55,7 @@
public void testGetServiceReferences() throws Exception
{
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1", A.class);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -175,7 +175,7 @@
private void assertGetServiceReferencesNotAssignable(String className) throws Exception
{
VirtualFile assemblyA = assembleArchive("simple1", "/bundles/simple/simple-bundle1", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -193,7 +193,7 @@
assertNotNull(reference1);
VirtualFile assemblyB = assembleArchive("simple2", "/bundles/simple/simple-bundle2", A.class);
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -277,7 +277,7 @@
private void assertGetServiceReferencesAssignable(String className) throws Exception
{
VirtualFile assemblyA = assembleArchive("service2", "/bundles/service/service-bundle2", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -295,7 +295,7 @@
assertNotNull(reference1);
VirtualFile assemblyB = assembleArchive("service1", "/bundles/service/service-bundle1");
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -370,7 +370,7 @@
String className = A.class.getName();
VirtualFile assemblyA = assembleArchive("service2", "/bundles/service/service-bundle2", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -391,7 +391,7 @@
assertNotNull(reference1);
VirtualFile assemblyB = assembleArchive("service1", "/bundles/service/service-bundle1");
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -481,7 +481,7 @@
String wrongClassName = B.class.getName();
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1", A.class);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetUnGetServiceUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetUnGetServiceUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/GetUnGetServiceUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -48,8 +48,8 @@
@Test
public void testGetUnServiceErrors() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -87,8 +87,8 @@
@Test
public void testGetService() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -114,8 +114,8 @@
@Test
public void testGetServiceAfterStop() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -148,8 +148,8 @@
@Test
public void testErrorInGetService() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -174,8 +174,8 @@
@Test
public void testErrorInUnGetService() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -203,8 +203,8 @@
@Test
public void testUnGetServiceResult() throws Exception
{
- VirtualFile assembly1 = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ VirtualFile assembly1 = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -222,8 +222,8 @@
assertTrue(bundleContext.ungetService(reference));
assertFalse(bundleContext.ungetService(reference));
- VirtualFile assembly2 = assembleArchive("simple-bundle2", "/bundles/simple/simple-bundle2", new Class[0]);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ VirtualFile assembly2 = assembleArchive("simple-bundle2", "/bundles/simple/simple-bundle2");
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/RegisterServiceUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/RegisterServiceUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/RegisterServiceUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -54,8 +54,8 @@
String OBJCLASS = BundleContext.class.getName();
String[] OBJCLASSES = new String[] { OBJCLASS };
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -189,8 +189,8 @@
Dictionary<String, Object> properties = new Hashtable<String, Object>();
properties.put(Constants.OBJECTCLASS, new String[] { "rubbish" });
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -220,8 +220,8 @@
@Test
public void testRegisterService() throws Exception
{
- VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ VirtualFile assembly = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -247,8 +247,8 @@
@Test
public void testBundleUninstall() throws Exception
{
- VirtualFile assembly1 = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ VirtualFile assembly1 = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -260,8 +260,8 @@
Object actual = bundleContext.getService(reference);
assertEquals(bundleContext, actual);
- VirtualFile assembly2 = assembleArchive("simple-bundle2", "/bundles/simple/simple-bundle2", new Class[0]);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ VirtualFile assembly2 = assembleArchive("simple-bundle2", "/bundles/simple/simple-bundle2");
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
@@ -288,8 +288,8 @@
@Test
public void testRegisteredServices() throws Exception
{
- VirtualFile assembly1 = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1", new Class[0]);
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ VirtualFile assembly1 = assembleArchive("simple-bundle1", "/bundles/simple/simple-bundle1");
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -301,8 +301,8 @@
Object actual = bundleContext.getService(reference);
assertEquals(bundleContext, actual);
- VirtualFile assembly2 = assembleArchive("simple-bundle2", "/bundles/simple/simple-bundle2", new Class[0]);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ VirtualFile assembly2 = assembleArchive("simple-bundle2", "/bundles/simple/simple-bundle2");
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceFactoryUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceFactoryUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceFactoryUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -53,7 +53,7 @@
public void testRegisterServiceFactory() throws Exception
{
VirtualFile assemblyA = assembleArchive("simple1", "/bundles/simple/simple-bundle1", A.class);
- Bundle bundleA = context.installBundle(assemblyA.toURL().toExternalForm());
+ Bundle bundleA = installBundle(assemblyA);
try
{
bundleA.start();
@@ -78,7 +78,7 @@
assertEquals(1, serviceFactory.getCount);
VirtualFile assemblyB = assembleArchive("simple2", "/bundles/simple/simple-bundle2");
- Bundle bundleB = context.installBundle(assemblyB.toURL().toExternalForm());
+ Bundle bundleB = installBundle(assemblyB);
try
{
bundleB.start();
@@ -109,7 +109,7 @@
String OBJCLASS = BundleContext.class.getName();
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -140,7 +140,7 @@
String OBJCLASS = BundleContext.class.getName();
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -175,7 +175,7 @@
String[] OBJCLASSES = {String.class.getName(), BundleContext.class.getName()};
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -21,8 +21,11 @@
*/
package org.jboss.test.osgi.service;
+// $Id: $
+
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
@@ -37,6 +40,7 @@
import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.Deployment;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.osgi.framework.deployers.AbstractDeployment;
import org.jboss.osgi.vfs.VirtualFile;
import org.jboss.test.osgi.service.support.LazyBundle;
import org.jboss.test.osgi.service.support.a.A;
@@ -53,6 +57,7 @@
* Test MC's service mixture.
*
* @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
+ * @author Thomas.Diesler(a)jboss.com
*/
public class ServiceMixUnitTestCase extends AbstractServiceMixTest
{
@@ -63,7 +68,7 @@
try
{
VirtualFile assembly1 = assembleArchive("simple1", "/bundles/service/service-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -116,7 +121,7 @@
KernelControllerContext kcc = getControllerContext("C", null);
VirtualFile assembly1 = assembleArchive("simple2", "/bundles/service/service-bundle3");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -175,7 +180,7 @@
KernelControllerContext kcc = getControllerContext("C", null);
VirtualFile assembly1 = assembleArchive("simple2", "/bundles/service/service-bundle3");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -235,7 +240,7 @@
try
{
VirtualFile assembly1 = assembleArchive("simple2", "/bundles/service/service-bundle3");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -290,7 +295,7 @@
try
{
VirtualFile assembly1 = assembleArchive("simple2", "/bundles/service/service-bundle4");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -358,7 +363,7 @@
try
{
VirtualFile assembly1 = assembleArchive("simple2", "/bundles/service/service-bundle4");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -425,7 +430,7 @@
try
{
VirtualFile assembly1 = assembleArchive("simple2", "/bundles/service/service-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -480,14 +485,11 @@
}
}
- /*
@Test
public void testBeansMix() throws Throwable
{
- AssembledDirectory mix = createAssembledDirectory("beans1", "");
- addPath(mix, "/bundles/service/service-beans1", "");
- addPackage(mix, A.class);
- Deployment deployment = addDeployment(mix);
+ VirtualFile assembly = assembleArchive("beans1", "/bundles/service/service-beans1", A.class);
+ Deployment deployment = addDeployment(AbstractDeployment.createDeployment(assembly));
try
{
checkComplete();
@@ -518,7 +520,7 @@
public void testServiceInjection() throws Throwable
{
VirtualFile assembly1 = assembleArchive("simple2", "/bundles/service/service-bundle2", A.class);
- Bundle bundle = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly1);
try
{
bundle.start();
@@ -532,10 +534,8 @@
ServiceRegistration reg1 = bundleContext1.registerService(A.class.getName(), a, table);
assertNotNull(reg1);
- AssembledDirectory mix = createAssembledDirectory("beans1", "");
- addPath(mix, "/bundles/service/service-beans2", "");
- addPackage(mix, C.class);
- Deployment deployment = assertDeploy(mix);
+ VirtualFile assembly = assembleArchive("beans1", "/bundles/service/service-beans2", C.class);
+ Deployment deployment = addDeployment(AbstractDeployment.createDeployment(assembly));
try
{
checkComplete();
@@ -556,5 +556,4 @@
bundle.uninstall();
}
}
- */
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceReferenceUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceReferenceUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceReferenceUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -57,7 +57,7 @@
Object serviceID = null;
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -156,7 +156,7 @@
ServiceReference reference = null;
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -216,7 +216,7 @@
public void testGetBundle() throws Exception
{
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -247,7 +247,7 @@
public void testGetBundleAfterStop() throws Exception
{
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -278,7 +278,7 @@
public void testUsingBundles() throws Exception
{
VirtualFile assembly1 = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -294,7 +294,7 @@
assertUsingBundles(reference);
VirtualFile assembly2 = assembleArchive("simple2", "/bundles/simple/simple-bundle2");
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
@@ -337,7 +337,7 @@
public void testUsingBundlesAfterStop() throws Exception
{
VirtualFile assembly1 = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -353,7 +353,7 @@
assertUsingBundles(reference);
VirtualFile assembly2 = assembleArchive("simple2", "/bundles/simple/simple-bundle2");
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
@@ -382,7 +382,7 @@
public void testIsAssignableToErrors() throws Exception
{
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1", A.class);
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -425,7 +425,7 @@
public void testNotAssignableTo() throws Exception
{
VirtualFile assembly1 = assembleArchive("simple1", "/bundles/simple/simple-bundle1", A.class);
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -439,7 +439,7 @@
assertNotNull(reference);
VirtualFile assembly2 = assembleArchive("simple2", "/bundles/simple/simple-bundle2", A.class);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembly2);
try
{
assertFalse(reference.isAssignableTo(bundle2, A.class.getName()));
@@ -467,7 +467,7 @@
//Bundle-SymbolicName: org.jboss.test.osgi.service2
//Export-Package: org.jboss.test.osgi.service.support.a
VirtualFile assembly2 = assembleArchive("service2", "/bundles/service/service-bundle2", A.class);
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembly2);
try
{
@@ -479,7 +479,7 @@
//Bundle-SymbolicName: org.jboss.test.osgi.service1
//Import-Package: org.jboss.test.osgi.service.support.a
VirtualFile assembly1 = assembleArchive("service1", "/bundles/service/service-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
@@ -516,7 +516,7 @@
public void testCompareTo() throws Exception
{
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceRegistrationUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceRegistrationUnitTestCase.java 2010-03-10 21:07:21 UTC (rev 102245)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/service/ServiceRegistrationUnitTestCase.java 2010-03-10 21:38:44 UTC (rev 102246)
@@ -54,7 +54,7 @@
public void testGetReference() throws Exception
{
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -116,7 +116,7 @@
public void testSetProperties() throws Exception
{
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -225,7 +225,7 @@
public void testSetPropertiesAfterStop() throws Exception
{
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
@@ -258,7 +258,7 @@
public void testUnregister() throws Exception
{
VirtualFile assembly1 = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle1 = context.installBundle(assembly1.toURL().toExternalForm());
+ Bundle bundle1 = installBundle(assembly1);
try
{
bundle1.start();
@@ -283,7 +283,7 @@
assertArrayEquals(new ServiceReference[] { reference }, inUse);
VirtualFile assembly2 = assembleArchive("simple2", "/bundles/simple/simple-bundle2");
- Bundle bundle2 = context.installBundle(assembly2.toURL().toExternalForm());
+ Bundle bundle2 = installBundle(assembly2);
try
{
bundle2.start();
@@ -341,7 +341,7 @@
public void testUnregisterAfterStop() throws Exception
{
VirtualFile assembly = assembleArchive("simple1", "/bundles/simple/simple-bundle1");
- Bundle bundle = context.installBundle(assembly.toURL().toExternalForm());
+ Bundle bundle = installBundle(assembly);
try
{
bundle.start();
14 years, 4 months
JBoss-OSGI SVN: r102237 - in projects/jboss-osgi: projects/runtime/framework/trunk/bundle and 9 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-03-10 12:16:48 -0500 (Wed, 10 Mar 2010)
New Revision: 102237
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/scripts/assembly-all.xml
projects/jboss-osgi/projects/runtime/framework/trunk/core/src/main/java/org/jboss/osgi/framework/plugins/internal/SystemPackagesPluginImpl.java
projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/pom.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Update to jboss-osgi-vfs30
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml 2010-03-10 17:16:48 UTC (rev 102237)
@@ -167,11 +167,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.deployers</groupId>
- <artifactId>jboss-osgi-deployers-vfs30</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.osgi.framework</groupId>
<artifactId>jboss-osgi-framework-vfs30</artifactId>
<version>${version}</version>
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/scripts/assembly-all.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/scripts/assembly-all.xml 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/scripts/assembly-all.xml 2010-03-10 17:16:48 UTC (rev 102237)
@@ -36,10 +36,8 @@
<include>*:jboss-mdr:jar</include>
<include>*:jboss-metatype:jar</include>
<include>*:jboss-osgi-deployment:jar</include>
- <include>*:jboss-osgi-deployers-vfs21:jar</include>
<include>*:jboss-osgi-spi:jar</include>
<include>*:jboss-reflect:jar</include>
- <!-- include>*:jboss-vfs:jar</include -->
<include>*:jbossxb:jar</include>
<include>*:mcann-core:jar</include>
<include>*:org.osgi.core:jar</include>
@@ -53,6 +51,8 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:jboss-logging-log4j:jar</include>
+ <include>*:jboss-osgi-deployers-vfs30:jar</include>
+ <include>*:jboss-vfs:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<scope>test</scope>
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/core/src/main/java/org/jboss/osgi/framework/plugins/internal/SystemPackagesPluginImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/core/src/main/java/org/jboss/osgi/framework/plugins/internal/SystemPackagesPluginImpl.java 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/core/src/main/java/org/jboss/osgi/framework/plugins/internal/SystemPackagesPluginImpl.java 2010-03-10 17:16:48 UTC (rev 102237)
@@ -90,7 +90,6 @@
allPackages.add("org.jboss.osgi.deployment.deployer");
allPackages.add("org.jboss.osgi.deployment.interceptor");
- allPackages.add("org.jboss.osgi.microcontainer");
String[] corePackages = OSGiCoreClassFilter.getCorePackages();
allPackageNames.addAll(Arrays.asList(corePackages));
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-03-10 17:16:48 UTC (rev 102237)
@@ -287,6 +287,11 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.vfs</groupId>
+ <artifactId>jboss-osgi-vfs21</artifactId>
+ <version>${version.jboss.osgi.vfs}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.vfs</groupId>
<artifactId>jboss-osgi-vfs30</artifactId>
<version>${version.jboss.osgi.vfs}</version>
</dependency>
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/pom.xml 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/pom.xml 2010-03-10 17:16:48 UTC (rev 102237)
@@ -41,9 +41,12 @@
<version>${version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi.deployers</groupId>
+ <artifactId>jboss-osgi-deployers-vfs21</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi.vfs</groupId>
<artifactId>jboss-osgi-vfs21</artifactId>
- <version>${version.jboss.osgi.vfs}</version>
</dependency>
</dependencies>
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/pom.xml 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/pom.xml 2010-03-10 17:16:48 UTC (rev 102237)
@@ -35,9 +35,12 @@
<version>${version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi.deployers</groupId>
+ <artifactId>jboss-osgi-deployers-vfs30</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi.vfs</groupId>
<artifactId>jboss-osgi-vfs30</artifactId>
- <version>${version.jboss.osgi.vfs}</version>
</dependency>
</dependencies>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-03-10 17:16:48 UTC (rev 102237)
@@ -30,6 +30,7 @@
org.jboss.beans.metadata.spi.builder;version=2.2,
org.jboss.dependency.spi;version=2.2,
org.jboss.kernel.spi.dependency;version=2.2,
+ org.jboss.vfs;version=3.0,
<!-- jboss-osgi -->
org.jboss.osgi.spi;version=1.0,
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-equinox.properties 2010-03-10 17:16:48 UTC (rev 102237)
@@ -30,11 +30,7 @@
org.jboss.osgi.spi.util;version=1.0, \
org.jboss.osgi.testing;version=1.0, \
org.jboss.osgi.vfs;version=1.0, \
- org.jboss.virtual;version=2.1, \
- org.jboss.virtual.plugins.registry;version=2.1, \
- org.jboss.virtual.plugins.context.jar;version=2.1, \
- org.jboss.virtual.plugins.vfs.helpers;version=2.1, \
- org.jboss.virtual.protocol;version=2.1, \
+ org.jboss.vfs;version=3.0, \
org.osgi.framework;version=1.5
# Bundles that need to be installed with the Framework automatically
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2010-03-10 17:16:48 UTC (rev 102237)
@@ -33,11 +33,7 @@
org.jboss.osgi.spi.util;version=1.0, \
org.jboss.osgi.testing;version=1.0, \
org.jboss.osgi.vfs;version=1.0, \
- org.jboss.virtual;version=2.1, \
- org.jboss.virtual.plugins.registry;version=2.1, \
- org.jboss.virtual.plugins.context.jar;version=2.1, \
- org.jboss.virtual.plugins.vfs.helpers;version=2.1, \
- org.jboss.virtual.protocol;version=2.1, \
+ org.jboss.vfs;version=3.0, \
org.osgi.framework;version=1.5
# Bundles that need to be installed with the Framework automatically
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-03-10 17:16:48 UTC (rev 102237)
@@ -30,6 +30,7 @@
org.jboss.beans.metadata.spi.builder;version=2.2,
org.jboss.dependency.spi;version=2.2,
org.jboss.kernel.spi.dependency;version=2.2,
+ org.jboss.vfs;version=3.0,
<!-- jboss-osgi -->
org.jboss.osgi.spi;version=1.0,
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties 2010-03-10 17:16:48 UTC (rev 102237)
@@ -27,10 +27,6 @@
org.jboss.osgi.spi.util;version=1.0, \
org.jboss.osgi.testing;version=1.0, \
org.jboss.osgi.vfs;version=1.0, \
- org.jboss.virtual;version=2.1, \
- org.jboss.virtual.plugins.registry;version=2.1, \
- org.jboss.virtual.plugins.context.jar;version=2.1, \
- org.jboss.virtual.plugins.vfs.helpers;version=2.1, \
- org.jboss.virtual.protocol;version=2.1, \
+ org.jboss.vfs;version=3.0, \
org.osgi.framework;version=1.5
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2010-03-10 17:16:48 UTC (rev 102237)
@@ -30,10 +30,6 @@
org.jboss.osgi.spi.util;version=1.0, \
org.jboss.osgi.testing;version=1.0, \
org.jboss.osgi.vfs;version=1.0, \
- org.jboss.virtual;version=2.1, \
- org.jboss.virtual.plugins.registry;version=2.1, \
- org.jboss.virtual.plugins.context.jar;version=2.1, \
- org.jboss.virtual.plugins.vfs.helpers;version=2.1, \
- org.jboss.virtual.protocol;version=2.1, \
+ org.jboss.vfs;version=3.0, \
org.osgi.framework;version=1.5
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2010-03-10 17:05:36 UTC (rev 102236)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2010-03-10 17:16:48 UTC (rev 102237)
@@ -403,7 +403,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.osgi.vfs</groupId>
- <artifactId>jboss-osgi-vfs21</artifactId>
+ <artifactId>jboss-osgi-vfs30</artifactId>
</dependency>
</dependencies>
</profile>
@@ -432,7 +432,7 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.vfs</groupId>
- <artifactId>jboss-osgi-vfs21</artifactId>
+ <artifactId>jboss-osgi-vfs30</artifactId>
</dependency>
</dependencies>
</profile>
14 years, 4 months
JBoss-OSGI SVN: r102231 - in projects/jboss-osgi/projects/runtime/framework/trunk: bundle and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-03-10 11:46:31 -0500 (Wed, 10 Mar 2010)
New Revision: 102231
Removed:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/ClassLoaderDomainUnitTestCase.java
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/core/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/pom.xml
Log:
Update to the latest stable kernel
Use jboss-vfs-3.0.x from now on
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml 2010-03-10 16:34:39 UTC (rev 102230)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/pom.xml 2010-03-10 16:46:31 UTC (rev 102231)
@@ -167,14 +167,19 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi.deployers</groupId>
+ <artifactId>jboss-osgi-deployers-vfs30</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs21</artifactId>
+ <artifactId>jboss-osgi-framework-vfs30</artifactId>
<version>${version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.osgi.vfs</groupId>
- <artifactId>jboss-osgi-vfs21</artifactId>
+ <artifactId>jboss-osgi-vfs30</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -312,7 +317,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs21</artifactId>
+ <artifactId>jboss-osgi-framework-vfs30</artifactId>
<version>${version}</version>
</dependency>
</dependencies>
@@ -333,7 +338,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.osgi.framework</groupId>
- <artifactId>jboss-osgi-framework-vfs21</artifactId>
+ <artifactId>jboss-osgi-framework-vfs30</artifactId>
<version>${version}</version>
</dependency>
</dependencies>
Deleted: projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/ClassLoaderDomainUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/ClassLoaderDomainUnitTestCase.java 2010-03-10 16:34:39 UTC (rev 102230)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/classloader/ClassLoaderDomainUnitTestCase.java 2010-03-10 16:46:31 UTC (rev 102231)
@@ -1,112 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.osgi.classloader;
-
-// $Id$
-
-import static org.junit.Assert.fail;
-
-import java.net.URL;
-
-import org.jboss.classloader.plugins.jdk.AbstractJDKChecker;
-import org.jboss.classloader.plugins.system.DefaultClassLoaderSystem;
-import org.jboss.classloader.spi.ClassLoaderDomain;
-import org.jboss.classloader.spi.ClassLoaderPolicy;
-import org.jboss.classloader.spi.ClassLoaderSystem;
-import org.jboss.classloader.spi.ParentPolicy;
-import org.jboss.classloader.spi.filter.ClassFilterUtils;
-import org.jboss.classloader.spi.filter.PackageClassFilter;
-import org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy;
-import org.jboss.logging.Logger;
-import org.jboss.osgi.framework.bundle.OSGiBundleManager;
-import org.jboss.osgi.testing.OSGiTestHelper;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-/**
- * ClassLoaderDomainUnitTestCase.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 03-Sep-2009
- */
-public class ClassLoaderDomainUnitTestCase
-{
- private static final String OSGI_CLASSLOADER_DOMAIN = "OSGiDomain";
- private ClassLoaderSystem classLoaderSystem;
-
- @Before
- public void setUp()
- {
- classLoaderSystem = new DefaultClassLoaderSystem();
- AbstractJDKChecker.getExcluded().add(getClass());
- }
-
- @Test
- public void testSystemPolicy() throws Exception
- {
- ClassLoaderDomain domain = new ClassLoaderDomain(OSGI_CLASSLOADER_DOMAIN);
- classLoaderSystem.registerDomain(domain);
-
- // Setup the class filter
- String filteredPackages = Logger.class.getPackage().getName();
- PackageClassFilter classFilter = PackageClassFilter.createPackageClassFilterFromString(filteredPackages);
- classFilter.setIncludeJava(true);
-
- domain.setParentPolicy(new ParentPolicy(classFilter, ClassFilterUtils.NOTHING));
-
- URL coreURL = new OSGiTestHelper().getTestArchiveURL("bundles/org.osgi.core.jar");
- VirtualFile coreVF = VFS.createNewRoot(coreURL);
-
- ClassLoaderPolicy systemPolicy = new VFSClassLoaderPolicy("OSGiSystemPolicy", new VirtualFile[] { coreVF });
- ClassLoader classLoader = classLoaderSystem.registerClassLoaderPolicy(OSGI_CLASSLOADER_DOMAIN, systemPolicy);
-
- // Load JDK class
- assertLoadClass(classLoader, String.class.getName(), true);
-
- // Load from org.osgi.core
- assertLoadClass(classLoader, Bundle.class.getName(), true);
-
- // Load from system classpath
- assertLoadClass(classLoader, Logger.class.getName(), true);
-
- // No access to implementation
- assertLoadClass(classLoader, OSGiBundleManager.class.getName(), false);
- }
-
- private void assertLoadClass(ClassLoader classLoader, String name, boolean success)
- {
- try
- {
- classLoader.loadClass(name);
- if (success == false)
- fail("Expected ClassNotFoundException for '" + name + "' from " + classLoader);
- }
- catch (ClassNotFoundException ex)
- {
- if (success)
- fail("Cannot load '" + name + "' from " + classLoader);
- }
- }
-}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/core/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/core/pom.xml 2010-03-10 16:34:39 UTC (rev 102230)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/core/pom.xml 2010-03-10 16:46:31 UTC (rev 102231)
@@ -140,10 +140,6 @@
<artifactId>jboss-osgi-spi</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.deployers</groupId>
- <artifactId>jboss-osgi-deployers-vfs21</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-deployment</artifactId>
</dependency>
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-03-10 16:34:39 UTC (rev 102230)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-03-10 16:46:31 UTC (rev 102231)
@@ -11,7 +11,12 @@
<!-- $Id$ -->
-<!-- Set these VM properties in your IDE debugger -Dlog4j.output.dir=${workspace_loc:jboss-osgi-framework/target} -Dlog4j.configuration=log4j-console.xml -->
+<!--
+ Set these VM properties in your IDE debugger
+
+ -Dlog4j.output.dir=${workspace_loc:jboss-osgi-framework/target}
+ -Dlog4j.configuration=log4j-console.xml
+-->
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -41,11 +46,11 @@
<version.apache.felix.configadmin>1.0.10</version.apache.felix.configadmin>
<version.apache.felix.log>1.0.0</version.apache.felix.log>
<version.apache.felix.metatype>1.0.2</version.apache.felix.metatype>
- <version.jboss.classloading>2.2.0.Alpha1</version.jboss.classloading>
- <version.jboss.deployers>2.2.0.Alpha1</version.jboss.deployers>
- <version.jboss.kernel>2.2.0.Alpha5</version.jboss.kernel>
- <version.jboss.logging>2.1.0.GA</version.jboss.logging>
- <version.jboss.mdr>2.2.0.Alpha1</version.jboss.mdr>
+ <version.jboss.classloading>2.2.0.Alpha3</version.jboss.classloading>
+ <version.jboss.deployers>2.2.0.Alpha3</version.jboss.deployers>
+ <version.jboss.kernel>2.2.0.Alpha8</version.jboss.kernel>
+ <version.jboss.logging>2.2.0.CR1</version.jboss.logging>
+ <version.jboss.mdr>2.2.0.Alpha2</version.jboss.mdr>
<version.jboss.osgi.apache.xerces>2.9.1.SP3</version.jboss.osgi.apache.xerces>
<version.jboss.osgi.common>1.0.3</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
@@ -282,7 +287,7 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.vfs</groupId>
- <artifactId>jboss-osgi-vfs21</artifactId>
+ <artifactId>jboss-osgi-vfs30</artifactId>
<version>${version.jboss.osgi.vfs}</version>
</dependency>
</dependencies>
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/pom.xml 2010-03-10 16:34:39 UTC (rev 102230)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/vfs21/pom.xml 2010-03-10 16:46:31 UTC (rev 102231)
@@ -29,6 +29,8 @@
<!-- Properties -->
<properties>
+ <version.jboss.classloading>2.2.0.Alpha1</version.jboss.classloading>
+ <version.jboss.deployers>2.2.0.Alpha1</version.jboss.deployers>
</properties>
<!-- Dependencies -->
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/pom.xml 2010-03-10 16:34:39 UTC (rev 102230)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/vfs30/pom.xml 2010-03-10 16:46:31 UTC (rev 102231)
@@ -27,12 +27,6 @@
<version>1.0.0.Alpha4-SNAPSHOT</version>
</parent>
- <!-- Properties -->
- <properties>
- <version.jboss.classloading>2.2.0.Alpha3</version.jboss.classloading>
- <version.jboss.deployers>2.2.0.Alpha3</version.jboss.deployers>
- </properties>
-
<!-- Dependencies -->
<dependencies>
<dependency>
14 years, 4 months