1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.geronimo.ews.ws4j2ee.seviceRef;
18
19 import java.io.FileInputStream;
20
21 import junit.framework.Assert;
22
23 import org.apache.geronimo.ews.AbstractTestCase;
24 import org.apache.geronimo.ews.ws4j2ee.context.webservices.client.interfaces.ServiceReferanceContext;
25 import org.apache.geronimo.ews.ws4j2ee.parsers.ServiceReferanceParser;
26
27 /***
28 * @author hemapani
29 */
30 public class ServiceRefTest extends AbstractTestCase{
31 /***
32 * @param testName
33 */
34 public ServiceRefTest(String testName) {
35 super(testName);
36 }
37
38 public void testRefFile1() throws Exception{
39 try {
40 ServiceReferanceParser parser
41 = new ServiceReferanceParser(new FileInputStream(
42 getTestFile(testDir+"org/apache/geronimo/ews/" +
43 "ws4j2ee/seviceRef/service-ref1.xml")));
44 ServiceReferanceContext ref = parser.getRef();
45 Assert.assertEquals("service/Joe",ref.getServicerefName());
46 Assert.assertEquals("javax.xml.rpc.Service",ref.getServiceInterface());
47 Assert.assertEquals("WEB-INF/joe.xml",ref.getJaxrpcmappingFile());
48 Assert.assertEquals("WEB-INF/joe.wsdl",ref.getWsdlFile());
49 } catch (Exception e) {
50 e.printStackTrace();
51 throw e;
52 }
53 }
54 public void testRefFile2() throws Exception{
55 try {
56 ServiceReferanceParser parser
57 = new ServiceReferanceParser(new FileInputStream(
58 getTestFile(testDir+"org/apache/geronimo/ews/ws4j2ee/" +
59 "seviceRef/service-ref2.xml")));
60 ServiceReferanceContext ref = parser.getRef();
61 Assert.assertEquals("service/Joe",ref.getServicerefName());
62 Assert.assertEquals("javax.xml.rpc.Service",ref.getServiceInterface());
63
64 Assert.assertEquals("WEB-INF/joe.xml",ref.getJaxrpcmappingFile());
65 Assert.assertEquals("WEB-INF/joe.wsdl",ref.getWsdlFile());
66 } catch (Exception e) {
67 e.printStackTrace();
68 throw e;
69 }
70 }
71 }