[jboss-svn-commits] JBL Code SVN: r23548 - in labs/jbossesb/branches/JBESB_4_4_GA_CP: product/etc/schemas/xml and 11 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Oct 22 04:50:42 EDT 2008
Author: kevin.conner at jboss.com
Date: 2008-10-22 04:50:42 -0400 (Wed, 22 Oct 2008)
New Revision: 23548
Added:
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/META-INF/
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbm-service.xml
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbmq-service.xml
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/request.xsd
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/response.xsd
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/test-ebws-service.xml
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java
Modified:
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/docs/ProgrammersGuide.odt
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/etc/schemas/xml/jbossesb-1.0.1.xsd
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/message/MessagePayloadProxy.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/build.xml
Log:
Added support for alternate request/response locations: JBESB-1984
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/etc/schemas/xml/jbossesb-1.0.1.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2008-10-22 08:50:42 UTC (rev 23548)
@@ -366,6 +366,8 @@
<xsd:attribute name="mep" type="jesb:mepType" />
<xsd:attribute name="inXsd" type="xsd:string" />
<xsd:attribute name="outXsd" type="xsd:string" />
+ <xsd:attribute name="requestLocation" type="xsd:string"/>
+ <xsd:attribute name="responseLocation" type="xsd:string"/>
<xsd:attribute name="faultXsd" type="xsd:string" />
<xsd:attribute name="webservice" type="xsd:boolean" default="true"/>
<xsd:attribute name="validate" type="xsd:boolean" default="false"/>
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -49,6 +49,7 @@
import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Fault;
import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
import org.jboss.soa.esb.message.format.MessageFactory;
import org.w3c.dom.Document;
@@ -67,11 +68,15 @@
private static final Logger LOGGER = Logger.getLogger(BaseWebService.class);
protected final ServiceInvoker serviceInvoker ;
+ protected MessagePayloadProxy requestProxy ;
+ protected MessagePayloadProxy responseProxy ;
- protected BaseWebService(final String category, final String name)
+ protected BaseWebService(final String category, final String name, final String requestLocation, final String responseLocation)
throws MessageDeliverException
{
serviceInvoker = new ServiceInvoker(category, name) ;
+ requestProxy = new MessagePayloadProxy(null, requestLocation) ;
+ responseProxy = new MessagePayloadProxy(responseLocation, null) ;
}
public SOAPMessage invoke(final SOAPMessage request)
@@ -99,7 +104,7 @@
final ByteArrayOutputStream byteStream = new ByteArrayOutputStream() ;
YADOMUtil.serialize(node, new StreamResult(byteStream), true);
byteStream.close();
- esbReq.getBody().add(byteStream.toString()) ;
+ requestProxy.setPayload(esbReq, byteStream.toString()) ;
found = true ;
}
}
@@ -112,7 +117,7 @@
final Message esbRes = deliverMessage(esbReq) ;
if (esbRes != null)
{
- final Object input = esbRes.getBody().get() ;
+ final Object input = responseProxy.getPayload(esbRes) ;
if (input == null)
{
throw new SOAPException("Null response from service") ;
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -49,6 +49,8 @@
private final String namespace ;
private final boolean isOneWay ;
private final String action ;
+ private final String requestLocation ;
+ private final String responseLocation ;
public ESBServiceEndpointInfo(final Service service)
throws UnsupportedEncodingException {
@@ -85,10 +87,14 @@
LOGGER.warn("No response specified for RequestResponse service " + serviceCategory + ":" + serviceName) ;
}
}
+ requestLocation = actions.getRequestLocation() ;
+ responseLocation = actions.getResponseLocation() ;
}
else
{
isOneWay = false ;
+ requestLocation = null ;
+ responseLocation = null ;
}
}
@@ -152,6 +158,14 @@
return isOneWay ;
}
+ public String getRequestLocation() {
+ return requestLocation ;
+ }
+
+ public String getResponseLocation() {
+ return responseLocation ;
+ }
+
static
{
DEFAULT_ENCODING = AccessController.doPrivileged(new PrivilegedAction<String>() {
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -102,7 +102,8 @@
seiClass.getClassFile().addAttribute(attribute);
- final String constructorStr = "super(\"" + category + "\"," + "\"" + service + "\");";
+ final String constructorStr = "super(\"" +category + "\",\"" + service + "\"," +
+ getParamValue(epInfo.getRequestLocation()) + "," + getParamValue(epInfo.getResponseLocation()) + ");" ;
CtConstructor defaultConstructor = new CtConstructor(null, seiClass) ;
defaultConstructor.setBody(constructorStr) ;
seiClass.addConstructor(defaultConstructor) ;
@@ -115,4 +116,12 @@
e);
}
}
+
+ private String getParamValue(final String value) {
+ if (value == null) {
+ return "null" ;
+ } else {
+ return '"' + value + '"' ;
+ }
+ }
}
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -30,10 +30,10 @@
*/
public class OneWayBaseWebService extends BaseWebService
{
- protected OneWayBaseWebService(final String category, final String name)
+ protected OneWayBaseWebService(final String category, final String name, final String requestLocation, final String responseLocation)
throws MessageDeliverException
{
- super(category, name) ;
+ super(category, name, requestLocation, responseLocation) ;
}
@Override
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -40,10 +40,10 @@
private static final long TIMEOUT ;
private static final Logger LOGGER = Logger.getLogger(RequestResponseBaseWebService.class) ;
- protected RequestResponseBaseWebService(final String category, final String name)
+ protected RequestResponseBaseWebService(final String category, final String name, final String requestLocation, final String responseLocation)
throws MessageDeliverException
{
- super(category, name) ;
+ super(category, name, requestLocation, responseLocation) ;
}
@Override
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -26,8 +26,6 @@
package org.jboss.soa.esb.listeners;
import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.listeners.config.ScheduleProviderFactory;
-import org.jboss.soa.esb.schedule.ScheduleProvider;
public class ListenerTagNames
{
@@ -72,6 +70,8 @@
public static final String IN_XSD_ATTRIBUTE_TAG = "inXsd";
public static final String OUT_XSD_ATTRIBUTE_TAG = "outXsd";
public static final String FAULT_XSD_ATTRIBUTE_TAG = "faultXsd";
+ public static final String REQUEST_LOCATION_TAG = "requestLocation";
+ public static final String RESPONSE_LOCATION_TAG = "responseLocation";
public static final String VALIDATE_ATTRIBUTE_TAG = "validate";
public static final String WEBSERVICE_ATTRIBUTE_TAG = "webservice";
public static final String ACTION_ELEMENT_TAG = "action";
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -83,6 +83,18 @@
{
listenerConfigTree.setAttribute(ListenerTagNames.VALIDATE_ATTRIBUTE_TAG, Boolean.toString(actions.getValidate())) ;
}
+
+ final String requestLocation = actions.getRequestLocation() ;
+ if (requestLocation != null)
+ {
+ listenerConfigTree.setAttribute(ListenerTagNames.REQUEST_LOCATION_TAG, requestLocation) ;
+ }
+
+ final String responseLocation = actions.getResponseLocation() ;
+ if (responseLocation != null)
+ {
+ listenerConfigTree.setAttribute(ListenerTagNames.RESPONSE_LOCATION_TAG, responseLocation) ;
+ }
SecurityMapper.map(listenerConfigTree, listenerService);
List<Action> actionList = actions.getActionList();
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -57,6 +57,7 @@
import org.jboss.soa.esb.listeners.ListenerTagNames;
import org.jboss.soa.esb.listeners.message.errors.Factory;
import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
import org.jboss.soa.esb.message.Properties;
import org.jboss.soa.esb.services.persistence.MessageStore;
import org.jboss.soa.esb.services.security.PublicCryptoUtil;
@@ -105,6 +106,14 @@
* The response XSD.
*/
private final Schema responseSchema ;
+ /**
+ * The request payload proxy.
+ */
+ private MessagePayloadProxy requestPayloadProxy ;
+ /**
+ * The response payload proxy.
+ */
+ private MessagePayloadProxy responsePayloadProxy ;
/**
*
@@ -196,6 +205,8 @@
{
throw new ConfigurationException("Failed to parse the response schema: " + outXsd, saxe) ;
}
+ requestPayloadProxy = new MessagePayloadProxy(config.getAttribute(ListenerTagNames.REQUEST_LOCATION_TAG), null) ;
+ responsePayloadProxy = new MessagePayloadProxy(config.getAttribute(ListenerTagNames.RESPONSE_LOCATION_TAG), null) ;
}
else
{
@@ -589,11 +600,18 @@
String validationFailure = null ;
if (requestSchema != null)
{
- final Object input = message.getBody().get() ;
- if ((input == null) || !XMLHelper.validate(requestSchema, input.toString()))
+ try
{
- validationFailure = "Request validation failure: " + input ;
+ final Object input = requestPayloadProxy.getPayload(message) ;
+ if ((input == null) || !XMLHelper.validate(requestSchema, input.toString()))
+ {
+ validationFailure = "Request validation failure: " + input ;
+ }
}
+ catch (final MessageDeliverException mde)
+ {
+ validationFailure = mde.getMessage() ;
+ }
}
if (validationFailure == null)
{
@@ -676,11 +694,18 @@
{
if (responseSchema != null)
{
- final Object output = message.getBody().get() ;
- if ((output == null) || !XMLHelper.validate(responseSchema, output.toString()))
+ try
{
- validationFailure = "Response validation failure: " + output ;
+ final Object output = responsePayloadProxy.getPayload(message) ;
+ if ((output == null) || !XMLHelper.validate(responseSchema, output.toString()))
+ {
+ validationFailure = "Response validation failure: " + output ;
+ }
}
+ catch (final MessageDeliverException mde)
+ {
+ validationFailure = mde.getMessage() ;
+ }
}
if (validationFailure == null)
{
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/message/MessagePayloadProxy.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/message/MessagePayloadProxy.java 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/message/MessagePayloadProxy.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -126,6 +126,24 @@
new String[] {config.getAttribute(SET_PAYLOAD_LOCATION, Body.DEFAULT_LOCATION)});
}
+ /**
+ * Public constructor.
+ *
+ * @param config The component configuration.
+ */
+ public MessagePayloadProxy(String getPayloadLocation, String setPayloadLocation) {
+ if (getPayloadLocation == null)
+ {
+ getPayloadLocation = Body.DEFAULT_LOCATION ;
+ }
+ if (setPayloadLocation == null)
+ {
+ setPayloadLocation = Body.DEFAULT_LOCATION ;
+ }
+
+ setDataLocations(new String[] {getPayloadLocation}, new String[] {setPayloadLocation}) ;
+ }
+
private void setDataLocations(String[] getPayloadLocations, String[] setPayloadLocations) {
this.getPayloadLocations = Arrays.asList(getPayloadLocations);
this.setPayloadLocations = Arrays.asList(setPayloadLocations);
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/build.xml 2008-10-22 08:30:50 UTC (rev 23547)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/build.xml 2008-10-22 08:50:42 UTC (rev 23548)
@@ -167,6 +167,17 @@
</fileset>
<fileset dir="${qa.junit.resources}/server/aop"/>
</jar>
+ <jar jarfile="${qa.build.lib}/ebws-test.esb">
+ <fileset dir="${qa.junit.classes}">
+ <include name="org/jboss/soa/esb/server/ebws/*.class"/>
+ </fileset>
+ <fileset dir="${qa.junit.resources}/server/ebws">
+ <include name="test*.xml"/>
+ <include name="*.xsd"/>
+ <include name="esb-${org.jboss.soa.esb.qa.jmsprovider}-service.xml"/>
+ <include name="META-INF/*.xml"/>
+ </fileset>
+ </jar>
</target>
<target name="one-test" if="test" depends="jars"
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,32 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+ <providers>
+ <jms-jca-provider name="JBossMQ" connection-factory="ConnectionFactory">
+ <jms-bus busid="ebws_channel1">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/ebws1"/>
+ </jms-bus>
+ <jms-bus busid="ebws_channel2">
+ <jms-message-filter dest-type="QUEUE" dest-name="queue/ebws2"/>
+ </jms-bus>
+ </jms-jca-provider>
+ </providers>
+
+ <services>
+ <service category="TestEBWS" name="normal" description="EBWS service">
+ <listeners>
+ <jms-listener name="JBPM-ESBListener" busidref="ebws_channel1" maxThreads="1"/>
+ </listeners>
+ <actions inXsd='/request.xsd' outXsd='/response.xsd' validate='true'>
+ <action name="logAction" class="org.jboss.soa.esb.server.ebws.LogMessageAction"/>
+ </actions>
+ </service>
+ <service category="TestEBWS" name="alternate" description="EBWS service">
+ <listeners>
+ <jms-listener name="JBPM-ESBListener" busidref="ebws_channel2" maxThreads="1"/>
+ </listeners>
+ <actions inXsd='/request.xsd' outXsd='/response.xsd' validate='true' requestLocation='REQUEST_LOCATION' responseLocation='RESPONSE_LOCATION'>
+ <action name="logAction" class="org.jboss.soa.esb.server.ebws.LogMessageAction"/>
+ </actions>
+ </service>
+ </services>
+</jbossesb>
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbm-service.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbm-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbm-service.xml 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=ebws1"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=ebws1_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=ebws2"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=ebws2_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbm-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbmq-service.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbmq-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbmq-service.xml 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=ebws1">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=ebws1_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=ebws2">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.qa.junit.destination:service=Queue,name=ebws2_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbmq-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/request.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/request.xsd (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/request.xsd 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="sayHi" type="x1:sayHi"/>
+ <xs:complexType name="sayHi">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/request.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/response.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/response.xsd (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/response.xsd 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,8 @@
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="sayHiResponse" type="x1:sayHiResponse"/>
+ <xs:complexType name="sayHiResponse">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/response.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/test-ebws-service.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/test-ebws-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/test-ebws-service.xml 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <mbean name="jboss.esb:test=EBWSServer" code="org.jboss.soa.esb.server.ebws.EBWSServer"/>
+</server>
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/test-ebws-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,94 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.server.ebws;
+
+import java.util.ArrayList;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * MBean to monitor EBWS messages.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class EBWSServer implements EBWSServerMBean
+{
+ private final ArrayList<String> list = new ArrayList<String>() ;
+ private final Lock lock = new ReentrantLock() ;
+ private final Condition waitCondition = lock.newCondition() ;
+
+ public String[] waitForMessages(final int numberOfMessages)
+ {
+ final long startTime = System.currentTimeMillis() ;
+ final long endTime = startTime + 30000 ;
+ lock.lock() ;
+ try
+ {
+ while (list.size() != numberOfMessages)
+ {
+ final long now = System.currentTimeMillis() ;
+ final long waitPeriod = endTime - now ;
+ if (waitPeriod > 0)
+ {
+ try
+ {
+ waitCondition.await(waitPeriod, TimeUnit.MILLISECONDS) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ }
+ else
+ {
+ break ;
+ }
+ }
+ final String[] results = list.toArray(new String[0]) ;
+ list.clear() ;
+ final int numResults = results.length ;
+ for(int count = 0 ; count < numResults ; count++)
+ {
+ System.out.println("EBWS Server: Returning message[" + count + "]: " + results[count]) ;
+ }
+ return results ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+
+ public void logMessage(final String message)
+ {
+ lock.lock() ;
+ try
+ {
+ list.add(message) ;
+ System.out.println("EBWS Server: Adding message: " + message) ;
+ waitCondition.signal() ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.server.ebws;
+
+/**
+ * MBean to monitor EBWS messages.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public interface EBWSServerMBean
+{
+ public static final String OBJECT_NAME = "jboss.esb:test=EBWSServer";
+
+ public String[] waitForMessages(final int numberOfMessages) ;
+
+ public void logMessage(final String message) ;
+}
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,266 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.server.ebws;
+
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.couriers.FaultMessageException;
+import org.jboss.soa.esb.listeners.message.MessageValidationException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.testutils.StringUtils;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Test EBWS invocations.
+ *
+ * @author <a href='mailto:kevin.conner at jboss.com'>Kevin Conner</a>
+ */
+public class EBWSUnitTest extends JBossTestCase
+{
+ /**
+ * The name of the deployment archive.
+ */
+ private static final String ESB_ARCHIVE = "ebws-test.esb" ;
+
+ /**
+ * Construct the test case with the specified name.
+ * @param name The name of the test case.
+ */
+ public EBWSUnitTest(final String name)
+ {
+ super(name) ;
+ }
+
+ /**
+ * Test for normal request/response.
+ * @throws Exception For any failures.
+ */
+ public void testNormalRequestResponse()
+ throws Exception
+ {
+ runRequestResponseTest(null, null, EBWSUtil.NORMAL_SERVICE) ;
+ }
+
+ /**
+ * Test for alternate request/response.
+ * @throws Exception For any failures.
+ */
+ public void testAlternateRequestResponse()
+ throws Exception
+ {
+ runRequestResponseTest(EBWSUtil.REQUEST_LOCATION, EBWSUtil.RESPONSE_LOCATION, EBWSUtil.ALTERNATE_SERVICE) ;
+ }
+
+ /**
+ * Test for normal invalid request.
+ * @throws Exception For any failures.
+ */
+ public void testNormalInvalidRequest()
+ throws Exception
+ {
+ runInvalidRequestTest(null, EBWSUtil.NORMAL_SERVICE) ;
+ }
+
+ /**
+ * Test for alternate invalid request.
+ * @throws Exception For any failures.
+ */
+ public void testAlternateInvalidRequest()
+ throws Exception
+ {
+ runInvalidRequestTest(EBWSUtil.REQUEST_LOCATION, EBWSUtil.ALTERNATE_SERVICE) ;
+ }
+
+ /**
+ * Test for normal invalid response.
+ * @throws Exception For any failures.
+ */
+ public void testNormalInvalidResponse()
+ throws Exception
+ {
+ runInvalidResponseTest(null, EBWSUtil.NORMAL_SERVICE) ;
+ }
+
+ /**
+ * Test for alternate invalid response.
+ * @throws Exception For any failures.
+ */
+ public void testAlternateInvalidResponse()
+ throws Exception
+ {
+ runInvalidResponseTest(EBWSUtil.REQUEST_LOCATION, EBWSUtil.ALTERNATE_SERVICE) ;
+ }
+
+ /**
+ * Test for normal valid response through SOAP.
+ * @throws Exception for any failures.
+ */
+ public void testNormalSoapRequest()
+ throws Exception
+ {
+ runSoapRequestTest(EBWSUtil.NORMAL_SOAP_ENDPOINT) ;
+ }
+
+ /**
+ * Test for alternate valid response through SOAP.
+ * @throws Exception for any failures.
+ */
+ public void testAlternateSoapRequest()
+ throws Exception
+ {
+ runSoapRequestTest(EBWSUtil.ALTERNATE_SOAP_ENDPOINT) ;
+ }
+
+ private void runRequestResponseTest(final String requestLocation, final String responseLocation, final String name)
+ throws Exception
+ {
+ final Message message = MessageFactory.getInstance().getMessage() ;
+ if (requestLocation == null)
+ {
+ message.getBody().add(EBWSUtil.VALID_REQUEST) ;
+ }
+ else
+ {
+ message.getBody().add(requestLocation, EBWSUtil.VALID_REQUEST) ;
+ }
+ final ServiceInvoker serviceInvoker = new ServiceInvoker("TestEBWS", name) ;
+
+ final Message responseMessage = serviceInvoker.deliverSync(message, 30000) ;
+
+ final Object response ;
+ if (responseLocation == null)
+ {
+ response = responseMessage.getBody().get();
+ }
+ else
+ {
+ response = responseMessage.getBody().get(responseLocation) ;
+ }
+
+ assertEquals("Response Message", EBWSUtil.VALID_RESPONSE, response) ;
+ final String[] logs = waitForMessages(2) ;
+ assertNotNull("Log message", logs) ;
+ assertEquals("Log count", 2, logs.length) ;
+ assertTrue("Request log message", StringUtils.compareXMLContent(EBWSUtil.VALID_REQUEST, logs[0])) ;
+ assertTrue("Response log message", StringUtils.compareXMLContent(EBWSUtil.VALID_RESPONSE, logs[1])) ;
+ }
+
+ private void runInvalidRequestTest(final String requestLocation, final String name)
+ throws Exception
+ {
+ final Message message = MessageFactory.getInstance().getMessage() ;
+ if (requestLocation == null)
+ {
+ message.getBody().add(EBWSUtil.INVALID_REQUEST) ;
+ }
+ else
+ {
+ message.getBody().add(requestLocation, EBWSUtil.INVALID_REQUEST) ;
+ }
+ final ServiceInvoker serviceInvoker = new ServiceInvoker("TestEBWS", name) ;
+
+ try
+ {
+ serviceInvoker.deliverSync(message, 30000) ;
+ fail("Expected fault message") ;
+ }
+ catch (final FaultMessageException fme)
+ {
+ assertTrue("MessageValidationException cause, ", fme.getCause() instanceof MessageValidationException) ;
+ }
+ }
+
+ private void runInvalidResponseTest(final String requestLocation, final String name)
+ throws Exception
+ {
+ final Message message = MessageFactory.getInstance().getMessage() ;
+ if (requestLocation == null)
+ {
+ message.getBody().add(EBWSUtil.VALID_REQUEST) ;
+ }
+ else
+ {
+ message.getBody().add(requestLocation, EBWSUtil.VALID_REQUEST) ;
+ }
+ message.getBody().add(EBWSUtil.ERROR, "true") ;
+
+ final ServiceInvoker serviceInvoker = new ServiceInvoker("TestEBWS", name) ;
+
+ try
+ {
+ serviceInvoker.deliverSync(message, 30000) ;
+ fail("Expected fault message") ;
+ }
+ catch (final FaultMessageException fme)
+ {
+ assertTrue("MessageValidationException cause, ", fme.getCause() instanceof MessageValidationException) ;
+ }
+
+ final String[] logs = waitForMessages(2) ;
+ assertNotNull("Log message", logs) ;
+ assertEquals("Log count", 2, logs.length) ;
+ assertTrue("Request log message", StringUtils.compareXMLContent(EBWSUtil.VALID_REQUEST, logs[0])) ;
+ assertTrue("Response log message", StringUtils.compareXMLContent(EBWSUtil.INVALID_RESPONSE, logs[1])) ;
+ }
+
+ private void runSoapRequestTest(final String endpoint)
+ throws Exception
+ {
+ final HttpClient httpClient = new HttpClient() ;
+ final PostMethod postMethod = new PostMethod(endpoint) ;
+ final StringRequestEntity request = new StringRequestEntity(EBWSUtil.SOAP_REQUEST) ;
+ postMethod.setRequestEntity(request) ;
+
+ httpClient.executeMethod(postMethod) ;
+ final String response = postMethod.getResponseBodyAsString() ;
+ System.out.println("Response is " + response) ;
+ assertTrue("XML response", StringUtils.compareXMLContent(EBWSUtil.SOAP_RESPONSE, response)) ;
+
+ final String[] logs = waitForMessages(2) ;
+ assertNotNull("Log message", logs) ;
+ assertEquals("Log count", 2, logs.length) ;
+ assertTrue("Request log message", StringUtils.compareXMLContent(EBWSUtil.VALID_REQUEST, logs[0])) ;
+ assertTrue("Response log message", StringUtils.compareXMLContent(EBWSUtil.VALID_RESPONSE, logs[1])) ;
+ }
+
+ /**
+ * Create the test suite.
+ * @return The suite representing this test case.
+ */
+ public static Test suite()
+ throws Exception
+ {
+ return getDeploySetup(EBWSUnitTest.class, ESB_ARCHIVE);
+ }
+
+ private String[] waitForMessages(final int count)
+ throws Exception
+ {
+ return (String[]) getServer().invoke(new ObjectName(EBWSServerMBean.OBJECT_NAME), "waitForMessages",
+ new Integer[] {Integer.valueOf(count)}, new String[] { Integer.TYPE.getName() });
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.server.ebws;
+
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+
+import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.mx.util.MBeanServerLocator;
+
+/**
+ * EBWS Utility methods and constants.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class EBWSUtil
+{
+ public static final String VALID_REQUEST = "<say:sayHi xmlns:say=\"http://www.jboss.org/sayHi\"><say:arg0>Hello</say:arg0></say:sayHi>" ;
+ public static final String INVALID_REQUEST = "<say:sayHi xmlns:say=\"http://www.jboss.org/sayHiInvalid\"><say:arg0>Hello</say:arg0></say:sayHi>" ;
+ public static final String VALID_RESPONSE = "<say:sayHiResponse xmlns:say=\"http://www.jboss.org/sayHi\"><say:arg0>Hello Response</say:arg0></say:sayHiResponse>" ;
+ public static final String INVALID_RESPONSE = "<say:sayHiResponse xmlns:say=\"http://www.jboss.org/sayHiInvalid\"><say:arg0>Hello Response</say:arg0></say:sayHiResponse>" ;
+
+ public static final String REQUEST_LOCATION = "REQUEST_LOCATION" ;
+ public static final String RESPONSE_LOCATION = "RESPONSE_LOCATION" ;
+ public static final String NORMAL_SERVICE = "normal" ;
+ public static final String ALTERNATE_SERVICE = "alternate" ;
+ public static final String ERROR = "ERROR" ;
+
+ public static final String SOAP_REQUEST = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+ "<soap:Body>" + VALID_REQUEST + "</soap:Body></soap:Envelope>" ;
+
+ public static final String SOAP_RESPONSE = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+ "<soap:Header/><soap:Body>" + VALID_RESPONSE + "</soap:Body></soap:Envelope>" ;
+
+ public static final String NORMAL_SOAP_ENDPOINT = "http://127.0.0.1:8080/ebws-test/TestEBWS/normal" ;
+ public static final String ALTERNATE_SOAP_ENDPOINT = "http://127.0.0.1:8080/ebws-test/TestEBWS/alternate" ;
+
+ public static EBWSServerMBean getEBWSServerMBean()
+ throws MalformedObjectNameException
+ {
+ final MBeanServer server = MBeanServerLocator.locateJBoss();
+
+ return (EBWSServerMBean) MBeanProxyExt.create(EBWSServerMBean.class, EBWSServerMBean.OBJECT_NAME, server);
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java 2008-10-22 08:50:42 UTC (rev 23548)
@@ -0,0 +1,103 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.server.ebws;
+
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+
+import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Action class to attempt a suspend of a running jBPM process.
+ *
+ * @author <a href='mailto:Kevin.Conner at jboss.com'>Kevin Conner</a>
+ */
+public class LogMessageAction extends AbstractActionLifecycle implements ActionPipelineProcessor
+{
+ private final String requestLocation ;
+ private final String responseLocation ;
+
+ public LogMessageAction(final ConfigTree config)
+ {
+ final ConfigTree parent = config.getParent() ;
+ requestLocation = parent.getAttribute(ListenerTagNames.REQUEST_LOCATION_TAG) ;
+ responseLocation = parent.getAttribute(ListenerTagNames.RESPONSE_LOCATION_TAG) ;
+ }
+
+ public Message process(final Message message)
+ throws ActionProcessingException
+ {
+ final MBeanServer server = MBeanServerLocator.locateJBoss();
+
+ final EBWSServerMBean ebwsServer ;
+ try
+ {
+ ebwsServer = (EBWSServerMBean) MBeanProxyExt.create(EBWSServerMBean.class, EBWSServerMBean.OBJECT_NAME, server);
+ }
+ catch (final MalformedObjectNameException mone)
+ {
+ throw new ActionProcessingException("Error creating MBean proxy", mone) ;
+ }
+
+ final Body body = message.getBody() ;
+ final Object messageRequest ;
+ if (requestLocation != null)
+ {
+ messageRequest = body.get(requestLocation) ;
+ }
+ else
+ {
+ messageRequest = body.get() ;
+ }
+ final String contents = String.valueOf(messageRequest) ;
+ ebwsServer.logMessage(contents) ;
+
+ final String response = (message.getBody().get(EBWSUtil.ERROR) != null ? EBWSUtil.INVALID_RESPONSE : EBWSUtil.VALID_RESPONSE) ;
+ ebwsServer.logMessage(response) ;
+
+ if (responseLocation != null)
+ {
+ body.add(responseLocation, response) ;
+ }
+ else
+ {
+ body.add(response) ;
+ }
+ return message;
+ }
+
+ public void processException(final Message message, final Throwable th)
+ {
+ }
+
+ public void processSuccess(final Message message)
+ {
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
More information about the jboss-svn-commits
mailing list