use of annotations.client.AddNumbersImplService in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersTest method testSuccess.
@Test
public void testSuccess() throws AddNumbersException_Exception {
AddNumbers port = new AddNumbersImplService().getAddNumbersImplPort();
Map<String, Object> ctxt = ((BindingProvider) port).getRequestContext();
int number1 = 10;
int number2 = 20;
System.out.printf("Invoking addNumbers(%d, %d)\n", number1, number2);
int result = port.add(number1, number2);
System.out.printf("The result of adding %d and %d is %d.\n\n", number1, number2, result);
Assertions.assertEquals(30, result);
}
use of annotations.client.AddNumbersImplService in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersTest method testFault.
@Test
public void testFault() throws AddNumbersException_Exception {
AddNumbers port = new AddNumbersImplService().getAddNumbersImplPort();
try {
int number1 = -10;
int number2 = 20;
System.out.printf("Invoking addNumbers(%d, %d)\n", number1, number2);
int result = port.add(number1, number2);
System.out.printf("The result of adding %d and %d is %d.\n", number1, number2, result);
Assertions.fail();
} catch (AddNumbersException_Exception ex) {
System.out.printf("Caught AddNumbersException_Exception: %s\n", ex.getFaultInfo().getFaultInfo());
}
}
Aggregations