[jboss-osgi-commits] JBoss-OSGI SVN: r88417 - in projects/jboss-osgi/trunk: spi/src/main/java/org/jboss/osgi/spi/service and 17 other directories.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Fri May 8 03:50:43 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-05-08 03:50:42 -0400 (Fri, 08 May 2009)
New Revision: 88417
Added:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.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/service/startlevel/StartLevelTestCase.java
Removed:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/microcontainer/MicrocontainerService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/microcontainer/internal/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/microcontainer/package.html
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/package.html
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37RemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java
Modified:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteBundleBadName.java
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
Log:
Migrate tests - done (WIP)
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/microcontainer/MicrocontainerService.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/microcontainer/MicrocontainerService.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/microcontainer/MicrocontainerService.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,53 +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.spi.service.microcontainer;
-
-//$Id$
-
-import javax.management.MBeanServer;
-
-import org.jboss.kernel.Kernel;
-
-/**
- * An OSGi Service the gives access to the Kernel and MBeanServer.
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
- at Deprecated
-public interface MicrocontainerService
-{
- /**
- * Get the Microcontainer Kernel
- */
- Kernel getKernel();
-
- /**
- * Get MBeanServer
- */
- MBeanServer getMbeanServer();
-
- /**
- * Get a registered bean from the Kernel.
- */
- Object getRegisteredBean(String beanName);
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/microcontainer/package.html
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/microcontainer/package.html 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/microcontainer/package.html 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,5 +0,0 @@
-<html>
-<body>
-Provides access to the Kernel and MBeanServer.
-</body>
-</html>
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/package.html
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/package.html 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/package.html 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,5 +0,0 @@
-<html>
-<body>
-A collection of SPI provided services.
-</body>
-</html>
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -31,13 +31,17 @@
*/
public abstract class AbstractBundle
{
+ public abstract long getBundleId();
+
+ public abstract String getSymbolicName();
+
+ public abstract int getState();
+
+ public abstract String getProperty(String key);
+
public abstract void start() throws BundleException;
public abstract void stop() throws BundleException;
public abstract void uninstall() throws BundleException;
-
- public abstract int getState();
-
- public abstract String getSymbolicName();
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -45,32 +45,44 @@
}
@Override
- public void start() throws BundleException
+ public int getState()
{
- bundle.start();
+ return bundle.getState();
}
@Override
- public void stop() throws BundleException
+ public String getSymbolicName()
{
- bundle.stop();
+ return bundle.getSymbolicName();
}
@Override
- public void uninstall() throws BundleException
+ public long getBundleId()
{
- bundle.uninstall();
+ return bundle.getBundleId();
}
@Override
- public int getState()
+ public String getProperty(String key)
{
- return bundle.getState();
+ return bundle.getBundleContext().getProperty(key);
}
@Override
- public String getSymbolicName()
+ public void start() throws BundleException
{
- return bundle.getSymbolicName();
+ bundle.start();
}
+
+ @Override
+ public void stop() throws BundleException
+ {
+ bundle.stop();
+ }
+
+ @Override
+ public void uninstall() throws BundleException
+ {
+ bundle.uninstall();
+ }
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -36,6 +36,14 @@
*/
public interface OSGiRuntime
{
+ void addCapability(Capability capability) throws BundleException;
+
+ void removeCapability(Capability capability);
+
+ void startLogEntryTracking(LogEntryCache logEntryCache);
+
+ void stopLogEntryTracking();
+
AbstractBundle installBundle(String location) throws BundleException;
void deploy(String location) throws Exception;
@@ -44,10 +52,6 @@
AbstractBundle[] getBundles();
- void addCapability(Capability capability) throws BundleException;
-
- void removeCapability(Capability capability);
-
AbstractPackageAdmin getPackageAdmin();
InitialContext getInitialContext() throws NamingException;
@@ -56,9 +60,5 @@
String getServerHost();
- void startLogEntryTracking(LogEntryCache logEntryCache);
-
- void stopLogEntryTracking();
-
void shutdown();
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteBundleBadName.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteBundleBadName.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteBundleBadName.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -48,6 +48,30 @@
}
@Override
+ public int getState()
+ {
+ return bundle.getState();
+ }
+
+ @Override
+ public String getSymbolicName()
+ {
+ return bundle.getSymbolicName();
+ }
+
+ @Override
+ public long getBundleId()
+ {
+ return bundle.getBundleId();
+ }
+
+ @Override
+ public String getProperty(String key)
+ {
+ return bundle.getProperty(key);
+ }
+
+ @Override
public void start() throws BundleException
{
bundle.start();
@@ -75,16 +99,4 @@
log.error("Cannot uninstall: " + location);
}
}
-
- @Override
- public int getState()
- {
- return bundle.getState();
- }
-
- @Override
- public String getSymbolicName()
- {
- return bundle.getSymbolicName();
- }
}
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml 2009-05-08 07:50:42 UTC (rev 88417)
@@ -48,9 +48,6 @@
<!-- example/log -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-log.jar" files="${tests.resources.dir}/example/log/example-log.bnd" />
- <!-- example/microcontainer -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-microcontainer.jar" files="${tests.resources.dir}/example/microcontainer/example-microcontainer.bnd" />
-
<!-- Please add alphabetically -->
</target>
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,111 +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.test.osgi.example.http;
-
-//$Id: HttpServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-
-import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.ConfigAdminCapability;
-import org.jboss.osgi.spi.testing.HttpCapability;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestSetup;
-
-import junit.framework.Test;
-
-/**
- * A test that deployes a bundle that containes a HttpServlet which
- * is registered through the OSGi HttpService
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public class HttpServiceRemoteTestCase extends OSGiTest
-{
- private static OSGiRuntime runtime;
- private static AbstractBundle testBundle;
-
- public static Test suite()
- {
- OSGiTestSetup testSetup = new OSGiTestSetup(HttpServiceRemoteTestCase.class)
- {
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- runtime = getDefaultRuntime();
- runtime.addCapability(new ConfigAdminCapability());
- runtime.addCapability(new HttpCapability());
- Thread.sleep(500);
- testBundle = runtime.installBundle("example/example-http.jar");
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- testBundle.uninstall();
- runtime.shutdown();
- super.tearDown();
- }
- };
- return testSetup;
- }
-
- public void testServletAccess() throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=plain");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("Hello from Servlet", br.readLine());
- }
-
- public void testServletInitProps() throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=initProp");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("initProp=SomeValue", br.readLine());
- }
-
- public void testServletBundleContext() throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=context");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("example-http", br.readLine());
- }
-
- public void testServletStartLevel() throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=startLevel");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("startLevel=1", br.readLine());
- }
-
- public void testResourceAccess() throws Exception
- {
- URL url = new URL("http://" + runtime.getServerHost() + ":8090/file/message.txt");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("Hello from Resource", br.readLine());
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java (from rev 88408, projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -0,0 +1,111 @@
+/*
+ * 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.example.http;
+
+//$Id: HttpServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.ConfigAdminCapability;
+import org.jboss.osgi.spi.testing.HttpCapability;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestSetup;
+
+import junit.framework.Test;
+
+/**
+ * A test that deployes a bundle that containes a HttpServlet which
+ * is registered through the OSGi HttpService
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public class HttpServiceTestCase extends OSGiTest
+{
+ private static OSGiRuntime runtime;
+ private static AbstractBundle testBundle;
+
+ public static Test suite()
+ {
+ OSGiTestSetup testSetup = new OSGiTestSetup(HttpServiceTestCase.class)
+ {
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ runtime = getDefaultRuntime();
+ runtime.addCapability(new ConfigAdminCapability());
+ runtime.addCapability(new HttpCapability());
+ Thread.sleep(500);
+ testBundle = runtime.installBundle("example/example-http.jar");
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ testBundle.uninstall();
+ runtime.shutdown();
+ super.tearDown();
+ }
+ };
+ return testSetup;
+ }
+
+ public void testServletAccess() throws Exception
+ {
+ URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=plain");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("Hello from Servlet", br.readLine());
+ }
+
+ public void testServletInitProps() throws Exception
+ {
+ URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=initProp");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("initProp=SomeValue", br.readLine());
+ }
+
+ public void testServletBundleContext() throws Exception
+ {
+ URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=context");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("example-http", br.readLine());
+ }
+
+ public void testServletStartLevel() throws Exception
+ {
+ URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=startLevel");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("startLevel=1", br.readLine());
+ }
+
+ public void testResourceAccess() throws Exception
+ {
+ URL url = new URL("http://" + runtime.getServerHost() + ":8090/file/message.txt");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("Hello from Resource", br.readLine());
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,82 +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.test.osgi.example.log;
-
-//$Id: LogServiceRemoteTestCase.java 87339 2009-04-15 12:23:20Z thomas.diesler at jboss.com $
-
-import java.util.List;
-
-import org.jboss.osgi.spi.framework.RemoteBundle;
-import org.jboss.osgi.spi.junit.IntegrationTest;
-import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.logging.LogEntryFilter;
-import org.jboss.osgi.spi.logging.RemoteLogReaderService;
-import org.osgi.framework.Bundle;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogService;
-
-/**
- * This example demonstrates the usage of the {@link RemoteLogReaderService}
- *
- * @author thomas.diesler at jboss.com
- * @since 09-Apr-2009
- */
-public class LogServiceRemoteTestCase extends IntegrationTest
-{
- private LogEntryCache logEntryCache;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- logEntryCache = new LogEntryCache(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
- startRemoteLogEntryTracking(logEntryCache);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- stopRemoteLogEntryTracking();
- super.tearDown();
- }
-
- public void testServiceA() throws Exception
- {
- // Deploy the test bundle
- RemoteBundle bundleA = deployBundle("example/example-log.jar");
-
- // Verify that the bundle is active
- assertEquals("Remote bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
-
- // Wait a little for the asynchronous log entry to arrive
- Thread.sleep(200);
-
- // Undeploy the test bundle
- undeployBundle("example/example-log.jar");
-
- // Verify the received log entries
- List<LogEntry> entries = logEntryCache.getLog();
- assertEquals("Number of entries", 1, entries.size());
- assertEquals("[ServiceA] new Service", entries.get(0).getMessage());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,52 +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.test.osgi.example.microcontainer;
-
-//$Id: MBeanServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
-
-import junit.framework.Test;
-
-import org.jboss.osgi.spi.junit.IntegrationTest;
-import org.jboss.osgi.spi.junit.IntegrationTestSetup;
-import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.test.osgi.example.microcontainer.bundle.FooMBean;
-import org.jboss.test.osgi.example.microcontainer.bundle.MBeanTestService;
-
-/**
- * A test that deployes a bundle that registeres an MBean
- *
- * @author thomas.diesler at jboss.com
- * @since 12-Feb-2009
- */
-public class MBeanServiceRemoteTestCase extends IntegrationTest
-{
- public static Test suite()
- {
- return new IntegrationTestSetup(MBeanServiceRemoteTestCase.class, "example/example-microcontainer.jar");
- }
-
- public void testMBeanAccess() throws Exception
- {
- FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, MBeanTestService.OBJECT_NAME, getMBeanServerConnection());
- assertEquals("hello", foo.echo("hello"));
- }
-}
\ No newline at end of file
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 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-05-08 07:50:42 UTC (rev 88417)
@@ -8,8 +8,13 @@
org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
# Properties to configure the Framework
+org.osgi.framework.storage=${basedir}/target/osgi-store
org.osgi.framework.storage.clean=onFirstInit
+
+# Framework bootdelegation
org.osgi.framework.bootdelegation=org.osgi.service.log
+
+# Extra System Packages
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
org.jboss.net.protocol, \
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-05-08 07:50:42 UTC (rev 88417)
@@ -46,6 +46,11 @@
<!-- Bundle Dependencies -->
<dependency>
<groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.configadmin</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.http.jetty</artifactId>
<scope>provided</scope>
</dependency>
@@ -55,6 +60,11 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.metatype</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-05-08 07:50:42 UTC (rev 88417)
@@ -15,7 +15,6 @@
<outputDirectory>bundles</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>*:org.apache.felix.http.jetty:jar</include>
<include>*:apache-xerces-bundle:jar</include>
<include>*:jaxb-bundle:jar</include>
<include>*:jboss-common-core-bundle:jar</include>
@@ -26,7 +25,10 @@
<include>*:jboss-osgi-microcontainer:jar</include>
<include>*:jboss-osgi-remotelog:jar</include>
<include>*:jbossxb-bundle:jar</include>
+ <include>*:org.apache.felix.configadmin:jar</include>
+ <include>*:org.apache.felix.http.jetty:jar</include>
<include>*:org.apache.felix.log:jar</include>
+ <include>*:org.apache.felix.metatype:jar</include>
<include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37RemoteTestCase.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37RemoteTestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,66 +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.test.osgi.jbosgi37;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.osgi.spi.framework.RemoteBundle;
-import org.jboss.osgi.spi.junit.IntegrationTest;
-import org.osgi.framework.Bundle;
-
-/**
- * [JBOSGI-37] Prevent creation of deployment unit for nested jars
- *
- * https://jira.jboss.org/jira/browse/JBOSGI-37
- *
- * @author thomas.diesler at jboss.com
- * @since 09-Apr-2009
- */
-public class OSGI37RemoteTestCase extends IntegrationTest
-{
- public void testNestedBundle() throws Exception
- {
- RemoteBundle bundleA = deployBundle("jbosgi37-bundleA.jar");
- try
- {
- assertEquals("Bundle started", Bundle.ACTIVE, bundleA.getState());
-
- List<String> relevant = new ArrayList<String>();
- for (RemoteBundle bundle : getRemoteFramework().getBundles())
- {
- String symbolicName = bundle.getSymbolicName();
- if (symbolicName.startsWith("jbosgi37"))
- relevant.add(symbolicName);
- }
-
- assertEquals("No Sub Bundle", 1, relevant.size());
- assertEquals("jbosgi37-bundleA", relevant.get(0));
- }
- finally
- {
- undeployBundle("jbosgi37-bundleA.jar");
- }
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,131 +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.test.osgi.jbosgi38;
-
-//$Id: OSGI38RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler at jboss.com $
-
-import org.jboss.osgi.spi.framework.RemoteBundle;
-import org.jboss.osgi.spi.junit.IntegrationTest;
-import org.osgi.framework.Bundle;
-
-/**
- * [JBOSGI-38] Investigate bundle install/start behaviour with random deployment order
- *
- * https://jira.jboss.org/jira/browse/JBOSGI-38
- *
- * Bundle A depends on bundle B, both share bundle X.
- *
- * A ---> B
- * A ---> X <--- B
- *
- * @author thomas.diesler at jboss.com
- * @since 02-Mar-2009
- */
-public class OSGI38RemoteTestCase extends IntegrationTest
-{
- /*
- * Install/Start the common bundle
- */
- public void testInstallStartX() throws Exception
- {
- RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
-
- assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
-
- undeployBundle("jbosgi38-bundleX.jar");
- }
-
- /*
- * Install X, B
- */
- public void testInstallXBeforeB() throws Exception
- {
- RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
- RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
-
- assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
- assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-
- undeployBundle("jbosgi38-bundleB.jar");
- undeployBundle("jbosgi38-bundleX.jar");
- }
-
- /*
- * Install X, B, A
- */
- public void testInstallBBeforeA() throws Exception
- {
- RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
- RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
- RemoteBundle bundleA = deployBundle("jbosgi38-bundleA.jar");
-
- assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
- assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
- assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
-
- undeployBundle("jbosgi38-bundleA.jar");
- undeployBundle("jbosgi38-bundleB.jar");
- undeployBundle("jbosgi38-bundleX.jar");
- }
-
- /*
- * Install B, X
- */
- public void testInstallBBeforeX() throws Exception
- {
- RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
-
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
- RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
-
- assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
- assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-
- undeployBundle("jbosgi38-bundleB.jar");
- undeployBundle("jbosgi38-bundleX.jar");
- }
-
- /*
- * Install A, B, X
- */
- public void testInstallABeforeB() throws Exception
- {
- RemoteBundle bundleA = deployBundle("jbosgi38-bundleA.jar");
-
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
-
- RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
-
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
- RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
-
- assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
- assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
- assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
-
- undeployBundle("jbosgi38-bundleA.jar");
- undeployBundle("jbosgi38-bundleB.jar");
- undeployBundle("jbosgi38-bundleX.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,104 +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.test.osgi.jbosgi39;
-
-//$Id: OSGI39RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler at jboss.com $
-
-import org.jboss.osgi.spi.framework.RemoteBundle;
-import org.jboss.osgi.spi.junit.IntegrationTest;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-/**
- * [JBOSGI-39] Bundle gets wired to an already uninstalled bundle
- *
- * https://jira.jboss.org/jira/browse/JBOSGI-39
- *
- * Bundle B depends on bundle X.
- *
- * B ---> X
- *
- * @author thomas.diesler at jboss.com
- * @since 04-Mar-2009
- */
-public class OSGI39RemoteTestCase extends IntegrationTest
-{
- public void testVerifyUnresolved() throws Exception
- {
- RemoteBundle bundleB = deployBundle("jbosgi39-bundleB.jar");
-
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
- try
- {
- bundleB.start();
- fail("Unresolved constraint expected");
- }
- catch (BundleException ex)
- {
- // expected
- }
-
- RemoteBundle bundleX = deployBundle("jbosgi39-bundleX.jar");
-
- assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
- assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-
- undeployBundle("jbosgi39-bundleB.jar");
- undeployBundle("jbosgi39-bundleX.jar");
- }
-
- /*
- * 4.3.11 Uninstalling Bundles
- *
- * Once this method returns, the state of the OSGi Service Platform must be the same as if the bundle had never been installed, unless:
- *
- * - The uninstalled bundle has exported any packages (via its Export-Package manifest header)
- * - The uninstalled bundle was selected by the Framework as the exporter of these packages.
- *
- * If none of the old exports are used, then the old exports must be removed. Otherwise, all old exports must remain available
- * for existing bundles and future resolves until the refreshPackages method is called or the Framework is restarted.
- */
- public void testWiringToUninstalled() throws Exception
- {
- RemoteBundle bundleX = deployBundle("jbosgi39-bundleX.jar");
- RemoteBundle bundleB = deployBundle("jbosgi39-bundleB.jar");
-
- bundleB.start();
-
- assertEquals("Bundle resolved", Bundle.ACTIVE, bundleX.getState());
- assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-
- // Undeploy X before B
- undeployBundle("jbosgi39-bundleX.jar");
- undeployBundle("jbosgi39-bundleB.jar");
-
- // Install B without X
- bundleB = deployBundle("jbosgi39-bundleB.jar");
-
- bundleB.start();
-
- assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-
- undeployBundle("jbosgi39-bundleB.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,67 +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.test.osgi.jbosgi41;
-
-//$Id: OSGI41RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler at jboss.com $
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-
-import org.jboss.osgi.spi.framework.RemoteBundle;
-import org.jboss.osgi.spi.junit.IntegrationTest;
-import org.osgi.framework.Bundle;
-
-/**
- * [JBOSGI-41] Verify persistent file storage
- *
- * https://jira.jboss.org/jira/browse/JBOSGI-41
- *
- * @author thomas.diesler at jboss.com
- * @since 05-Mar-2009
- */
-public class OSGI41RemoteTestCase extends IntegrationTest
-{
- public void testFirstRun() throws Exception
- {
- RemoteBundle bundleA = deployBundle("jbosgi41-bundleA.jar");
- assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
-
- File dataFile = getBundleDataFile(bundleA, "config/jbosgi41.txt");
- assertTrue("File exists: " + dataFile, dataFile.exists());
-
- BufferedReader br = new BufferedReader(new FileReader(dataFile));
- String symbolicName = br.readLine();
- assertEquals("jbosgi41-bundleA", symbolicName);
-
- undeployBundle("jbosgi41-bundleA.jar");
- }
-
- private File getBundleDataFile(RemoteBundle bundleA, String filename)
- {
- String storageRoot = bundleA.getProperty("org.osgi.framework.storage");
- assertNotNull("Storage dir not null", storageRoot);
-
- File dataFile = new File(storageRoot + "/bundle" + bundleA.getBundleId() + "/data/" + filename);
- return dataFile;
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java (from rev 88408, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -0,0 +1,80 @@
+/*
+ * 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.jbosgi41;
+
+//$Id: OSGI41RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler at jboss.com $
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.ConfigAdminCapability;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * [JBOSGI-41] Verify persistent file storage
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-41
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 05-Mar-2009
+ */
+public class OSGI41TestCase extends OSGiTest
+{
+ public void testFirstRun() throws Exception
+ {
+ OSGiRuntime runtime = getDefaultRuntime();
+ try
+ {
+ runtime.addCapability(new ConfigAdminCapability());
+
+ AbstractBundle bundleA = runtime.installBundle("jbosgi41-bundleA.jar");
+ bundleA.start();
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+
+ File dataFile = getBundleDataFile(bundleA, "config/jbosgi41.txt");
+ assertTrue("File exists: " + dataFile, dataFile.exists());
+
+ BufferedReader br = new BufferedReader(new FileReader(dataFile));
+ assertEquals("jbosgi41-bundleA", br.readLine());
+
+ bundleA.uninstall();
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ private File getBundleDataFile(AbstractBundle bundleA, String filename)
+ {
+ String storageRoot = bundleA.getProperty("org.osgi.framework.storage");
+ assertNotNull("Storage dir not null", storageRoot);
+
+ File dataFile = new File(storageRoot + "/bundle" + bundleA.getBundleId() + "/data/" + filename);
+ return dataFile;
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -28,7 +28,9 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
/**
* ServiceA writes a file
@@ -38,21 +40,25 @@
*/
public class ServiceA
{
+ private LogService log;
+
ServiceA(BundleContext context)
{
+ log = new LogServiceTracker(context);
+
context.getDataFile("config").mkdirs();
File dataFile = context.getDataFile("config/jbosgi41.txt");
try
{
- System.out.println("dataFile: " + dataFile);
+ log.log(LogService.LOG_INFO, "dataFile: " + dataFile);
OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(dataFile));
out.write(context.getBundle().getSymbolicName());
out.close();
}
catch (IOException ex)
{
- ex.printStackTrace(System.err);
+ log.log(LogService.LOG_ERROR, "Cannot write data file", ex);
}
}
}
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -27,12 +27,14 @@
import java.util.Dictionary;
import java.util.Hashtable;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.Configuration;
import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
+import org.osgi.service.log.LogService;
import org.osgi.util.tracker.ServiceTracker;
/**
@@ -44,17 +46,18 @@
public class ServiceB implements ManagedService
{
private ConfigurationAdmin configAdmin;
+ private LogService log;
ServiceB(BundleContext context)
{
- System.out.println("ServiceB");
+ log = new LogServiceTracker(context);
ServiceTracker tracker = new ServiceTracker(context, ConfigurationAdmin.class.getName(), null)
{
@Override
public Object addingService(ServiceReference sref)
{
- System.out.println("addingService");
+ log.log(LogService.LOG_INFO, "addingService ConfigurationAdmin");
configAdmin = (ConfigurationAdmin)super.addingService(sref);
return configAdmin;
}
@@ -65,7 +68,7 @@
@SuppressWarnings("unchecked")
public void updateConfig(String key, String value)
{
- System.out.println("updateConfig");
+ log.log(LogService.LOG_INFO, "updateConfig");
if (configAdmin != null)
{
try
@@ -81,7 +84,7 @@
config.update(props);
Configuration[] configs = configAdmin.listConfigurations(null);
- System.out.println(Arrays.asList(configs));
+ log.log(LogService.LOG_DEBUG, Arrays.asList(configs).toString());
}
catch (Exception ex)
{
@@ -93,6 +96,6 @@
@SuppressWarnings("unchecked")
public void updated(Dictionary props) throws ConfigurationException
{
- System.out.println("updated: " + props);
+ log.log(LogService.LOG_INFO, "updated: " + props);
}
}
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -1,46 +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.test.osgi.service.startlevel;
-
-//$Id: StartLevelRemoteTestCase.java 87336 2009-04-15 11:31:26Z thomas.diesler at jboss.com $
-
-import org.jboss.osgi.spi.framework.RemoteBundle;
-import org.jboss.osgi.spi.junit.IntegrationTest;
-import org.osgi.framework.Bundle;
-
-/**
- * Deploy a bundle that accesses the StartLevel service
- *
- * @author thomas.diesler at jboss.com
- * @since 04-Mar-2009
- */
-public class StartLevelRemoteTestCase extends IntegrationTest
-{
- public void testStartLevel() throws Exception
- {
- RemoteBundle bundle = deployBundle("service/service-startlevel.jar");
-
- assertEquals("Bundle active", Bundle.ACTIVE, bundle.getState());
-
- undeployBundle("service/service-startlevel.jar");
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java (from rev 88408, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java 2009-05-08 07:50:42 UTC (rev 88417)
@@ -0,0 +1,56 @@
+/*
+ * 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.service.startlevel;
+
+//$Id: StartLevelRemoteTestCase.java 87336 2009-04-15 11:31:26Z thomas.diesler at jboss.com $
+
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * Deploy a bundle that accesses the StartLevel service
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 04-Mar-2009
+ */
+public class StartLevelTestCase extends OSGiTest
+{
+ public void testStartLevel() throws Exception
+ {
+ OSGiRuntime runtime = getDefaultRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.installBundle("service/service-startlevel.jar");
+ bundle.start();
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundle.getState());
+
+ bundle.uninstall();
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+}
\ No newline at end of file
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 2009-05-08 07:17:10 UTC (rev 88416)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-05-08 07:50:42 UTC (rev 88417)
@@ -8,8 +8,13 @@
org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
# Properties to configure the Framework
+org.osgi.framework.storage=${basedir}/target/osgi-store
org.osgi.framework.storage.clean=onFirstInit
+
+# Framework bootdelegation
org.osgi.framework.bootdelegation=org.osgi.service.log
+
+# Extra System Packages
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
org.jboss.osgi.spi, \
More information about the jboss-osgi-commits
mailing list