1 package org.codehaus.xfire.plexus.config;
2
3 import org.codehaus.xfire.plexus.PlexusXFireTest;
4 import org.codehaus.xfire.service.object.ObjectService;
5 import org.dom4j.Document;
6
7 /***
8 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
9 * @since Sep 20, 2004
10 */
11 public class ConfigurationTest
12 extends PlexusXFireTest
13 {
14 public void setUp()
15 throws Exception
16 {
17 System.setProperty("xfire.config", "/org/codehaus/xfire/plexus/config/services.xml");
18 super.setUp();
19
20 lookup(ConfigurationService.ROLE);
21 }
22
23 public void testRegister()
24 throws Exception
25 {
26 ObjectService service = (ObjectService) getServiceRegistry().getService("Echo");
27
28 assertNotNull(service);
29
30 service = (ObjectService) getServiceRegistry().getService("EchoXMLBeans");
31 assertNotNull( service );
32
33 service = (ObjectService) getServiceRegistry().getService("EchoWSDL");
34 assertNotNull( service );
35 assertEquals(1, service.getOperations().size());
36 }
37
38 public void testInvoke()
39 throws Exception
40 {
41 Document response = invokeService("Echo", "/org/codehaus/xfire/plexus/config/echo11.xml");
42
43 addNamespace("e", "urn:Echo");
44 assertValid("//e:out[text()='Yo Yo']", response);
45
46 response = invokeService("EchoIntf", "/org/codehaus/xfire/plexus/config/echo11.xml");
47
48 addNamespace("e", "urn:Echo");
49 assertValid("//e:out[text()='Yo Yo']", response);
50 }
51 }