JBoss-OSGI SVN: r89390 - projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-25 15:48:26 -0400 (Mon, 25 May 2009)
New Revision: 89390
Modified:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java
Log:
Migrate to JUnit4
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 2009-05-25 19:45:19 UTC (rev 89389)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java 2009-05-25 19:48:26 UTC (rev 89390)
@@ -23,6 +23,10 @@
//$Id: OSGI41RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler(a)jboss.com $
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
@@ -31,6 +35,7 @@
import org.jboss.osgi.spi.testing.ConfigAdminCapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.framework.Bundle;
/**
@@ -43,6 +48,7 @@
*/
public class OSGI41TestCase extends OSGiTest
{
+ @Test
public void testFirstRun() throws Exception
{
OSGiRuntime runtime = getDefaultRuntime();
17 years, 2 months
JBoss-OSGI SVN: r89389 - in projects/jboss-osgi/trunk/testsuite: example/src/test/java/org/jboss/test/osgi/example/http and 10 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-25 15:45:19 -0400 (Mon, 25 May 2009)
New Revision: 89389
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/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/log/LogServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.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/bootstrap/BundleTestCase.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/jbossas/jbosgi36/OSGI36TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Migrate to JUnit4
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 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -23,6 +23,8 @@
//$Id: HttpServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler(a)jboss.com $
+import static org.junit.Assert.assertEquals;
+
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
@@ -32,13 +34,13 @@
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 org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
-import junit.framework.Test;
-
/**
- * A test that deployes a bundle that containes a HttpServlet which
- * is registered through the OSGi HttpService
+ * A test that deployes a bundle that containes a HttpServlet which is registered through the OSGi HttpService
*
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
@@ -47,36 +49,28 @@
{
private static OSGiRuntime runtime;
private static AbstractBundle testBundle;
-
- public static Test suite()
+
+ @BeforeClass
+ public static void setUpClass() throws Exception
{
- 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(2000);
-
- testBundle = runtime.installBundle("example-http.jar");
- testBundle.start();
- }
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new ConfigAdminCapability());
+ runtime.addCapability(new HttpCapability());
- @Override
- protected void tearDown() throws Exception
- {
- testBundle.uninstall();
- runtime.shutdown();
- super.tearDown();
- }
- };
- return testSetup;
+ Thread.sleep(2000);
+
+ testBundle = runtime.installBundle("example-http.jar");
+ testBundle.start();
}
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ testBundle.uninstall();
+ runtime.shutdown();
+ }
+
+ @Test
public void testServletAccess() throws Exception
{
URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=plain");
@@ -84,6 +78,7 @@
assertEquals("Hello from Servlet", br.readLine());
}
+ @Test
public void testServletInitProps() throws Exception
{
URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=initProp");
@@ -91,6 +86,7 @@
assertEquals("initProp=SomeValue", br.readLine());
}
+ @Test
public void testServletBundleContext() throws Exception
{
URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=context");
@@ -98,6 +94,7 @@
assertEquals("example-http", br.readLine());
}
+ @Test
public void testServletStartLevel() throws Exception
{
URL url = new URL("http://" + runtime.getServerHost() + ":8090/servlet?test=startLevel");
@@ -105,6 +102,7 @@
assertEquals("startLevel=1", br.readLine());
}
+ @Test
public void testResourceAccess() throws Exception
{
URL url = new URL("http://" + runtime.getServerHost() + ":8090/file/message.txt");
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 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -21,22 +21,25 @@
*/
package org.jboss.test.osgi.example.jmx;
-//$Id: JMXTestCase.java 88356 2009-05-07 13:13:26Z thomas.diesler(a)jboss.com $
+//$Id$
+import static org.junit.Assert.assertEquals;
+
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.naming.InitialContext;
-import junit.framework.Test;
-
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.JMXCapability;
import org.jboss.osgi.spi.testing.JNDICapability;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestSetup;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.test.osgi.example.jmx.bundle.FooMBean;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
/**
* A test that deployes a bundle that registeres an MBean
@@ -49,33 +52,25 @@
private static OSGiRuntime runtime;
private static AbstractBundle bundle;
- public static Test suite()
+ @BeforeClass
+ public static void setUpClass() throws Exception
{
- OSGiTestSetup setup = new OSGiTestSetup(JMXTestCase.class)
- {
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- runtime = getDefaultRuntime();
- runtime.addCapability(new JNDICapability());
- runtime.addCapability(new JMXCapability());
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new JNDICapability());
+ runtime.addCapability(new JMXCapability());
- bundle = runtime.installBundle("example-jmx.jar");
- bundle.start();
- }
+ bundle = runtime.installBundle("example-jmx.jar");
+ bundle.start();
+ }
- @Override
- protected void tearDown() throws Exception
- {
- bundle.uninstall();
- runtime.shutdown();
- super.tearDown();
- }
- };
- return setup;
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ bundle.uninstall();
+ runtime.shutdown();
}
+ @Test
public void testMBeanAccess() throws Exception
{
ObjectName oname = new ObjectName("jboss.osgi:service=mbean-test-service");
@@ -83,6 +78,7 @@
assertEquals("hello", foo.echo("hello"));
}
+ @Test
public void testRMIAdaptor() throws Exception
{
// Lookup the MBeanServerConnection
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 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -23,16 +23,20 @@
//$Id: JNDITestCase.java 88356 2009-05-07 13:13:26Z thomas.diesler(a)jboss.com $
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
import javax.naming.InitialContext;
import javax.naming.NameNotFoundException;
-import junit.framework.Test;
-
import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.JNDICapability;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestSetup;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
import org.osgi.framework.Bundle;
/**
@@ -45,33 +49,25 @@
{
private static OSGiRuntime runtime;
- public static Test suite()
+ @BeforeClass
+ public static void setUpClass() throws Exception
{
- OSGiTestSetup setup = new OSGiTestSetup(JNDITestCase.class)
- {
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- runtime = getDefaultRuntime();
- runtime.addCapability(new JNDICapability());
- }
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new JNDICapability());
+ }
- @Override
- protected void tearDown() throws Exception
- {
- runtime.shutdown();
- super.tearDown();
- }
- };
- return setup;
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ runtime.shutdown();
}
+ @Test
public void testJNDIAccess() throws Exception
{
AbstractBundle bundle = runtime.installBundle("example-jndi.jar");
bundle.start();
-
+
assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
InitialContext iniCtx = runtime.getInitialContext();
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -23,6 +23,8 @@
//$Id: LogServiceTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler(a)jboss.com $
+import static org.junit.Assert.assertEquals;
+
import java.util.List;
import org.jboss.osgi.spi.logging.LogEntryCache;
@@ -30,6 +32,10 @@
import org.jboss.osgi.spi.testing.AbstractBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.service.log.LogEntry;
import org.osgi.service.log.LogService;
@@ -42,27 +48,26 @@
*/
public class LogServiceTestCase extends OSGiTest
{
- private LogEntryCache logEntryCache;
- private OSGiRuntime runtime;
+ private static LogEntryCache logEntryCache;
+ private static OSGiRuntime runtime;
- @Override
- protected void setUp() throws Exception
+ @BeforeClass
+ public static void setUpClass() throws Exception
{
- super.setUp();
-
- runtime = getDefaultRuntime();
+ runtime = new OSGiTestHelper().getDefaultRuntime();
logEntryCache = new LogEntryCache(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
runtime.startLogEntryTracking(logEntryCache);
}
- @Override
- protected void tearDown() throws Exception
+ @AfterClass
+ public static void tearDownClass() throws Exception
{
+ logEntryCache.clear();
runtime.shutdown();
- super.tearDown();
}
+ @Test
public void testLogEntryFilter() throws Exception
{
// Install and start the test bundle
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 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -28,14 +28,14 @@
import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import java.util.List;
import java.util.Set;
import javax.management.ObjectName;
-import junit.framework.Test;
-
import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
import org.jboss.osgi.spi.testing.JMXCapability;
@@ -43,7 +43,10 @@
import org.jboss.osgi.spi.testing.MicrocontainerCapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestSetup;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
/**
* A test that checks whether the MicrocontainerService can be accessed
@@ -55,30 +58,22 @@
{
private static OSGiRuntime runtime;
- public static Test suite()
+ @BeforeClass
+ public static void setUpClass() throws Exception
{
- OSGiTestSetup setup = new OSGiTestSetup(MicrocontainerTestCase.class)
- {
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- runtime = getDefaultRuntime();
- runtime.addCapability(new JNDICapability());
- runtime.addCapability(new JMXCapability());
- runtime.addCapability(new MicrocontainerCapability());
- }
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new JNDICapability());
+ runtime.addCapability(new JMXCapability());
+ runtime.addCapability(new MicrocontainerCapability());
+ }
- @Override
- protected void tearDown() throws Exception
- {
- runtime.shutdown();
- super.tearDown();
- }
- };
- return setup;
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ runtime.shutdown();
}
-
+
+ @Test
public void testServiceAccess() throws Exception
{
MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
@@ -89,20 +84,22 @@
}
/**
- * Test whether the bundle can be deployed through the MicrocontainerServiceMBean
+ * Test whether the bundle can be deployed through the MicrocontainerServiceMBean
*/
+ @Test
public void testBundleDeployment() throws Exception
{
MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
mcService.deploy(getTestArchiveURL("example-mcservice-bundleA.jar"));
-
+
ManagedFrameworkMBean frameworkMBean = runtime.getMBeanProxy(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK);
Set<ObjectName> bundles = frameworkMBean.getBundles();
assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=example-mcservice-bundleA") > 0);
mcService.undeploy(getTestArchiveURL("example-mcservice-bundleA.jar"));
-}
+ }
+ @Test
public void testBeansDeployment() throws Exception
{
MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
@@ -115,7 +112,7 @@
// Check whether the bean is registered
List<String> registeredBeans = mcService.getRegisteredBeans();
assertTrue("SomeBean registered", registeredBeans.contains("SomeBean"));
-
+
mcService.undeploy(getTestArchiveURL("example-mcservice-bundleB.jar"));
// Check whether the bean is unregistered
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 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -23,10 +23,15 @@
//$Id: BootstrapTestCase.java 86588 2009-04-01 13:39:25Z thomas.diesler(a)jboss.com $
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.framework.Bundle;
/**
@@ -37,6 +42,7 @@
*/
public class BootstrapTestCase extends OSGiTest
{
+ @Test
public void testFrameworkBootstrap() throws Exception
{
OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
@@ -49,6 +55,7 @@
assertNotNull("SymbolicName not null", bundle.getSymbolicName());
}
+ @Test
public void testGetBootstrapProvider() throws Exception
{
OSGiBootstrapProvider bp1 = OSGiBootstrap.getBootstrapProvider();
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -24,9 +24,12 @@
//$Id$
package org.jboss.test.osgi.bootstrap;
+import static org.junit.Assert.*;
+
import org.jboss.osgi.spi.testing.AbstractBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -38,6 +41,7 @@
*/
public class BundleTestCase extends OSGiTest
{
+ @Test
public void testApacheXercesBundle() throws BundleException
{
OSGiRuntime runtime = getEmbeddedRuntime();
@@ -54,6 +58,7 @@
}
}
+ @Test
public void testJAXBBundle() throws BundleException
{
OSGiRuntime runtime = getEmbeddedRuntime();
@@ -70,6 +75,7 @@
}
}
+ @Test
public void testJBossCommonCoreBundle() throws BundleException
{
OSGiRuntime runtime = getEmbeddedRuntime();
@@ -87,6 +93,7 @@
}
}
+ @Test
public void testJBossXBBundle() throws BundleException
{
OSGiRuntime runtime = getEmbeddedRuntime();
@@ -106,6 +113,7 @@
}
}
+ @Test
public void testJNDIBundle() throws BundleException
{
OSGiRuntime runtime = getEmbeddedRuntime();
@@ -123,6 +131,7 @@
}
}
+ @Test
public void testJMXBundle() throws Exception
{
OSGiRuntime runtime = getEmbeddedRuntime();
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 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -23,12 +23,15 @@
//$Id: OSGI37TestCase.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
+import static org.junit.Assert.assertEquals;
+
import java.util.ArrayList;
import java.util.List;
import org.jboss.osgi.spi.testing.AbstractBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.framework.Bundle;
/**
@@ -41,6 +44,7 @@
*/
public class OSGI37TestCase extends OSGiTest
{
+ @Test
public void testNestedBundle() throws Exception
{
OSGiRuntime runtime = getDefaultRuntime();
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 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -23,9 +23,13 @@
//$Id: OSGI38TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
import org.jboss.osgi.spi.testing.AbstractBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -47,6 +51,7 @@
/*
* Install/Start the common bundle
*/
+ @Test
public void testInstallStartX() throws Exception
{
OSGiRuntime runtime = getEmbeddedRuntime();
@@ -69,6 +74,7 @@
/*
* Install X, B
*/
+ @Test
public void testInstallXBeforeB() throws Exception
{
OSGiRuntime runtime = getEmbeddedRuntime();
@@ -95,6 +101,7 @@
/*
* Install X, B, A
*/
+ @Test
public void testInstallBBeforeA() throws Exception
{
OSGiRuntime runtime = getEmbeddedRuntime();
@@ -125,6 +132,7 @@
/*
* Install B, X
*/
+ @Test
public void testInstallBBeforeX() throws Exception
{
OSGiRuntime runtime = getEmbeddedRuntime();
@@ -161,6 +169,7 @@
/*
* Install A, B, X
*/
+ @Test
public void testInstallABeforeB() throws Exception
{
OSGiRuntime runtime = getEmbeddedRuntime();
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 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -23,10 +23,15 @@
//$Id: OSGI39TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import org.jboss.osgi.spi.testing.AbstractBundle;
import org.jboss.osgi.spi.testing.AbstractPackageAdmin;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -44,6 +49,7 @@
*/
public class OSGI39TestCase extends OSGiTest
{
+ @Test
public void testVerifyUnresolved() throws Exception
{
OSGiRuntime runtime = getDefaultRuntime();
@@ -89,6 +95,7 @@
* 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.
*/
+ @Test
public void testWiringToUninstalled() throws Exception
{
OSGiRuntime runtime = getDefaultRuntime();
@@ -121,6 +128,7 @@
}
}
+ @Test
public void testWiringToUninstalledPackageAdmin() throws Exception
{
OSGiRuntime runtime = getDefaultRuntime();
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 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -23,8 +23,8 @@
//$Id: OSGI36TestCase.java 86968 2009-04-08 15:51:12Z thomas.diesler(a)jboss.com $
-import junit.extensions.TestSetup;
-import junit.framework.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
@@ -32,9 +32,12 @@
import org.jboss.osgi.spi.testing.JNDICapability;
import org.jboss.osgi.spi.testing.MicrocontainerCapability;
import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.OSGiTestSetup;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.testing.RemoteRuntime;
import org.jboss.test.osgi.jbossas.jbosgi36.mbean.FooMBean;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
/**
* [JBOSGI-36] Bundle classes leak into system classloader
@@ -48,40 +51,33 @@
{
static RemoteRuntime runtime;
- public static Test suite()
+ @BeforeClass
+ public static void setUpClass() throws Exception
{
- TestSetup setup = new OSGiTestSetup(OSGI36TestCase.class)
- {
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- runtime = getRemoteRuntime();
- runtime.addCapability(new JNDICapability());
- runtime.addCapability(new JMXCapability());
- runtime.addCapability(new MicrocontainerCapability());
-
- runtime.deploy("jbosgi36-bundle.jar");
- runtime.deploy("jbosgi36-mbean.jar");
- }
+ runtime = new OSGiTestHelper().getRemoteRuntime();
+ runtime.addCapability(new JNDICapability());
+ runtime.addCapability(new JMXCapability());
+ runtime.addCapability(new MicrocontainerCapability());
- @Override
- protected void tearDown() throws Exception
- {
- runtime.undeploy("jbosgi36-mbean.jar");
- runtime.undeploy("jbosgi36-bundle.jar");
- runtime.shutdown();
- super.tearDown();
- }
- };
- return setup;
+ runtime.deploy("jbosgi36-bundle.jar");
+ runtime.deploy("jbosgi36-mbean.jar");
}
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ runtime.undeploy("jbosgi36-mbean.jar");
+ runtime.undeploy("jbosgi36-bundle.jar");
+ runtime.shutdown();
+ }
+
+ @Test
public void testAccessMBean() throws Exception
{
assertEquals("hello", getFooMBean().echo("hello"));
}
+ @Test
public void testAccessSomeService() throws Exception
{
try
@@ -95,6 +91,7 @@
}
}
+ @Test
public void testAccessSomeInternal() throws Exception
{
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 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java 2009-05-25 19:45:19 UTC (rev 89389)
@@ -23,9 +23,12 @@
//$Id: StartLevelRemoteTestCase.java 87336 2009-04-15 11:31:26Z thomas.diesler(a)jboss.com $
+import static org.junit.Assert.assertEquals;
+
import org.jboss.osgi.spi.testing.AbstractBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.framework.Bundle;
/**
@@ -36,6 +39,7 @@
*/
public class StartLevelTestCase extends OSGiTest
{
+ @Test
public void testStartLevel() throws Exception
{
OSGiRuntime runtime = getDefaultRuntime();
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-25 19:42:57 UTC (rev 89388)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-25 19:45:19 UTC (rev 89389)
@@ -19,14 +19,14 @@
<module>trailblazer</module>
<module>functional</module>
</modules>
-
+
<!-- Dependencies -->
<dependencies>
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
</dependency>
-
+
<dependency>
<groupId>biz.aQute</groupId>
<artifactId>bnd</artifactId>
@@ -35,7 +35,7 @@
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
-
+
<!-- Bundle Dependencies -->
<dependency>
<groupId>org.apache.felix</groupId>
@@ -102,7 +102,7 @@
<artifactId>org.osgi.compendium</artifactId>
<scope>provided</scope>
</dependency>
-
+
<!-- Test Dependencies -->
<dependency>
<groupId>org.jboss.naming</groupId>
@@ -110,7 +110,7 @@
<scope>test</scope>
</dependency>
</dependencies>
-
+
<!-- Build -->
<build>
<testResources>
@@ -120,7 +120,7 @@
</testResource>
</testResources>
</build>
-
+
<!-- Profiles -->
<profiles>
@@ -148,6 +148,18 @@
<configuration>
<systemProperties>
<property>
+ <name>org.jboss.osgi.husky.Invoker</name>
+ <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
+ </property>
+ <!--
+ Implement URLStreamHandlerService
+ https://jira.jboss.org/jira/browse/JBOSGI-75
+ -->
+ <property>
+ <name>java.protocol.handler.pkgs</name>
+ <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
+ </property>
+ <property>
<name>test.archive.directory</name>
<value>${project.build.directory}/test-libs</value>
</property>
@@ -191,6 +203,18 @@
<configuration>
<systemProperties>
<property>
+ <name>org.jboss.osgi.husky.Invoker</name>
+ <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
+ </property>
+ <!--
+ Implement URLStreamHandlerService
+ https://jira.jboss.org/jira/browse/JBOSGI-75
+ -->
+ <property>
+ <name>java.protocol.handler.pkgs</name>
+ <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
+ </property>
+ <property>
<name>test.archive.directory</name>
<value>${project.build.directory}/test-libs</value>
</property>
@@ -234,6 +258,18 @@
<configuration>
<systemProperties>
<property>
+ <name>org.jboss.osgi.husky.Invoker</name>
+ <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
+ </property>
+ <!--
+ Implement URLStreamHandlerService
+ https://jira.jboss.org/jira/browse/JBOSGI-75
+ -->
+ <property>
+ <name>java.protocol.handler.pkgs</name>
+ <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
+ </property>
+ <property>
<name>test.archive.directory</name>
<value>${project.build.directory}/test-libs</value>
</property>
@@ -359,5 +395,5 @@
</profile>
</profiles>
-
+
</project>
17 years, 2 months
JBoss-OSGI SVN: r89387 - in projects/jboss-osgi/projects: bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser and 6 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-25 15:42:36 -0400 (Mon, 25 May 2009)
New Revision: 89387
Removed:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestSetup.java
Modified:
projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/pom.xml
projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java
projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractBridge.java
projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
projects/jboss-osgi/projects/runtime/knopflerfish/trunk/src/test/java/org/jboss/test/osgi/knopflerfish/SystemBundleTestCase.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java
Log:
Migrate to JUnit4
Modified: projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/pom.xml 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/pom.xml 2009-05-25 19:42:36 UTC (rev 89387)
@@ -150,11 +150,11 @@
<!--
Implement URLStreamHandlerService
https://jira.jboss.org/jira/browse/JBOSGI-75
+ -->
<property>
<name>java.protocol.handler.pkgs</name>
<value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
</property>
- -->
<property>
<name>test.archive.directory</name>
<value>${project.build.directory}/test-libs</value>
Modified: projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-05-25 19:42:36 UTC (rev 89387)
@@ -23,6 +23,9 @@
//$Id$
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.net.URL;
import java.util.List;
@@ -30,6 +33,7 @@
import org.jboss.osgi.blueprint.reflect.Blueprint;
import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.service.blueprint.reflect.BeanMetadata;
/**
@@ -40,6 +44,7 @@
*/
public class BasicBeansParserTestCase extends OSGiTest
{
+ @Test
public void testBasicBeans() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-beans.xml");
Modified: projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-05-25 19:42:36 UTC (rev 89387)
@@ -23,6 +23,9 @@
//$Id$
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
import java.math.BigInteger;
import java.net.URL;
@@ -30,6 +33,7 @@
import org.jboss.osgi.blueprint.reflect.Availability;
import org.jboss.osgi.blueprint.reflect.Blueprint;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
/**
* Blueprint parser tests
@@ -39,6 +43,7 @@
*/
public class BasicRootParserTestCase extends OSGiTest
{
+ @Test
public void testBlueprintDefaultAttributes() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-root.xml");
@@ -52,6 +57,7 @@
assertNull(blueprint.getDefaultDestroyMethod());
}
+ @Test
public void testBlueprintDescription() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-root.xml");
Modified: projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/bundles/blueprint/trunk/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-05-25 19:42:36 UTC (rev 89387)
@@ -23,6 +23,9 @@
//$Id$
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.net.URL;
import java.util.List;
@@ -30,6 +33,7 @@
import org.jboss.osgi.blueprint.reflect.Blueprint;
import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
@@ -41,6 +45,7 @@
*/
public class BasicServiceParserTestCase extends OSGiTest
{
+ @Test
public void testBasicBeans() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-service.xml");
Modified: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/Bridge.java 2009-05-25 19:42:36 UTC (rev 89387)
@@ -22,6 +22,7 @@
package org.jboss.osgi.husky;
+
// $Id$
/**
@@ -68,6 +69,21 @@
public interface Bridge
{
/**
+ * Get the caller's class
+ */
+ Class<?> getCallerClass();
+
+ /**
+ * Get the caller's method
+ */
+ String getCallerMethod();
+
+ /**
+ * Get the caller's concatination of class name and method.
+ */
+ String getCallerFrame();
+
+ /**
* Intercepts a test and delegates the execution to the
* same test in the same test class.
*
Modified: projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractBridge.java
===================================================================
--- projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractBridge.java 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/husky/trunk/harness/src/main/java/org/jboss/osgi/husky/internal/AbstractBridge.java 2009-05-25 19:42:36 UTC (rev 89387)
@@ -86,18 +86,20 @@
}
}
- private Class<?> getCallerClass(String callerFrame)
+ public Class<?> getCallerClass()
{
+ String callerFrame = getCallerFrame();
String className = callerFrame.substring(0, callerFrame.lastIndexOf('.'));
return Util.loadClass(className);
}
- private String getCallerMethod(String callerFrame)
+ public String getCallerMethod()
{
+ String callerFrame = getCallerFrame();
return callerFrame.substring(callerFrame.lastIndexOf('.') + 1);
}
- private String getCallerFrame()
+ public String getCallerFrame()
{
String callerFrame = null;
try
@@ -117,7 +119,9 @@
// line 2 is this run method
String line = br.readLine();
line = br.readLine().trim();
- while (line.startsWith("at org.jboss.osgi.husky"))
+
+ String bridgePackage = Bridge.class.getPackage().getName();
+ while (line.startsWith("at " + bridgePackage))
{
line = br.readLine().trim();
}
@@ -130,4 +134,15 @@
}
return callerFrame;
}
+
+ private Class<?> getCallerClass(String callerFrame)
+ {
+ String className = callerFrame.substring(0, callerFrame.lastIndexOf('.'));
+ return Util.loadClass(className);
+ }
+
+ private String getCallerMethod(String callerFrame)
+ {
+ return callerFrame.substring(callerFrame.lastIndexOf('.') + 1);
+ }
}
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java 2009-05-25 19:42:36 UTC (rev 89387)
@@ -23,11 +23,14 @@
//$Id$
+import static org.junit.Assert.*;
+
import org.jboss.osgi.equinox.framework.EquinoxIntegration;
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.framework.Bundle;
/**
@@ -38,6 +41,7 @@
*/
public class SystemBundleTestCase extends OSGiTest
{
+ @Test
public void testEquinoxIntegration()
{
EquinoxIntegration framework = new EquinoxIntegration();
@@ -50,6 +54,7 @@
assertEquals("SymbolicName", "org.eclipse.osgi", bundle.getSymbolicName());
}
+ @Test
public void testSystemBundle()
{
OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-05-25 19:42:36 UTC (rev 89387)
@@ -23,11 +23,14 @@
//$Id$
+import static org.junit.Assert.assertEquals;
+
import org.jboss.osgi.felix.framework.FelixIntegration;
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.framework.Bundle;
/**
@@ -38,18 +41,20 @@
*/
public class SystemBundleTestCase extends OSGiTest
{
+ @Test
public void testFelixIntegration()
{
FelixIntegration framework = new FelixIntegration();
framework.create();
framework.start();
-
+
Bundle bundle = framework.getBundle();
assertEquals("BundleId == 0", 0, bundle.getBundleId());
assertEquals("SymbolicName", "org.apache.felix.framework", bundle.getSymbolicName());
}
-
+
+ @Test
public void testSystemBundle()
{
OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
Modified: projects/jboss-osgi/projects/runtime/knopflerfish/trunk/src/test/java/org/jboss/test/osgi/knopflerfish/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/knopflerfish/trunk/src/test/java/org/jboss/test/osgi/knopflerfish/SystemBundleTestCase.java 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/runtime/knopflerfish/trunk/src/test/java/org/jboss/test/osgi/knopflerfish/SystemBundleTestCase.java 2009-05-25 19:42:36 UTC (rev 89387)
@@ -23,11 +23,14 @@
//$Id$
+import static org.junit.Assert.assertEquals;
+
import org.jboss.osgi.knopflerfish.framework.KnopflerfishIntegration;
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
import org.osgi.framework.Bundle;
/**
@@ -38,6 +41,7 @@
*/
public class SystemBundleTestCase extends OSGiTest
{
+ @Test
public void testEquinoxIntegration()
{
KnopflerfishIntegration framework = new KnopflerfishIntegration();
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-05-25 19:42:36 UTC (rev 89387)
@@ -24,11 +24,11 @@
import java.io.File;
import java.net.URL;
-import junit.framework.TestCase;
-
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.testing.internal.OSGiRuntimeImpl;
import org.jboss.virtual.VFS;
+import org.junit.After;
+import org.junit.Before;
/**
* An OSGi Test Case
@@ -36,7 +36,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
-public abstract class OSGiTest extends TestCase
+public abstract class OSGiTest
{
// Provide logging
final Logger log = Logger.getLogger(OSGiTest.class);
@@ -49,18 +49,16 @@
VFS.init();
}
- @Override
- protected void setUp() throws Exception
+ @Before
+ public void setUp() throws Exception
{
log.debug("### START " + getLongName());
helper = new OSGiTestHelper();
- super.setUp();
}
- @Override
- protected void tearDown() throws Exception
+ @After
+ public void tearDown() throws Exception
{
- super.tearDown();
log.debug("### END " + getLongName());
}
@@ -73,7 +71,7 @@
protected String getLongName()
{
- return getClass().getName() + "." + getName();
+ return getClass().getName();
}
protected OSGiRuntime getDefaultRuntime()
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestSetup.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestSetup.java 2009-05-25 19:39:08 UTC (rev 89386)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestSetup.java 2009-05-25 19:42:36 UTC (rev 89387)
@@ -1,102 +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.testing;
-
-import java.io.File;
-import java.net.URL;
-
-import junit.extensions.TestSetup;
-import junit.framework.TestSuite;
-
-import org.jboss.logging.Logger;
-import org.jboss.osgi.spi.testing.internal.OSGiRuntimeImpl;
-
-/**
- * An OSGi Test Setup
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class OSGiTestSetup extends TestSetup
-{
- // Provide logging
- final Logger log = Logger.getLogger(OSGiTestSetup.class);
-
- private OSGiTestHelper helper;
- private Class<?> testCase;
-
- public OSGiTestSetup(Class<?> testCase)
- {
- super(new TestSuite(testCase));
- this.testCase = testCase;
- }
-
- @Override
- protected void setUp() throws Exception
- {
- log.debug("### START SETUP " + testCase.getName());
- helper = new OSGiTestHelper();
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- log.debug("### END SETUP " + testCase.getName());
- }
-
- public OSGiRuntime getDefaultRuntime()
- {
- return helper.getDefaultRuntime();
- }
-
- protected OSGiRuntimeImpl getEmbeddedRuntime()
- {
- return helper.getEmbeddedRuntime();
- }
-
- public RemoteRuntime getRemoteRuntime()
- {
- return helper.getRemoteRuntime();
- }
-
- public URL getResourceURL(String resource)
- {
- return helper.getResourceURL(resource);
- }
-
- protected File getResourceFile(String resource)
- {
- return helper.getResourceFile(resource);
- }
-
- public URL getTestArchiveURL(String archive)
- {
- return helper.getTestArchiveURL(archive);
- }
-
- protected File getTestArchiveFile(String archive)
- {
- return helper.getTestArchiveFile(archive);
- }
-}
17 years, 2 months
JBoss-OSGI SVN: r89384 - projects/jboss-osgi/trunk/testsuite/functional/src/test/resources.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-25 14:30:37 -0400 (Mon, 25 May 2009)
New Revision: 89384
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties
Log:
Add equinox, knopflerfish integration props
Added: 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 (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties 2009-05-25 18:30:37 UTC (rev 89384)
@@ -0,0 +1,13 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+#
+# $Id$
+#
+
+# The OSGiFramework implementation
+org.jboss.osgi.spi.framework.impl=org.jboss.osgi.equinox.framework.EquinoxIntegration
+
+# Properties to configure the Framework
+org.osgi.framework.storage=${basedir}/target/osgi-store
+org.osgi.framework.storage.clean=onFirstInit
+
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-equinox.properties
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties 2009-05-25 18:30:37 UTC (rev 89384)
@@ -0,0 +1,13 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+#
+# $Id$
+#
+
+# The OSGiFramework implementation
+org.jboss.osgi.spi.framework.impl=org.jboss.osgi.knopflerfish.framework.KnopflerfishIntegration
+
+# Properties to configure the Framework
+org.osgi.framework.storage=${basedir}/target/osgi-store
+org.osgi.framework.storage.clean=onFirstInit
+
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 2 months
JBoss-OSGI SVN: r89383 - projects/jboss-osgi/trunk/testsuite.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-25 13:43:02 -0400 (Mon, 25 May 2009)
New Revision: 89383
Modified:
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Add minimal bootstrap testing for equinox and knopflerfish
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-25 16:27:59 UTC (rev 89382)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-25 17:43:02 UTC (rev 89383)
@@ -232,7 +232,6 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <skipTests>true</skipTests>
<systemProperties>
<property>
<name>test.archive.directory</name>
@@ -247,6 +246,10 @@
<value>jboss-osgi-equinox.properties</value>
</property>
</systemProperties>
+ <includes>
+ <!-- Minimal bootstrap testing -->
+ <include>org/jboss/test/osgi/bootstrap/BootstrapTestCase.*</include>
+ </includes>
</configuration>
</plugin>
</plugins>
@@ -276,7 +279,6 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <skipTests>true</skipTests>
<systemProperties>
<property>
<name>test.archive.directory</name>
@@ -291,6 +293,10 @@
<value>jboss-osgi-knopflerfish.properties</value>
</property>
</systemProperties>
+ <includes>
+ <!-- Minimal bootstrap testing -->
+ <include>org/jboss/test/osgi/bootstrap/BootstrapTestCase.*</include>
+ </includes>
</configuration>
</plugin>
</plugins>
@@ -298,11 +304,11 @@
</profile>
<!--
- Name: embedded-tesing
+ Name: embedded-testing
Descr: Setup for embedded integration testing
-->
<profile>
- <id>embedded-tesing</id>
+ <id>embedded-testing</id>
<activation>
<property>
<name>!target.container</name>
@@ -324,11 +330,11 @@
</profile>
<!--
- Name: runtime-tesing
+ Name: runtime-testing
Descr: Setup for runtime integration testing
-->
<profile>
- <id>runtime-tesing</id>
+ <id>runtime-testing</id>
<activation>
<property>
<name>target.container</name>
17 years, 2 months
JBoss-OSGI SVN: r89381 - projects/jboss-osgi/projects/bundles/jbossxb/trunk/src/main/java/org/jboss/osgi/jbossxb/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-25 12:00:18 -0400 (Mon, 25 May 2009)
New Revision: 89381
Modified:
projects/jboss-osgi/projects/bundles/jbossxb/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/Activator.java
Log:
Add javadoc
Modified: projects/jboss-osgi/projects/bundles/jbossxb/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/Activator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jbossxb/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/Activator.java 2009-05-25 15:50:18 UTC (rev 89380)
+++ projects/jboss-osgi/projects/bundles/jbossxb/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/Activator.java 2009-05-25 16:00:18 UTC (rev 89381)
@@ -29,7 +29,7 @@
import org.osgi.service.log.LogService;
/**
- * [TODO]
+ * A {@link BundleActivator} that initializes the JBossXB bundle
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
@@ -41,38 +41,6 @@
public void start(BundleContext context) throws Exception
{
log = new LogServiceTracker(context);
- //String parserConfig = System.getProperty(XMLParserConfiguration.class.getName());
- //if (parserConfig == null)
- // System.setProperty(XMLParserConfiguration.class.getName(), XIncludeAwareParserConfiguration.class.getName());
-
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- ClassLoader bundleCL = getClass().getClassLoader();
- Thread.currentThread().setContextClassLoader(bundleCL);
-
-// log.log(LogService.LOG_DEBUG, "Initializing jbossxb with: " + bundleCL);
-
-// https://jira.jboss.org/jira/browse/JBXB-201
-// Cannot parse schema/jbxb_1_0.xsd
-
-// Class<?> xsImpl = bundleCL.loadClass(DOMXSImplementationSourceImpl.class.getName());
-// if (xsImpl == null)
-// throw new IllegalStateException("Cannot load: " + DOMXSImplementationSourceImpl.class.getName());
-
-// String jbxbSchema = "schema/jbxb_1_0.xsd";
-// URL jbxbXSD = context.getBundle().getResource(jbxbSchema);
-// if (jbxbXSD == null)
-// throw new IllegalStateException("Cannot find: " + jbxbSchema);
-//
-// XSModel xsModel = Util.loadSchema(jbxbXSD.toExternalForm(), (SchemaBindingResolver)null);
-// if (xsModel == null)
-// throw new IllegalStateException("Cannot load schema: " + jbxbSchema);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
}
public void stop(BundleContext context) throws Exception
17 years, 2 months
JBoss-OSGI SVN: r89380 - in projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi: internal and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-25 11:50:18 -0400 (Mon, 25 May 2009)
New Revision: 89380
Added:
projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java
Removed:
projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/NamingService.java
projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java
Log:
Register InitialContext directly
Deleted: projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/NamingService.java
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/NamingService.java 2009-05-25 14:16:05 UTC (rev 89379)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/NamingService.java 2009-05-25 15:50:18 UTC (rev 89380)
@@ -1,42 +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.jndi;
-
-//$Id$
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- * A service that gives access to JNDI
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public interface NamingService
-{
- /**
- * Get the InitialContext
- * @throws NamingException if a naming exception is encountered
- */
- InitialContext getInitialContext() throws NamingException;
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java 2009-05-25 14:16:05 UTC (rev 89379)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java 2009-05-25 15:50:18 UTC (rev 89380)
@@ -1,61 +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.jndi.internal;
-
-//$Id$
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.osgi.jndi.NamingService;
-import org.osgi.framework.BundleContext;
-
-/**
- * A service that gives access to JNDI
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class NamingServiceImpl implements NamingService
-{
- private BundleContext context;
-
- public void setSystemContext(BundleContext context)
- {
- this.context = context;
- }
-
- /**
- * Get the InitialContext
- *
- * @throws NamingException if a naming exception is encountered
- */
- public InitialContext getInitialContext() throws NamingException
- {
- return new InitialContext();
- }
-
- public void start()
- {
- context.registerService(NamingService.class.getName(), this, null);
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java (from rev 89379, projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java)
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java (rev 0)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/jndi/internal/NamingServiceImpl.java 2009-05-25 15:50:18 UTC (rev 89380)
@@ -0,0 +1,58 @@
+/*
+ * 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.jndi.internal;
+
+//$Id$
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * A service that gives access to JNDI
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class NamingServiceImpl
+{
+ private BundleContext context;
+
+ public void setSystemContext(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public void start()
+ {
+ try
+ {
+ InitialContext initialContext = new InitialContext();
+ context.registerService(InitialContext.class.getName(), initialContext, null);
+ }
+ catch (NamingException ex)
+ {
+ throw new IllegalStateException("Cannot register InitialContext", ex);
+ }
+ }
+}
\ No newline at end of file
17 years, 2 months
JBoss-OSGI SVN: r89378 - projects/jboss-osgi/trunk/build/hudson.
by jboss-osgi-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-05-25 09:48:22 -0400 (Mon, 25 May 2009)
New Revision: 89378
Modified:
projects/jboss-osgi/trunk/build/hudson/ant.properties.example
Log:
Update to hudson-1.307
Modified: projects/jboss-osgi/trunk/build/hudson/ant.properties.example
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/ant.properties.example 2009-05-25 13:39:02 UTC (rev 89377)
+++ projects/jboss-osgi/trunk/build/hudson/ant.properties.example 2009-05-25 13:48:22 UTC (rev 89378)
@@ -30,6 +30,7 @@
hudson.mail.recipients=
hudson.smtp.host=localhost
-# Hudson (1.290)
+# Hudson (1.307)
apache-tomcat=6.0.18
-sun-hudson=2402/128862
+sun-hudson=2402/135231
+~
17 years, 2 months
JBoss-OSGI SVN: r89377 - in projects/jboss-osgi/trunk: build/distribution and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-25 09:39:02 -0400 (Mon, 25 May 2009)
New Revision: 89377
Modified:
projects/jboss-osgi/trunk/build/distribution/pom.xml
projects/jboss-osgi/trunk/pom.xml
Log:
Add explicit dependency on integration/jbossas
Modified: projects/jboss-osgi/trunk/build/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/pom.xml 2009-05-25 13:36:52 UTC (rev 89376)
+++ projects/jboss-osgi/trunk/build/distribution/pom.xml 2009-05-25 13:39:02 UTC (rev 89377)
@@ -47,12 +47,12 @@
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-integration-jbossas</artifactId>
- <version>${version}</version>
+ <version>${version.jboss.osgi.integration.jbossas}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-integration-jbossas</artifactId>
- <version>${version}</version>
+ <version>${version.jboss.osgi.integration.jbossas}</version>
<classifier>sources</classifier>
</dependency>
<dependency>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-05-25 13:36:52 UTC (rev 89376)
+++ projects/jboss-osgi/trunk/pom.xml 2009-05-25 13:39:02 UTC (rev 89377)
@@ -36,6 +36,7 @@
<version.jboss.osgi.common>1.0.0-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.deployers>1.0.0-SNAPSHOT</version.jboss.osgi.deployers>
<version.jboss.osgi.jbossxb>2.0.0-SNAPSHOT</version.jboss.osgi.jbossxb>
+ <version.jboss.osgi.integration.jbossas>1.0.0-SNAPSHOT</version.jboss.osgi.integration.jbossas>
<version.jboss.osgi.jmx>1.0.0-SNAPSHOT</version.jboss.osgi.jmx>
<version.jboss.osgi.jndi>1.0.0-SNAPSHOT</version.jboss.osgi.jndi>
<version.jboss.osgi.logging>1.0.0-SNAPSHOT</version.jboss.osgi.logging>
17 years, 2 months
JBoss-OSGI SVN: r89375 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-25 09:10:19 -0400 (Mon, 25 May 2009)
New Revision: 89375
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java
Log:
Add more debugging
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java 2009-05-25 13:01:30 UTC (rev 89374)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java 2009-05-25 13:10:19 UTC (rev 89375)
@@ -21,6 +21,7 @@
*/
package org.jboss.osgi.spi.testing;
+import org.jboss.osgi.spi.logging.ExportedPackageHelper;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -72,6 +73,9 @@
public void start() throws BundleException
{
bundle.start();
+
+ ExportedPackageHelper helper = new ExportedPackageHelper(bundle.getBundleContext());
+ helper.logExportedPackages(bundle);
}
@Override
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java 2009-05-25 13:01:30 UTC (rev 89374)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java 2009-05-25 13:10:19 UTC (rev 89375)
@@ -38,6 +38,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.logging.ExportedPackageHelper;
import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.testing.internal.OSGiRuntimeImpl;
import org.osgi.framework.Bundle;
17 years, 2 months