KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > bpel > ws > production > ProviderTestCase


1 package org.jboss.test.bpel.ws.production;
2
3 import java.util.Properties JavaDoc;
4 import javax.naming.InitialContext JavaDoc;
5
6 import junit.framework.Test;
7
8 import org.jboss.test.webservice.WebserviceTestBase;
9
10 /**
11  * @author Alejandro Guízar
12  * @version $Revision: 43322 $ $Date: 2006-04-03 12:19:24 -0400 (Mon, 03 Apr 2006) $
13  */

14 public class ProviderTestCase extends WebserviceTestBase {
15
16   private HelloPT greeter;
17
18   public ProviderTestCase(String JavaDoc name) {
19     super(name);
20   }
21
22   protected void setUp() throws Exception JavaDoc {
23     InitialContext JavaDoc ctx = getClientContext();
24     // JNDI name bound to the service interface (in application-client.xml)
25
String JavaDoc serviceRefName = "service/Hello";
26     // lookup the service interface in the environment context
27
HelloWorldService service = (HelloWorldService) ctx.lookup("java:comp/env/" + serviceRefName);
28     // obtain the dynamic proxy for the web service port
29
greeter = service.getCallerPort();
30   }
31
32   public void testSayHello() throws Exception JavaDoc {
33     String JavaDoc greeting = greeter.sayHello("Popeye");
34     assertEquals("Hello, Popeye!", greeting);
35   }
36
37   public static Test suite() throws Exception JavaDoc {
38      return getDeploySetup(ProviderTestCase.class, "bpel-hello.ear");
39   }
40 }
Popular Tags