Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to jbosgi-framework-2.0.0.CR15

  • Loading branch information...
commit 05e4a3004ff343ba135448653e7a31dfd17b5be1 1 parent f8de5a7
@tdiesler tdiesler authored
View
2  pom.xml
@@ -61,7 +61,7 @@
<version.jboss.osgi.deployment>1.1.1.Final</version.jboss.osgi.deployment>
<version.jboss.osgi.equinox>3.5.2.SP1</version.jboss.osgi.equinox>
<version.jboss.osgi.felix>3.0.4</version.jboss.osgi.felix>
- <version.jboss.osgi.framework>2.0.0.CR14</version.jboss.osgi.framework>
+ <version.jboss.osgi.framework>2.0.0.CR15</version.jboss.osgi.framework>
<version.jboss.osgi.jmx>1.1.0.Final</version.jboss.osgi.jmx>
<version.jboss.osgi.logging>1.0.0</version.jboss.osgi.logging>
<version.jboss.osgi.metadata>2.1.1.CR7</version.jboss.osgi.metadata>
View
26 testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
@@ -66,7 +66,7 @@
/**
* This test exercises the OSGi-JNDI integration
- *
+ *
* @author David Bosschaert
* @author Thomas.Diesler@jboss.com
*/
@@ -81,7 +81,7 @@
@ArquillianResource
public Deployer deployer;
-
+
@Deployment
public static JavaArchive createdeployment() {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "example-jndi");
@@ -202,13 +202,13 @@ public void testContextManagerValueLookup() throws Exception {
Bundle bundleB = context.installBundle("bundleB", inputB);
try {
bundleB.start();
-
+
// Access the service directly
BundleContext contextB = bundleB.getBundleContext();
ServiceReference sref = contextB.getServiceReference(JNDITestService.class.getName());
JNDITestService service = (JNDITestService) contextB.getService(sref);
Assert.assertEquals("jndi-value", service.getValue());
-
+
// Get the InitialContext via {@link JNDIContextManager} for bundleB
JNDIContextManager contextManager = NamingSupport.provideJNDIIntegration(context, bundleB);
Context initialContext = contextManager.newInitialContext();
@@ -235,13 +235,13 @@ public void testContextManagerValueLookupNegative() throws Exception {
Bundle bundleC = context.installBundle("bundleC", inputC);
try {
bundleC.start();
-
+
// Access the service directly
BundleContext contextC = bundleC.getBundleContext();
ServiceReference sref = contextC.getServiceReference(JNDITestService.class.getName());
Assert.assertNull("ServiceReference is null", sref);
-
- // Get the InitialContext via {@link JNDIContextManager} for bundleB
+
+ // Get the InitialContext via {@link JNDIContextManager} for bundleC
JNDIContextManager contextManager = NamingSupport.provideJNDIIntegration(context, bundleC);
Context initialContext = contextManager.newInitialContext();
@@ -261,7 +261,7 @@ public void testContextManagerValueLookupNegative() throws Exception {
//} catch (NameNotFoundException ex) {
// //expected
//}
-
+
} finally {
bundleC.uninstall();
}
@@ -360,13 +360,13 @@ public void testTraditionalAPIValueLookup() throws Exception {
Bundle bundleB = context.installBundle("bundleB", inputB);
try {
bundleB.start();
-
+
// Access the service directly
BundleContext contextB = bundleB.getBundleContext();
ServiceReference sref = contextB.getServiceReference(JNDITestService.class.getName());
JNDITestService service = (JNDITestService) contextB.getService(sref);
Assert.assertEquals("jndi-value", service.getValue());
-
+
// Get the InitialContext via {@link JNDIContextManager} for bundleB
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put(JNDIConstants.BUNDLE_CONTEXT, contextB);
@@ -394,12 +394,12 @@ public void testTraditionalAPIValueLookupNegative() throws Exception {
Bundle bundleC = context.installBundle("bundleC", inputC);
try {
bundleC.start();
-
+
// Access the service directly
BundleContext contextC = bundleC.getBundleContext();
ServiceReference sref = contextC.getServiceReference(JNDITestService.class.getName());
Assert.assertNull("ServiceReference is null", sref);
-
+
// Get the InitialContext via {@link JNDIContextManager} for bundleB
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put(JNDIConstants.BUNDLE_CONTEXT, contextC);
@@ -421,7 +421,7 @@ public void testTraditionalAPIValueLookupNegative() throws Exception {
//} catch (NameNotFoundException ex) {
// //expected
//}
-
+
} finally {
bundleC.uninstall();
}
View
20 testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/bundle/JNDITestActivator.java
@@ -49,7 +49,7 @@
@Override
public void start(BundleContext context) throws Exception {
-
+
// Register a simple service
Hashtable<String, String> props = new Hashtable<String, String>();
props.put(JNDIConstants.JNDI_SERVICENAME, "foo");
@@ -60,12 +60,12 @@ public String getValue() {
}
};
context.registerService(JNDITestService.class.getName(), service, props);
-
+
// Register a {@link InitialContextFactory} provider
String[] classes = new String[] {SimpleInitalContextFactory.class.getName(), InitialContextFactory.class.getName()};
context.registerService(classes, new SimpleInitalContextFactory(), null);
-
- // Register a {@link ObjectFactoryBuilder} provider
+
+ // Register a {@link ObjectFactory} provider
classes = new String[] {StringObjectFactory.class.getName(), ObjectFactory.class.getName()};
context.registerService(classes, new StringObjectFactory(), null);
}
@@ -76,23 +76,23 @@ public void stop(BundleContext context) throws Exception {
@SuppressWarnings("serial")
public static final class StringReference extends Reference {
-
+
private final String value;
-
+
public StringReference(String value) {
super(String.class.getName(), StringObjectFactory.class.getName(), null);
this.value = value;
}
- }
-
+ }
+
public static final class StringObjectFactory implements ObjectFactory {
@Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
StringReference ref = (StringReference) obj;
return ref.value;
}
- }
-
+ }
+
public static class SimpleInitalContextFactory implements InitialContextFactory {
@Override
public Context getInitialContext(Hashtable<?, ?> environment) throws NamingException {
Please sign in to comment.
Something went wrong with that request. Please try again.