File: AdaptiveServiceTestCase.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 (182 lines) | stat: -rw-r--r-- 7,872 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/**
 * AdaptiveServiceTestCase.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package test.wsdl.adaptive;

import java.util.Arrays;

public class AdaptiveServiceTestCase extends junit.framework.TestCase {
    public AdaptiveServiceTestCase(java.lang.String name) {
        super(name);
    }

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

    public void test1AdaptiveGetServiceDescription() throws Exception {
        test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding;
        try {
            binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub)
                          new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        java.lang.String value = null;
        value = binding.getServiceDescription();
        // TBD - validate results
    }

    public void test2AdaptiveRankResources() throws Exception {
        test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding;
        try {
            binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub)
                          new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        test.wsdl.adaptive.types.ResourceInfo[] value = null;
        value = binding.rankResources(new test.wsdl.adaptive.types.ResourceInfo[0], new test.wsdl.adaptive.types.ApplicationInfo());
        // TBD - validate results
        assertTrue(value.length > 0);
        assertEquals(value[0].getId(), "Adaptive #1");
        java.lang.Object[] collection = value[0].getProperties().getCollection();
        assertTrue(collection.length > 0);
        assertTrue(Arrays.equals(collection, new String[]{"A","B","C"}));
    }

    public void test3AdaptiveEstimateTransferTime() throws Exception {
        test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding;
        try {
            binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub)
                          new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        int[] value = null;
        value = binding.estimateTransferTime(true, new test.wsdl.adaptive.types.ResourceInfo(), new test.wsdl.adaptive.types.ResourceInfo[0], 0, java.util.Calendar.getInstance());
        // TBD - validate results
    }

    public void test4AdaptiveLogDataTransfer() throws Exception {
        test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding;
        try {
            binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub)
                          new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        binding.logDataTransfer(new test.wsdl.adaptive.types.ResourceInfo(), new test.wsdl.adaptive.types.ResourceInfo(), 0, java.util.Calendar.getInstance(), java.util.Calendar.getInstance());
        // TBD - validate results
    }

    public void test5AdaptiveEstimateUsage() throws Exception {
        test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding;
        try {
            binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub)
                          new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        java.lang.String value = null;
        value = binding.estimateUsage(true, new test.wsdl.adaptive.types.ResourceInfo(), new java.lang.String(), 0, java.util.Calendar.getInstance(), java.util.Calendar.getInstance());
        // TBD - validate results
    }

    public void test6AdaptiveEstimateMultipleUsage() throws Exception {
        test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding;
        try {
            binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub)
                          new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        java.lang.String[][] value = null;
        value = binding.estimateMultipleUsage(true, new test.wsdl.adaptive.types.ResourceInfo[0], new java.lang.String[0], 0, java.util.Calendar.getInstance(), java.util.Calendar.getInstance());
        // TBD - validate results
    }

    public void test7AdaptiveEstimateNetworkGraph() throws Exception {
        test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding;
        try {
            binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub)
                          new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);

        // Time out after a minute
        binding.setTimeout(60000);

        // Test operation
        java.lang.String[][] value = null;
        value = binding.estimateNetworkGraph(true, new test.wsdl.adaptive.types.ResourceInfo[0], 0, java.util.Calendar.getInstance(), java.util.Calendar.getInstance());
        // TBD - validate results
    }

}