|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| package jtr.test.jee.client; |
|
12 |
| |
|
13 |
| import javax.xml.bind.JAXBElement; |
|
14 |
| import jtr.runners.AbstractWsRunner; |
|
15 |
| import jtr.test.IOutcome; |
|
16 |
| import jtr.test.jee.arithmetical.client.Sum; |
|
17 |
| import jtr.test.jee.arithmetical.client.SumResponse; |
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| |
|
23 |
| |
|
24 |
| |
|
25 |
| public class WsArithmeticalTest extends AbstractWsRunner { |
|
26 |
| |
|
27 |
| |
|
28 |
14
| public WsArithmeticalTest() {
|
|
29 |
| } |
|
30 |
| |
|
31 |
3495
| public void test() throws Throwable {
|
|
32 |
3496
| userMsg = "Using WS-binding "+getBinding().getUniqueName();
|
|
33 |
3499
| jtr.test.jee.arithmetical.client.ObjectFactory sof = new jtr.test.jee.arithmetical.client.ObjectFactory();
|
|
34 |
3498
| Sum sumReq = sof.createSum();
|
|
35 |
3499
| sumReq.setX(x);
|
|
36 |
3499
| sumReq.setY(y);
|
|
37 |
3500
| userMsg = userMsg + "\nSumming "+x+" and "+y;
|
|
38 |
3495
| JAXBElement<Sum> req = sof.createSum(sumReq);
|
|
39 |
3499
| JAXBElement<SumResponse> rsp = (JAXBElement) invoke(getBinding(),req);
|
|
40 |
3479
| System.out.println("WS Sum is "+rsp.getValue().getReturn());
|
|
41 |
3500
| userMsg = userMsg + "\nResult is "+rsp.getValue().getReturn();
|
|
42 |
| } |
|
43 |
| |
|
44 |
0
| public void receiveFailureNotification(Throwable t, String msg) {
|
|
45 |
| } |
|
46 |
| |
|
47 |
14
| public void cleanupResources() {
|
|
48 |
| } |
|
49 |
| |
|
50 |
3500
| public void enrichOutcome(IOutcome outcome) {
|
|
51 |
3500
| outcome.setUserObject(userMsg);
|
|
52 |
| } |
|
53 |
| |
|
54 |
| private String userMsg; |
|
55 |
| private int x; |
|
56 |
| private int y; |
|
57 |
| } |