Author: alessio.soldano(a)jboss.com
Date: 2008-08-26 08:06:12 -0400 (Tue, 26 Aug 2008)
New Revision: 8137
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java
Log:
Fixing regression due to JBAS-5457
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java 2008-08-26
11:49:41 UTC (rev 8136)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java 2008-08-26
12:06:12 UTC (rev 8137)
@@ -22,8 +22,11 @@
package org.jboss.test.ws.jaxws.samples.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;
@@ -85,7 +88,18 @@
static Endpoint port5;
static InitialContext iniCtx;
- 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)
{
@@ -95,6 +109,7 @@
ArrayList<Endpoint> ports = new ArrayList<Endpoint>();
try
{
+ setInitialCtx();
ports.add(((EndpointService)iniCtx.lookup("java:comp/env/service1")).getEndpointPort());
ports.add(((EndpointService)iniCtx.lookup("java:comp/env/service2")).getEndpointPort());
ports.add((Endpoint)service3.getPort(Endpoint.class));
@@ -125,7 +140,5 @@
if (inStr.equals(outStr) == false)
throw new WebServiceException("Invalid echo return: " + inStr);
}
-
- retStr = inStr;
}
}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java 2008-08-26
11:49:41 UTC (rev 8136)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefClientTestCase.java 2008-08-26
12:06:12 UTC (rev 8137)
@@ -75,9 +75,6 @@
public void testApplicationClient() throws Throwable
{
String helloWorld = "Hello World!";
- EndpointClientOne.iniCtx = getInitialContext();
-
new ClientLauncher().launch(EndpointClientOne.class.getName(),
"jbossws-client", new String[] { helloWorld });
- assertEquals(helloWorld, EndpointClientOne.retStr);
}
}
Show replies by date