.set(Constants.BUNDLE_SYMBOLICNAME, "version.service")
.set(Constants.BUNDLE_ACTIVATOR, Activator.class.getName())
.set(Constants.DYNAMICIMPORT_PACKAGE, "*")
.build()),
frameworkProperty("org.osgi.service.http.port").value(String.valueOf(httpPort))));
NativeTestContainer container = new NativeTestContainer(system, new FrameworkFactory());
container.start();
try {
OMFactory factory = OMAbstractFactory.getOMFactory();
OMElement payload = factory.createOMElement("getVersion", factory.createOMNamespace("http://service.osgi.axis2.apache.org", "ns"));
Options options = new Options();
options.setTo(new EndpointReference("http://localhost:" + httpPort + "/services/Version"));
ServiceClient serviceClient = new ServiceClient();
serviceClient.setOptions(options);
OMElement result = serviceClient.sendReceive(payload);
assertEquals("getVersionResponse", result.getLocalName());
// Stop the Axis2 bundle explicitly here so that we can test that it cleanly shuts down (see AXIS2-5646)
stopBundle(getAxis2Bundle(container));
} finally {
container.stop();
}
}