use of com.sun.xml.ws.test.HelloPort in project metro-jax-ws by eclipse-ee4j.
the class JAXBRIBasicTest method testHelloEchoNoMode.
public void testHelloEchoNoMode() throws Exception {
Class endpointClass = HelloImpl.class;
Class proxySEIClass = HelloPort.class;
DatabindingConfig srvConfig = new DatabindingConfig();
srvConfig.setEndpointClass(endpointClass);
srvConfig.setMetadataReader(new DummyAnnotations());
WebServiceFeature[] f = {};
srvConfig.setFeatures(f);
DatabindingConfig cliConfig = new DatabindingConfig();
cliConfig.setMetadataReader(new DummyAnnotations());
cliConfig.setContractClass(proxySEIClass);
cliConfig.setFeatures(f);
HelloPort hp = createProxy(HelloPort.class, srvConfig, cliConfig, false);
String req = "testInVM " + databindingMode().getMode();
String res = hp.echoS(req);
assertEquals(req, res);
String wrapperName = srvConfig.properties().get(BindingContext.class.getName()).getClass().getName();
assertTrue("Wrapper: " + wrapperName, wrapperName != null && wrapperName.endsWith("JAXBRIContextWrapper"));
}
use of com.sun.xml.ws.test.HelloPort in project metro-jax-ws by eclipse-ee4j.
the class JAXBRIBasicTest method testHelloEchoInvalidDB.
public void testHelloEchoInvalidDB() throws Exception {
Class endpointClass = HelloImpl.class;
Class proxySEIClass = HelloPort.class;
DatabindingConfig srvConfig = new DatabindingConfig();
srvConfig.setEndpointClass(endpointClass);
srvConfig.setMetadataReader(new DummyAnnotations());
WebServiceFeature[] f = { new DatabindingModeFeature("invalid.db") };
srvConfig.setFeatures(f);
DatabindingConfig cliConfig = new DatabindingConfig();
cliConfig.setMetadataReader(new DummyAnnotations());
cliConfig.setContractClass(proxySEIClass);
cliConfig.setFeatures(f);
try {
HelloPort hp = createProxy(HelloPort.class, srvConfig, cliConfig, false);
fail("Expected DatabindingException not thrown");
} catch (DatabindingException e) {
// expected exception.
}
}
use of com.sun.xml.ws.test.HelloPort in project metro-jax-ws by eclipse-ee4j.
the class BasicDatabindingTestBase method _testHelloEcho.
protected String _testHelloEcho() throws Exception {
Class<?> endpointClass = HelloImpl.class;
Class<?> proxySEIClass = HelloPort.class;
DatabindingConfig srvConfig = new DatabindingConfig();
srvConfig.setEndpointClass(endpointClass);
srvConfig.setMetadataReader(new DummyAnnotations());
DatabindingModeFeature dbm = databindingMode();
DatabindingConfig cliConfig = new DatabindingConfig();
cliConfig.setMetadataReader(new DummyAnnotations());
cliConfig.setContractClass(proxySEIClass);
// Honor system property if present, otherwise set feature.
WebServiceFeature[] f = null;
String dbProperty = System.getProperty(BindingContextFactory.JAXB_CONTEXT_FACTORY_PROPERTY);
if (dbProperty == null)
f = new WebServiceFeature[] { dbm };
else
f = new WebServiceFeature[0];
srvConfig.setFeatures(f);
cliConfig.setFeatures(f);
HelloPort hp = createProxy(HelloPort.class, srvConfig, cliConfig, false);
String req = "testInVM " + dbm.getMode();
String res = hp.echoS(req);
assertEquals(req, res);
return srvConfig.properties().get(BindingContext.class.getName()).getClass().getName();
}
Aggregations