1 package org.codehaus.xfire.message.document;
2
3 import org.codehaus.xfire.service.object.DefaultObjectService;
4 import org.codehaus.xfire.soap.Soap11;
5 import org.codehaus.xfire.soap.SoapConstants;
6 import org.codehaus.xfire.test.AbstractXFireTypeTest;
7 import org.dom4j.Document;
8
9 /***
10 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
11 * @since Feb 21, 2004
12 */
13 public class DocumentServiceTest
14 extends AbstractXFireTypeTest
15 {
16 public void setUp() throws Exception
17 {
18 super.setUp();
19
20 DefaultObjectService service = (DefaultObjectService)
21 getServiceBuilder().create(DocumentService.class,
22 "Doc",
23 "urn:Doc",
24 Soap11.getInstance(),
25 SoapConstants.STYLE_DOCUMENT,
26 SoapConstants.USE_LITERAL);
27 }
28
29 public void testNoParams() throws Exception
30 {
31 Document response =
32 invokeService( "Doc", "/org/codehaus/xfire/message/document/document11-1.xml" );
33
34 addNamespace( "d", "urn:Doc");
35 assertValid( "//d:getString1out", response );
36 assertValid( "//d:getString1out[text()=\"string\"]", response );
37 }
38
39 public void testOneParam() throws Exception
40 {
41 Document response =
42 invokeService( "Doc", "/org/codehaus/xfire/message/document/document11-2.xml" );
43
44 addNamespace( "d", "urn:Doc");
45 assertValid( "//d:getString2out", response );
46 assertValid( "//d:getString2out[text()=\"bleh\"]", response );
47 }
48
49 public void testTwoParams() throws Exception
50 {
51 Document response =
52 invokeService( "Doc", "/org/codehaus/xfire/message/document/document11-3.xml" );
53
54 addNamespace( "d", "urn:Doc");
55 assertValid( "//d:getString3out", response );
56 assertValid( "//d:getString3out[text()=\"blehbleh2\"]", response );
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 }