1 package org.codehaus.ivory;
2
3 import org.codehaus.ivory.plexus.IvoryTestCase;
4
5 import com.meterware.httpunit.WebResponse;
6 import com.meterware.servletunit.ServletUnitClient;
7
8 /***
9 * Tests the DefaultAxisService.
10 *
11 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
12 * @since Mar 9, 2003
13 */
14 public class DefaultAxisServiceTest
15 extends IvoryTestCase
16 {
17 public DefaultAxisServiceTest(String name)
18 {
19 super(name);
20 }
21
22 public void testAxisService() throws Exception
23 {
24 AxisService service = ( AxisService ) lookup( AxisService.ROLE );
25
26 assertNotNull( service.getAxisServer() );
27 }
28
29 public void testWSDLGeneration() throws Exception
30 {
31 assertValidWSDL( "Version", "getVersion" );
32 assertValidWSDL( "SparePartInfo", "getPartInfo" );
33 }
34
35 public void testVersionMethod() throws Exception
36 {
37 WebResponse response = newClient().getResponse("http://localhost/services/Version?method=getVersion");
38
39 String body = response.getText();
40 assertIsXml( body );
41 assertTrue( body.indexOf( "<getVersionReturn") > 0 );
42 }
43
44 public void testExposeService() throws Exception
45 {
46 ServletUnitClient client = newClient();
47
48 WebResponse response = client.getResponse("http://localhost/services/SparePartInfo?method=getPartInfo&PartSKU=test");
49
50 assertIsXml( response.getText() );
51 assertStringInBody( response, "<getPartInfoReturn" );
52 assertStringInBody( response, "test - Part Info" );
53 }
54
55 public void testComplexSerialization() throws Exception
56 {
57 ServletUnitClient client = newClient();
58
59 WebResponse response = client.getResponse("http://localhost/services/SparePartInfo?method=getSparePart");
60
61 assertIsXml( response.getText() );
62 assertStringInBody( response, "<SKU" );
63 }
64 }
65
This page was automatically generated by Maven