[jboss-cvs] JBossAS SVN: r77477 - trunk/testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 26 05:03:11 EDT 2008


Author: alessio.soldano at jboss.com
Date: 2008-08-26 05:03:11 -0400 (Tue, 26 Aug 2008)
New Revision: 77477

Modified:
   trunk/testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/ApplicationClient.java
   trunk/testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
Log:
Fixing WebServiceRefClientTestCase


Modified: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/ApplicationClient.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/ApplicationClient.java	2008-08-26 08:59:00 UTC (rev 77476)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/ApplicationClient.java	2008-08-26 09:03:11 UTC (rev 77477)
@@ -22,8 +22,11 @@
 package org.jboss.test.ws.jaxws.webserviceref;
 
 import java.util.ArrayList;
+import java.util.Hashtable;
 
+import javax.naming.Context;
 import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import javax.xml.ws.WebServiceException;
 import javax.xml.ws.WebServiceRef;
 import javax.xml.ws.WebServiceRefs;
@@ -75,7 +78,18 @@
    public static TestEndpoint port3;
 
    public static InitialContext iniCtx;
-   public static String retStr;
+   
+   private static void setInitialCtx() throws NamingException
+   {
+      if (iniCtx == null)
+      {
+         InitialContext ctx = new InitialContext();
+         Hashtable env = ctx.getEnvironment();
+         env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
+         env.put("j2ee.clientName", "jbossws-client");
+         iniCtx = new InitialContext(env);
+      }
+   }
 
    public static void main(String[] args)
    {
@@ -85,22 +99,22 @@
       ArrayList<TestEndpoint> ports = new ArrayList<TestEndpoint>();
       try
       {
-         System.out.println("FIXME: EJBTHREE-760");
-         //ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/service1")).getTestEndpointPort());
-         //ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/service2")).getTestEndpointPort());
+         setInitialCtx();
+         ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/service1")).getTestEndpointPort());
+         ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/service2")).getTestEndpointPort());
          ports.add((TestEndpoint)service3.getPort(TestEndpoint.class));
-         //ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/TestEndpointService3")).getTestEndpointPort());
+         ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/TestEndpointService3")).getTestEndpointPort());
          ports.add((TestEndpoint)service4.getPort(TestEndpoint.class));
-         //ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/" + ApplicationClient.class.getName() + "/service4")).getTestEndpointPort());
+         ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/" + ApplicationClient.class.getName() + "/service4")).getTestEndpointPort());
          ports.add((TestEndpoint)service5.getPort(TestEndpoint.class));
-         //ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/TestEndpointService5")).getTestEndpointPort());
+         ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/TestEndpointService5")).getTestEndpointPort());
          ports.add((TestEndpoint)service6.getPort(TestEndpoint.class));
-         //ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/" + ApplicationClient.class.getName() + "/serviceSetter6")).getTestEndpointPort());
-         //ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/port1"));
+         ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/" + ApplicationClient.class.getName() + "/serviceSetter6")).getTestEndpointPort());
+         ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/port1"));
          ports.add(port2);
-         //ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/Port2"));
+         ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/Port2"));
          ports.add(port3);
-         //ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/" + ApplicationClient.class.getName() + "/port3"));
+         ports.add((TestEndpoint)iniCtx.lookup("java:comp/env/" + ApplicationClient.class.getName() + "/port3"));
       }
       catch (Exception ex)
       {
@@ -114,8 +128,6 @@
          if (inStr.equals(outStr) == false)
             throw new WebServiceException("Invalid echo return: " + inStr);
       }
-      
-      retStr = inStr;
    }
 
 }

Modified: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java	2008-08-26 08:59:00 UTC (rev 77476)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java	2008-08-26 09:03:11 UTC (rev 77477)
@@ -62,8 +62,6 @@
    public void testApplicationClient() throws Throwable
    {
       String helloWorld = "Hello World!";
-      ApplicationClient.iniCtx = getInitialContext();
       new ClientLauncher().launch(ApplicationClient.class.getName(), "jbossws-client",  new String[]{helloWorld});
-      assertEquals(helloWorld, ApplicationClient.retStr);
    }
 }




More information about the jboss-cvs-commits mailing list