JBossWS SVN: r10832 - stack/native/branches.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-10-02 13:05:40 -0400 (Fri, 02 Oct 2009)
New Revision: 10832
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP06_JBPAPP-2874/
Log:
[JBPAPP-2874] Branch for patch.
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP06_JBPAPP-2874 (from rev 10831, stack/native/tags/jbossws-native-2.0.1.SP2_CP06)
15 years, 2 months
JBossWS SVN: r10831 - stack/native/trunk/modules/client.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-10-02 10:44:43 -0400 (Fri, 02 Oct 2009)
New Revision: 10831
Modified:
stack/native/trunk/modules/client/pom.xml
Log:
[JBWS-2757] Update manifest classpath entry
Modified: stack/native/trunk/modules/client/pom.xml
===================================================================
--- stack/native/trunk/modules/client/pom.xml 2009-10-02 14:44:20 UTC (rev 10830)
+++ stack/native/trunk/modules/client/pom.xml 2009-10-02 14:44:43 UTC (rev 10831)
@@ -48,7 +48,7 @@
<configuration>
<archive>
<manifestEntries>
- <Class-Path>jbossws-spi.jar jbossws-common.jar jbossws-framework.jar jbossws-native-core.jar jbossws-native-jaxrpc.jar jbossws-native-jaxws.jar jaxws-api.jar jsr181-api.jar jbossws-native-jaxws-ext.jar jbossws-native-saaj.jar activation.jar commons-logging.jar concurrent.jar javassist.jar jaxb-api.jar jaxb-impl.jar mail.jar jboss-xml-binding.jar netty.jar policy.jar stax-api.jar wsdl4j.jar</Class-Path>
+ <Class-Path>jbossws-spi.jar jbossws-common.jar jbossws-framework.jar jbossws-native-core.jar jbossws-native-jaxrpc.jar jbossws-native-jaxws.jar jaxws-api.jar jsr181-api.jar jbossws-native-jaxws-ext.jar jbossws-native-saaj.jar activation.jar commons-logging.jar concurrent.jar javassist.jar jaxb-api.jar jaxb-impl.jar mail.jar jboss-logging-spi.jar jboss-logging-log4j.jar jcl-over-slf4j.jar slf4j-api.jar slf4j-jboss-logging.jar jbosssx-client.jar jboss-javaee.jar jboss-xml-binding.jar netty.jar policy.jar stax-api.jar wsdl4j.jar</Class-Path>
</manifestEntries>
</archive>
</configuration>
15 years, 2 months
JBossWS SVN: r10830 - stack/cxf/trunk/modules/client.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-10-02 10:44:20 -0400 (Fri, 02 Oct 2009)
New Revision: 10830
Modified:
stack/cxf/trunk/modules/client/pom.xml
Log:
[JBWS-2757] Update manifest classpath entry
Modified: stack/cxf/trunk/modules/client/pom.xml
===================================================================
--- stack/cxf/trunk/modules/client/pom.xml 2009-10-02 14:43:27 UTC (rev 10829)
+++ stack/cxf/trunk/modules/client/pom.xml 2009-10-02 14:44:20 UTC (rev 10830)
@@ -197,7 +197,7 @@
<customClasspathLayout>$${artifact.artifactId}.$${artifact.extension}</customClasspathLayout>
</manifest>
<manifestEntries>
- <Class-Path>jbossws-framework.jar jaxws-api.jar stax-api.jar wstx.jar</Class-Path>
+ <Class-Path>jbossws-framework.jar jaxws-api.jar jboss-logging-spi.jar jboss-logging-log4j.jar jcl-over-slf4j.jar slf4j-api.jar slf4j-jboss-logging.jar stax-api.jar wstx.jar</Class-Path>
</manifestEntries>
</archive>
</configuration>
15 years, 2 months
JBossWS SVN: r10829 - framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1666.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-10-02 10:43:27 -0400 (Fri, 02 Oct 2009)
New Revision: 10829
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
Log:
[JBWS-2757] Simplify jbossws client dependencies
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2009-10-02 12:33:14 UTC (rev 10828)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2009-10-02 14:43:27 UTC (rev 10829)
@@ -90,13 +90,6 @@
}
cp.append(PS + jbc + FS + "jbossws-" + stackName + "-client.jar");
cp.append(PS + jbc + FS + "jboss-common-core.jar");
- cp.append(PS + jbc + FS + "jboss-logging-spi.jar");
- cp.append(PS + jbc + FS + "jboss-logging-log4j.jar");
- cp.append(PS + jbc + FS + "jcl-over-slf4j.jar");
- cp.append(PS + jbc + FS + "slf4j-api.jar");
- cp.append(PS + jbc + FS + "slf4j-jboss-logging.jar");
- cp.append(PS + jbc + FS + "jbosssx-client.jar");
- cp.append(PS + jbc + FS + "jboss-javaee.jar");
Runtime rt = Runtime.getRuntime();
15 years, 2 months
JBossWS SVN: r10828 - in stack/native/branches/ropalka/modules: core/src/main/java/org/jboss/wsf/stack/jbws and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-10-02 08:33:14 -0400 (Fri, 02 Oct 2009)
New Revision: 10828
Modified:
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandler.java
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
Log:
[JBWS-2674][JBWS-2754] providing exceptions test case (WIP)
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandler.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandler.java 2009-10-02 12:06:13 UTC (rev 10827)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandler.java 2009-10-02 12:33:14 UTC (rev 10828)
@@ -33,6 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandlerImpl;
import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.common.injection.InjectionHelper;
@@ -102,22 +103,34 @@
}
}
- public void handle(String method, InputStream inputStream, OutputStream outputStream, Map<String, Object> requestHeaders) throws IOException
+ public int handle(String method, InputStream inputStream, OutputStream outputStream, Map<String, Object> requestHeaders) throws IOException
{
- InvocationContext invCtx = new InvocationContext();
- invCtx.addAttachment(Map.class, requestHeaders);
- if (method.equals("POST"))
+ Integer statusCode = null;
+ try
{
- doPost(inputStream, outputStream, invCtx);
+ InvocationContext invCtx = new InvocationContext();
+ invCtx.addAttachment(Map.class, requestHeaders);
+ if (method.equals("POST"))
+ {
+ doPost(inputStream, outputStream, invCtx);
+ statusCode = invCtx.getAttachment(Integer.class);
+ }
+ else if (method.equals("GET"))
+ {
+ doGet(inputStream, outputStream, invCtx);
+ }
+ else
+ {
+ throw new WSException("Unsupported HTTP method: " + method);
+ }
}
- else if (method.equals("GET"))
+ catch(Exception e)
{
- doGet(inputStream, outputStream, invCtx);
+ logger.error(e.getMessage(), e);
+ statusCode = 500;
}
- else
- {
- throw new WSException("Unsupported method: " + method);
- }
+
+ return statusCode == null ? 200 : statusCode;
}
public final String getHandledPath()
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java 2009-10-02 12:06:13 UTC (rev 10827)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java 2009-10-02 12:33:14 UTC (rev 10828)
@@ -95,7 +95,8 @@
ChannelBuffer content = request.getContent();
OutputStream baos = new ByteArrayOutputStream();
OutputStream outputStream = new BufferedOutputStream(baos);
-
+ Integer statusCode = null;
+
Map<String, Object> requestHeaders = new HashMap<String, Object>();
for (String headerName : request.getHeaderNames())
{
@@ -111,16 +112,16 @@
requestPath = requestPath.substring(0, paramIndex);
}
String httpMethod = request.getMethod().getName();
- handle(requestPath, httpMethod, getInputStream(content), outputStream, requestHeaders);
+ statusCode = handle(requestPath, httpMethod, getInputStream(content), outputStream, requestHeaders);
}
catch (Throwable t)
{
- error = true;
+ statusCode = 500;
LOG.error(t);
}
finally
{
- writeResponse(e, request, error, baos.toString());
+ writeResponse(e, request, baos.toString(), statusCode);
}
}
@@ -129,7 +130,7 @@
return new ChannelBufferInputStream(content);
}
- private void handle(String requestPath, String httpMethod, InputStream inputStream, OutputStream outputStream, Map<String, Object> requestHeaders) throws IOException
+ private int handle(String requestPath, String httpMethod, InputStream inputStream, OutputStream outputStream, Map<String, Object> requestHeaders) throws IOException
{
boolean handlerExists = false;
String handledPath = null;
@@ -147,12 +148,13 @@
handlerExists = true;
if (LOG.isDebugEnabled())
LOG.debug("Handling request path: " + requestPath);
- handler.handle(httpMethod, inputStream, outputStream, requestHeaders);
- break;
+ return handler.handle(httpMethod, inputStream, outputStream, requestHeaders);
}
}
if (handlerExists == false)
LOG.warn("No callback handler registered for path: " + requestPath);
+
+ return 500;
}
private String truncateHostName(String s)
@@ -177,16 +179,14 @@
return retVal;
}
- private void writeResponse(MessageEvent e, HttpRequest request, boolean error, String content)
+ private void writeResponse(MessageEvent e, HttpRequest request, String content, Integer statusCode)
{
// Build the response object.
- HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, error ? HttpResponseStatus.INTERNAL_SERVER_ERROR : HttpResponseStatus.OK);
+ HttpResponseStatus status = statusCode == 500 ? HttpResponseStatus.INTERNAL_SERVER_ERROR : HttpResponseStatus.OK;
+ HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, status);
response.setHeader(HttpHeaders.Names.CONTENT_TYPE, "text/xml; charset=UTF-8");
- if (!error)
- {
- response.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(content.length()));
- response.setContent(ChannelBuffers.copiedBuffer(content, "UTF-8"));
- }
+ response.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(content.length()));
+ response.setContent(ChannelBuffers.copiedBuffer(content, "UTF-8"));
String cookieString = request.getHeader(HttpHeaders.Names.COOKIE);
if (cookieString != null)
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2009-10-02 12:06:13 UTC (rev 10827)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2009-10-02 12:33:14 UTC (rev 10828)
@@ -320,9 +320,13 @@
// by a null envelope.
SOAPEnvelope soapEnv = part.getEnvelope();
isFault = soapEnv != null && soapEnv.getBody().hasFault();
- if (httpResponse != null && isFault)
+ if (isFault)
{
- httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ invContext.addAttachment(Integer.class, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ if (httpResponse != null)
+ {
+ httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
}
}
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-02 12:06:13 UTC (rev 10827)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-02 12:33:14 UTC (rev 10828)
@@ -101,13 +101,18 @@
endpoint1.stop();
endpoint2.stop();
}
-
- /*
+
public void testEndpointException() throws Exception
{
- // TODO: provide test case where endpoint throws exception
+ String publishURL = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1";
+ Endpoint endpoint = publishEndpoint(Endpoint1Impl.class, publishURL);
+
+ invokeEndpoint3(publishURL);
+
+ endpoint.stop();
}
-
+
+ /*
public void testAttachments() throws Exception
{
// TODO: provide test case where client sends attachment
@@ -123,22 +128,16 @@
private void invokeEndpoint1(String publishURL) throws Exception
{
- URL wsdlURL = new URL(publishURL + "?wsdl");
- QName qname = new QName("http://org.jboss.ws/jaxws/endpoint/jse/endpoints/", "Endpoint1Impl");
- Service service = Service.create(wsdlURL, qname);
- Endpoint1Iface port = (Endpoint1Iface)service.getPort(Endpoint1Iface.class);
+ Endpoint1Iface port = this.getProxy(publishURL);
String helloWorld = "Hello world!";
Object retObj = port.echo(helloWorld);
assertEquals(helloWorld, retObj);
}
-
+
private void invokeEndpoint2(String publishURL) throws Exception
{
- URL wsdlURL = new URL(publishURL + "?wsdl");
- QName qname = new QName("http://org.jboss.ws/jaxws/endpoint/jse/endpoints/", "Endpoint1Impl");
- Service service = Service.create(wsdlURL, qname);
- Endpoint1Iface port = (Endpoint1Iface)service.getPort(Endpoint1Iface.class);
+ Endpoint1Iface port = this.getProxy(publishURL);
// Invoke the endpoint
String helloWorld = "Hello world!";
@@ -150,4 +149,27 @@
assertEquals(2, port.getCount());
}
+ private void invokeEndpoint3(String publishURL) throws Exception
+ {
+ Endpoint1Iface port = this.getProxy(publishURL);
+
+ try
+ {
+ port.getException();
+ fail("Failure expected");
+ }
+ catch (Exception e)
+ {
+ log.debug(e.getMessage());
+ }
+ }
+
+ private Endpoint1Iface getProxy(String publishURL) throws Exception
+ {
+ URL wsdlURL = new URL(publishURL + "?wsdl");
+ QName qname = new QName("http://org.jboss.ws/jaxws/endpoint/jse/endpoints/", "Endpoint1Impl");
+ Service service = Service.create(wsdlURL, qname);
+ return (Endpoint1Iface)service.getPort(Endpoint1Iface.class);
+ }
+
}
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java 2009-10-02 12:06:13 UTC (rev 10827)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Iface.java 2009-10-02 12:33:14 UTC (rev 10828)
@@ -35,4 +35,5 @@
{
String echo(String input);
int getCount();
+ void getException();
}
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java 2009-10-02 12:06:13 UTC (rev 10827)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/endpoints/Endpoint1Impl.java 2009-10-02 12:33:14 UTC (rev 10828)
@@ -22,6 +22,7 @@
package org.jboss.test.ws.jaxws.endpoint.jse.endpoints;
import javax.jws.WebService;
+import javax.xml.ws.WebServiceException;
/**
* Service implementation.
@@ -49,5 +50,10 @@
{
return count;
}
+
+ public void getException()
+ {
+ throw new WebServiceException("Ooops");
+ }
}
15 years, 2 months
JBossWS SVN: r10827 - stack/native/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-10-02 08:06:13 -0400 (Fri, 02 Oct 2009)
New Revision: 10827
Modified:
stack/native/trunk/modules/testsuite/test-excludes-jboss520.txt
stack/native/trunk/modules/testsuite/test-excludes-jboss600.txt
Log:
[JBWS-2726] Enable tests
Modified: stack/native/trunk/modules/testsuite/test-excludes-jboss520.txt
===================================================================
--- stack/native/trunk/modules/testsuite/test-excludes-jboss520.txt 2009-10-02 12:04:52 UTC (rev 10826)
+++ stack/native/trunk/modules/testsuite/test-excludes-jboss520.txt 2009-10-02 12:06:13 UTC (rev 10827)
@@ -10,6 +10,3 @@
# [JBWS-2674] Implement javax.xml.ws.Endpoint
org/jboss/test/ws/jaxws/endpoint/*TestCase.*
-# [JBMESSAGING-1718] JMS Queue MessageCount attribute isn't increased on message retrieval
-org/jboss/test/ws/jaxws/samples/dar/JMSClientTestCase.*
-
Modified: stack/native/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/native/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-10-02 12:04:52 UTC (rev 10826)
+++ stack/native/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-10-02 12:06:13 UTC (rev 10827)
@@ -10,6 +10,3 @@
# [JBWS-2674] Implement javax.xml.ws.Endpoint
org/jboss/test/ws/jaxws/endpoint/*TestCase.*
-# [JBMESSAGING-1718] JMS Queue MessageCount attribute isn't increased on message retrieval
-org/jboss/test/ws/jaxws/samples/dar/JMSClientTestCase.*
-
15 years, 2 months
JBossWS SVN: r10826 - in stack/native/trunk/modules/testsuite/native-tests: src/test/java/org/jboss/test/ws/jaxws/samples/dar and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-10-02 08:04:52 -0400 (Fri, 02 Oct 2009)
New Revision: 10826
Modified:
stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClientTestCase.java
Log:
[JBWS-2726] Directly get response message in testcase instead of having it consumed by the sample message bean
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml 2009-10-02 10:11:35 UTC (rev 10825)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml 2009-10-02 12:04:52 UTC (rev 10826)
@@ -112,6 +112,14 @@
<include name="jboss-service.xml"/>
</metainf>
</jar>
+ <jar jarfile="${tests.output.dir}/test-libs/jaxws-samples-dar-jms-client-test.sar">
+ <fileset dir="${tests.output.dir}/test-libs">
+ <include name="jaxws-samples-dar-jms-client.war"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/test-resources/jaxws/samples/dar/META-INF">
+ <include name="jboss-service.xml"/>
+ </metainf>
+ </jar>
<!-- jaxws-samples-jmstransport -->
<jar jarfile="${tests.output.dir}/test-libs/jaxws-samples-jmstransport.jar">
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClientTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClientTestCase.java 2009-10-02 10:11:35 UTC (rev 10825)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClientTestCase.java 2009-10-02 12:04:52 UTC (rev 10826)
@@ -27,11 +27,17 @@
import java.net.URL;
import java.util.Date;
-import javax.management.ObjectName;
+import javax.jms.MessageConsumer;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
import junit.framework.Test;
-import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -47,13 +53,12 @@
public static Test suite()
{
- return new JBossWSTestSetup(JMSClientTestCase.class, "jaxws-samples-dar-jms-client.sar,jaxws-samples-dar-jms.jar");
+ return new JBossWSTestSetup(JMSClientTestCase.class, "jaxws-samples-dar-jms-client-test.sar,jaxws-samples-dar-jms.jar");
}
public void test() throws Exception
{
String url = "http://" + getServerHost() + ":8080/dar-jms-client/JMSClient";
- int count = getMessageCount("DarResponseQueue");
Date start = new Date();
HttpURLConnection connection = (HttpURLConnection)new URL(url).openConnection();
int responseCode = connection.getResponseCode();
@@ -70,16 +75,18 @@
assertTrue(buffer.toString().contains("Request message sent, doing something interesting in the mean time... ;-) "));
Date stop = new Date();
assertTrue(stop.getTime() - start.getTime() < TEST_RUN_TIME / 2);
- Thread.sleep(TEST_RUN_TIME);
- assertEquals(count + 1, getMessageCount("DarResponseQueue"));
+
+ //receive the message
+ InitialContext context = new InitialContext();
+ QueueConnectionFactory connectionFactory = (QueueConnectionFactory)context.lookup("ConnectionFactory");
+ QueueConnection con = connectionFactory.createQueueConnection();
+ QueueSession session = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+ Queue resQueue = (Queue)context.lookup("queue/DarResponseQueue");
+ con.start();
+ MessageConsumer consumer = session.createConsumer(resQueue);
+ TextMessage textMessage = (TextMessage)consumer.receive(TEST_RUN_TIME);
+ String result = textMessage.getText();
+ assertTrue(result != null);
+ con.stop();
}
-
- private int getMessageCount(String queue) throws Exception
- {
- ObjectName oname = ObjectNameFactory.create("jboss.mq.destination:service=Queue,name=" + queue);
- Integer retVal = (Integer)getServer().getAttribute(oname, "MessageCount");
- System.out.println("MessageCount=" + retVal);
- return retVal;
- }
-
}
15 years, 2 months
JBossWS SVN: r10825 - in stack/native/branches/ropalka/modules: core/src/main/java/org/jboss/ws/core/jaxws/spi/http and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-10-02 06:11:35 -0400 (Fri, 02 Oct 2009)
New Revision: 10825
Modified:
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServer.java
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
Log:
[JBWS-2674][JBWS-2754] providing test cases (WIP)
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-10-02 10:10:22 UTC (rev 10824)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-10-02 10:11:35 UTC (rev 10825)
@@ -177,7 +177,10 @@
if (context instanceof HttpContext)
{
serverContext = (HttpContext)context;
- //address = getAddressFromConfigAndContext(serverContext); // TODO: is it necessary?
+ if (address == null)
+ {
+ address = getAddressFromConfigAndContext(serverContext); // TODO: is it necessary?
+ }
HttpServer httpServer = serverContext.getHttpServer();
httpServer.publish(serverContext, this);
isPublished = true;
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServer.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServer.java 2009-10-02 10:10:22 UTC (rev 10824)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServer.java 2009-10-02 10:11:35 UTC (rev 10825)
@@ -102,19 +102,22 @@
// TODO: should we use archive deployment - see META-INF/services ???
final ArchiveDeployment dep = (ArchiveDeployment) this.deploymentModelFactory.newDeployment(contextRoot, loader);
final org.jboss.wsf.spi.deployment.Endpoint endpoint = this.deploymentModelFactory.newEndpoint(endpointClass.getName());
- endpoint.setShortName(epImpl.getName());
+ endpoint.setShortName(epImpl.getName() + "-port-" + epImpl.getPort()); // we need to distinguish ports in endpoints registry
endpoint.setURLPattern(epImpl.getName()); // TODO: rename method
dep.getService().addEndpoint(endpoint);
dep.setRootFile(new ResourceLoaderAdapter(loader));
dep.setRuntimeClassLoader(loader);
dep.setType(DeploymentType.JAXWS_JSE);
dep.getService().setContextRoot(contextRoot);
+ // TODO: remove this properties hack
+ dep.getService().setProperty("protocol", "http");
+ dep.getService().setProperty("host", "127.0.0.1");
+ dep.getService().setProperty("port", epImpl.getPort());
DeploymentAspectManagerImpl daManager = new DeploymentAspectManagerImpl();
daManager.setDeploymentAspects(getDeploymentAspects());
daManager.deploy(dep);
epImpl.setDeployment(dep);
- // TODO: call DAManager.undeploy()
RealNettyHttpServer server = RealNettyHttpServer.getInstance("http", "localhost", epImpl.getPort());
NettyCallbackHandler callback = new NettyCallbackHandler(epImpl.getPath(), contextRoot, endpoint.getShortName());
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java 2009-10-02 10:10:22 UTC (rev 10824)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java 2009-10-02 10:11:35 UTC (rev 10825)
@@ -82,17 +82,19 @@
public int getWebServicePort()
{
- return 8878;
+ throw new UnsupportedOperationException();
+ //return 8878;
}
public int getWebServiceSecurePort()
{
- return 8879;
+ throw new UnsupportedOperationException();
+ //return 8879;
}
public boolean isModifySOAPAddress()
{
- return true;
+ return false;
}
public void setModifySOAPAddress(boolean flag)
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java 2009-10-02 10:10:22 UTC (rev 10824)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandler.java 2009-10-02 10:11:35 UTC (rev 10825)
@@ -137,9 +137,11 @@
for (NettyCallbackHandler handler : this.callbacks)
{
handledPath = truncateHostName(handler.getHandledPath());
+ /*
System.out.println("---");
System.out.println("Request path 2: " + requestPath);
System.out.println("Handled path 2: " + handledPath);
+ */
if (requestPath.equals(handledPath))
{
handlerExists = true;
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2009-10-02 10:10:22 UTC (rev 10824)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2009-10-02 10:11:35 UTC (rev 10825)
@@ -214,14 +214,14 @@
URL orgURL = new URL(orgLocation);
String protocol = orgURL.getProtocol();
String host = orgURL.getHost();
- int port = getPortForProtocol(protocol);
- String path = orgURL.getPath();
final boolean rewriteLocation =
ServerConfig.UNDEFINED_HOSTNAME.equals(host) ||
this.config.isModifySOAPAddress();
if (rewriteLocation)
{
+ int port = getPortForProtocol(protocol);
+ String path = orgURL.getPath();
String newLocation = new URL(protocol, wsdlHost, port, path).toString();
if (!newLocation.equals(orgLocation))
{
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2009-10-02 10:10:22 UTC (rev 10824)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2009-10-02 10:11:35 UTC (rev 10825)
@@ -139,14 +139,16 @@
// Get the URL pattern from the endpoint
String linkName = sepMetaData.getLinkName();
+ Endpoint endpoint = null;
if (linkName != null)
{
- Endpoint endpoint = dep.getService().getEndpointByName(linkName);
+ endpoint = dep.getService().getEndpointByName(linkName);
if (endpoint != null)
urlPattern = endpoint.getURLPattern();
}
// If not, derive the context root from the deployment
+ Integer port = (Integer)dep.getService().getProperty("port");
if (contextRoot == null)
{
String simpleName = dep.getSimpleName();
@@ -161,6 +163,10 @@
}
}
}
+ if (port == null)
+ {
+ port = -1;
+ }
// Default to "/*"
if (urlPattern == null)
@@ -175,7 +181,7 @@
sepMetaData.setURLPattern(urlPattern);
String servicePath = contextRoot + urlPattern;
- sepMetaData.setEndpointAddress(getServiceEndpointAddress(null, servicePath));
+ sepMetaData.setEndpointAddress(getServiceEndpointAddress(null, servicePath, port));
}
public static ObjectName createServiceEndpointID(Deployment dep, ServerEndpointMetaData sepMetaData)
@@ -214,7 +220,7 @@
/** Get the web service address for a given path
*/
- public static String getServiceEndpointAddress(String uriScheme, String servicePath)
+ public static String getServiceEndpointAddress(String uriScheme, String servicePath, int servicePort)
{
if (servicePath == null || servicePath.length() == 0)
throw new WSException("Service path cannot be null");
@@ -230,22 +236,29 @@
String host = config.getWebServiceHost();
String port = "";
- if ("https".equals(uriScheme))
+ if (servicePort != -1)
{
- int portNo = config.getWebServiceSecurePort();
- if (portNo != 443)
- {
- port = ":" + portNo;
- }
-
+ port = ":" + servicePort;
}
else
{
- int portNo = config.getWebServicePort();
- if (portNo != 80)
+ if ("https".equals(uriScheme))
{
- port = ":" + portNo;
+ int portNo = config.getWebServiceSecurePort();
+ if (portNo != 443)
+ {
+ port = ":" + portNo;
+ }
+
}
+ else
+ {
+ int portNo = config.getWebServicePort();
+ if (portNo != 80)
+ {
+ port = ":" + portNo;
+ }
+ }
}
String urlStr = uriScheme + "://" + host + port + servicePath;
@@ -319,17 +332,18 @@
if ("CONFIDENTIAL".equals(transportGuarantee))
uriScheme = "https";
- String servicePath = sepMetaData.getContextRoot() + sepMetaData.getURLPattern();
- String serviceEndpointURL = getServiceEndpointAddress(uriScheme, servicePath);
-
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
ServerConfig config = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
boolean alwaysModify = config.isModifySOAPAddress();
if (alwaysModify || uriScheme == null || orgAddress.indexOf("REPLACE_WITH_ACTUAL_URL") >= 0)
{
+ String servicePath = sepMetaData.getContextRoot() + sepMetaData.getURLPattern();
+ String serviceEndpointURL = getServiceEndpointAddress(uriScheme, servicePath, -1);
+
if (log.isDebugEnabled())
log.debug("Replace service endpoint address '" + orgAddress + "' with '" + serviceEndpointURL + "'");
+
wsdlEndpoint.setAddress(serviceEndpointURL);
sepMetaData.setEndpointAddress(serviceEndpointURL);
Modified: stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2009-10-02 10:10:22 UTC (rev 10824)
+++ stack/native/branches/ropalka/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2009-10-02 10:11:35 UTC (rev 10825)
@@ -588,7 +588,7 @@
}
else
{
- if (context.getAttachment(Map.class) != null) // TODO: remove this ugly hack
+ if (context != null && context.getAttachment(Map.class) != null) // TODO: remove this ugly hack
{
handleWSDLRequestFromInvocationContext(endpoint, outStream, context);
}
Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java
===================================================================
--- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-02 10:10:22 UTC (rev 10824)
+++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/jse/UsecasesTestCase.java 2009-10-02 10:11:35 UTC (rev 10825)
@@ -39,8 +39,8 @@
*/
public final class UsecasesTestCase extends JBossWSTest
{
- private int port1 = 8878; // 8878
- private int port2 = 8878; // 8878
+ private int port1 = 8871;
+ private int port2 = 8872;
public void testTwoPorts() throws Exception
{
@@ -86,11 +86,33 @@
endpoint1.stop();
endpoint2.stop();
}
-
+
public void testTwoPortsAndIdenticalPaths() throws Exception
{
- // TODO: provide test port1/service1 vs. port2/service1
+ String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1";
+ Endpoint endpoint1 = publishEndpoint(Endpoint1Impl.class, publishURL1);
+
+ String publishURL2 = "http://" + getServerHost() + ":" + port2 + "/jaxws-endpoint/endpoint/number1";
+ Endpoint endpoint2 = publishEndpoint(new Endpoint1Impl(), publishURL2);
+
+ invokeEndpoint2(publishURL1);
+ invokeEndpoint2(publishURL2);
+
+ endpoint1.stop();
+ endpoint2.stop();
}
+
+ /*
+ public void testEndpointException() throws Exception
+ {
+ // TODO: provide test case where endpoint throws exception
+ }
+
+ public void testAttachments() throws Exception
+ {
+ // TODO: provide test case where client sends attachment
+ }
+ */
private Endpoint publishEndpoint(Object epImpl, String publishURL)
{
15 years, 2 months