Package org.ops4j.pax.exam.nat.internal

Examples of org.ops4j.pax.exam.nat.internal.NativeTestContainer


                    .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();
        }
    }
View Full Code Here

TOP

Related Classes of org.ops4j.pax.exam.nat.internal.NativeTestContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.