use of jakarta.xml.ws.Response in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloLiteralTest method testVoidAsyncPollJAXB.
/*Invalid test may not cancel
public void testHelloAsyncPollCancelXML() throws Exception {
Dispatch dispatch = getDispatchSource();
Collection<Source> sourceList = makeMsgSource(helloMsg);
Collection<Source> responseList = makeMsgSource(helloResponse);
for (Iterator iter = sourceList.iterator(); iter.hasNext();) {
Object sourceObject = iter.next();
Response result = dispatch.invokeAsync(sourceObject);
while (!result.isDone()) {
result.cancel(false);
assertEquals(true, result.isCancelled());
}
}
}
public void testHelloAsyncPollCancelInterruptXML() throws Exception {
Dispatch dispatch = getDispatchSource();
Collection<Source> sourceList = makeMsgSource(helloMsg);
Collection<Source> responseList = makeMsgSource(helloResponse);
for (Iterator iter = sourceList.iterator(); iter.hasNext();) {
Object sourceObject = iter.next();
Response result = dispatch.invokeAsync(sourceObject);
while (!result.isDone()) {
result.cancel(true);
assertEquals(true, result.isCancelled());
}
}
}
--end invalid test*/
public void testVoidAsyncPollJAXB() throws Exception {
JAXBContext jc = createJAXBContext();
VoidTest voidTest = new VoidTest();
VoidTestResponse voidTestResult = new VoidTestResponse();
Dispatch dispatch = getDispatchJAXB();
Response result = dispatch.invokeAsync(voidTest);
Object obj = result.get();
assertTrue(obj != null);
assertTrue(obj instanceof VoidTestResponse);
VoidTestResponse res = (VoidTestResponse) obj;
}
use of jakarta.xml.ws.Response in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloLiteralTest method testHelloAsyncPollDoneXML.
// todo: object comes back as jaxb object investigate
public void testHelloAsyncPollDoneXML() throws Exception {
Dispatch dispatch = getDispatchSource();
Collection<Source> sourceList = makeMsgSource(helloMsg);
Collection<Source> responseList = makeMsgSource(helloResponse);
for (Iterator iter = sourceList.iterator(); iter.hasNext(); ) {
Object sourceObject = iter.next();
Response result = dispatch.invokeAsync(sourceObject);
while (!result.isDone()) {
}
Object realResult = ((Response) result).get();
assertTrue(realResult instanceof Source);
}
}
use of jakarta.xml.ws.Response in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloLiteralTest method testHelloAsyncPollJAXBMult.
public void testHelloAsyncPollJAXBMult() throws Exception {
JAXBContext jc = createJAXBContext();
Hello_Type hello = new Hello_Type();
HelloResponse helloResult = new HelloResponse();
hello.setExtra("Test ");
hello.setArgument("Dispatch ");
Dispatch dispatch = getDispatchJAXB();
Response result = dispatch.invokeAsync(hello);
Response result2 = dispatch.invokeAsync(hello);
Response result3 = dispatch.invokeAsync(hello);
Response result4 = dispatch.invokeAsync(hello);
Response result5 = dispatch.invokeAsync(hello);
Response result6 = dispatch.invokeAsync(hello);
Response result7 = dispatch.invokeAsync(hello);
Response result8 = dispatch.invokeAsync(hello);
Response result9 = dispatch.invokeAsync(hello);
int k = 0;
Response resultf = null;
for (k = 0; k < 55; k++) {
resultf = dispatch.invokeAsync(hello);
}
System.out.println("last k " + k);
while (!resultf.isDone()) {
}
}
use of jakarta.xml.ws.Response in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloLiteralTest method testHelloAsyncPollDoneJAXB.
public void testHelloAsyncPollDoneJAXB() throws Exception {
JAXBContext jc = createJAXBContext();
Hello_Type hello = new Hello_Type();
HelloResponse helloResult = new HelloResponse();
hello.setExtra("Test ");
hello.setArgument("Dispatch ");
Dispatch dispatch = getDispatchJAXB();
Response result = dispatch.invokeAsync(hello);
while (!result.isDone()) {
}
Object obj = result.get();
HelloResponse res = (HelloResponse) obj;
assertEquals(res.getExtra(), hello.getExtra());
assertEquals(res.getArgument(), hello.getArgument());
}
use of jakarta.xml.ws.Response in project metro-jax-ws by eclipse-ee4j.
the class DispatchHello method testHelloRequestResponseJAXBandSource.
/* public void testStubPropertySoapUseActionNegative() {
try {
Hello stub = getDynamicStubDynamicServer();
// get stub
Boolean prop = (Boolean)((BindingProvider) stub).getRequestContext().get(BindingProvider.SOAPACTION_USE_PROPERTY);
((BindingProvider) stub).getRequestContext().get(BindingProvider.SOAPACTION_URI_PROPERTY);
} catch (Exception ex) {
if (ex instanceof WebServiceException) {
System.out.println("Property test passes");
}
}
}
*/
public void testHelloRequestResponseJAXBandSource() throws Exception {
// test for bug 6194159
JAXBContext jc = null;
HelloResponse helloResult = null;
Hello_Type hello = new Hello_Type();
jc = createJAXBContext();
try {
hello.setArgument("foo");
hello.setExtra("Test ");
Dispatch dispatch = getDispatchJAXB();
Dispatch dispatch2 = getDispatchSource();
dispatch.getRequestContext().put("com.sun.xml.pw.testprop", "test");
Response response = dispatch.invokeAsync(hello);
if (!response.isDone()) {
dispatch2.invokeAsync(makeStreamSource(helloMsg));
}
Object result = response.get();
assertEquals(((HelloResponse) result).getExtra(), hello.getExtra());
assertEquals(((HelloResponse) result).getArgument(), hello.getArgument());
} catch (Exception jex) {
fail("Expected HelloResponse go Exception");
}
}
Aggregations