File: RamServiceTestCase.java

package info (click to toggle)
axis 1.4-29
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 52,100 kB
  • sloc: java: 129,124; xml: 10,602; jsp: 983; sh: 84; cs: 36; makefile: 18
file content (73 lines) | stat: -rw-r--r-- 2,673 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
 * RamServiceTestCase.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package test.wsdl.ram;

public class RamServiceTestCase extends junit.framework.TestCase {
    public RamServiceTestCase(String name) {
        super(name);
    }

    public void testRamWSDL() throws Exception {
        javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
        java.net.URL url = new java.net.URL(new test.wsdl.ram.RamServiceLocator().getRamAddress() + "?WSDL");
        javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.ram.RamServiceLocator().getServiceName());
        assertTrue(service != null);
    }

    public void test1RamValidate() {
        Ram binding;
        try {
            binding = new RamServiceLocator().getRam();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertTrue("binding is null", binding != null);

        try {
            RamData[] input = new RamData[1];

            input[0] = new RamData();
            input[0].setBankInfoPaymentType("BIPT");
            input[0].setBankInfoRequestType("BIRT");
            input[0].setCallingClientPortNumber("CCPN");
            input[0].setCallingClientUserIdentifier("CCUI");

            CreditCard cc = new CreditCard();
            cc.setName("NAME");
            cc.setNumber("NUMBER");
            cc.setExpires(new java.util.Date());
            cc.setPostalCode("PC");
            input[0].setCreditCard(cc);

            Fee[] fees = new Fee[1];
            fees[0] = new Fee();
            fees[0].setAmount(20.0);
            fees[0].setQuantity(50);
            fees[0].setCode("CODE");
            input[0].setFees(fees);

            input[0].setMailRoomDate(new java.util.Date());
            input[0].setSaleOtherPaymentTotalAmount(100.0);
            input[0].setSalePostingReferenceText("SPRT");

            Response[] output = binding.validate(input);
            java.util.Date resDate = output[0].getAccountingDate();
            java.util.Date now = new java.util.Date();
            assertTrue("Time check failed.  Result date = " + resDate + ", current time = " + now, resDate.before(now));
        }
        catch (java.rmi.RemoteException re) {
            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
        }
    }

    public static void main(String[] args){
        RamServiceTestCase test = new RamServiceTestCase("RamServiceTestCase");
        test.test1RamValidate();
    }
}