[jboss-svn-commits] JBL Code SVN: r25073 - in labs/jbossesb/trunk: product/etc/schemas/xml and 12 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Feb 3 10:31:00 EST 2009
Author: kevin.conner at jboss.com
Date: 2009-02-03 10:31:00 -0500 (Tue, 03 Feb 2009)
New Revision: 25073
Added:
labs/jbossesb/trunk/qa/junit/resources/server/ebws/
labs/jbossesb/trunk/qa/junit/resources/server/ebws/META-INF/
labs/jbossesb/trunk/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml
labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbm-service.xml
labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbmq-service.xml
labs/jbossesb/trunk/qa/junit/resources/server/ebws/request.xsd
labs/jbossesb/trunk/qa/junit/resources/server/ebws/response.xsd
labs/jbossesb/trunk/qa/junit/resources/server/ebws/test-ebws-service.xml
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java
Removed:
labs/jbossesb/trunk/qa/junit/resources/server/ebws/META-INF/
labs/jbossesb/trunk/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml
labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbm-service.xml
labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbmq-service.xml
labs/jbossesb/trunk/qa/junit/resources/server/ebws/request.xsd
labs/jbossesb/trunk/qa/junit/resources/server/ebws/response.xsd
labs/jbossesb/trunk/qa/junit/resources/server/ebws/test-ebws-service.xml
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java
Modified:
labs/jbossesb/trunk/product/docs/ProgrammersGuide.odt
labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/WebserviceInfo.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/ActionMapper.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/XMLBeansModel.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/MessagePayloadProxy.java
labs/jbossesb/trunk/qa/junit/build.xml
Log:
Add validation support for EBWS legacy locations: JBESB-1984
Modified: labs/jbossesb/trunk/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd
===================================================================
--- labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -48,6 +48,8 @@
private final String namespace ;
private final boolean isOneWay ;
private final String action ;
+ private final String requestLocation ;
+ private final String responseLocation ;
public ESBServiceEndpointInfo(final WebserviceInfo webserviceInfo)
throws UnsupportedEncodingException {
@@ -82,6 +84,8 @@
LOGGER.warn("No response specified for RequestResponse service " + serviceCategory + ":" + serviceName) ;
}
}
+ requestLocation = webserviceInfo.getRequestLocation() ;
+ responseLocation = webserviceInfo.getResponseLocation() ;
}
public String getRequestName() {
@@ -144,6 +148,14 @@
return isOneWay ;
}
+ public String getRequestLocation() {
+ return requestLocation ;
+ }
+
+ public String getResponseLocation() {
+ return responseLocation ;
+ }
+
static
{
DEFAULT_ENCODING = AccessController.doPrivileged(new PrivilegedAction<String>() {
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayBaseWebService.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseBaseWebService.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -26,7 +26,6 @@
package org.jboss.soa.esb.listeners;
import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.schedule.ScheduleProvider;
public class ListenerTagNames
{
@@ -72,6 +71,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/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/WebserviceInfo.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/WebserviceInfo.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/WebserviceInfo.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -52,6 +52,14 @@
* The service request/response flag.
*/
private final boolean requestResponse ;
+ /**
+ * The request location within the message.
+ */
+ private final String requestLocation ;
+ /**
+ * The response location within the message.
+ */
+ private final String responseLocation ;
/**
* Construct the webservice information.
@@ -65,12 +73,32 @@
public WebserviceInfo(final Service service, final String inXsd, final String outXsd,
final String faultXsd, final String description, final boolean requestResponse)
{
+ this(service, inXsd, outXsd, faultXsd, description, requestResponse, null, null) ;
+ }
+
+ /**
+ * Construct the webservice information.
+ * @param service The associated service details.
+ * @param inXsd The input schema.
+ * @param outXsd The output schema.
+ * @param faultXsd The fault schemas.
+ * @param description The service description.
+ * @param requestResponse The service request/response flag.
+ * @param requestLocation The request location within the message.
+ * @param responseLocation The response location within the message.
+ */
+ public WebserviceInfo(final Service service, final String inXsd, final String outXsd,
+ final String faultXsd, final String description, final boolean requestResponse,
+ final String requestLocation, final String responseLocation)
+ {
this.service = service ;
this.inXsd = inXsd ;
this.outXsd = outXsd ;
this.faultXsd = faultXsd ;
this.description = description ;
this.requestResponse = requestResponse ;
+ this.requestLocation = requestLocation ;
+ this.responseLocation = responseLocation ;
}
/**
@@ -128,6 +156,24 @@
}
/**
+ * Get the request location within the message.
+ * @return The request location.
+ */
+ public String getRequestLocation()
+ {
+ return requestLocation ;
+ }
+
+ /**
+ * Get the response location within the message.
+ * @return The response location.
+ */
+ public String getResponseLocation()
+ {
+ return responseLocation ;
+ }
+
+ /**
* Test for equality.
* @param obj The object to compare with
* @return true if equal, false otherwise.
@@ -140,7 +186,9 @@
return (service.equals(webserviceInfo.getService()) && objEquals(inXsd, webserviceInfo.inXsd) &&
objEquals(outXsd, webserviceInfo.outXsd) && objEquals(faultXsd, webserviceInfo.faultXsd) &&
objEquals(description, webserviceInfo.description) &&
- (requestResponse == webserviceInfo.isRequestResponse())) ;
+ (requestResponse == webserviceInfo.isRequestResponse()) &&
+ objEquals(requestLocation, webserviceInfo.requestLocation) &&
+ objEquals(responseLocation, webserviceInfo.responseLocation)) ;
}
return false ;
@@ -152,7 +200,8 @@
*/
public int hashCode()
{
- return service.hashCode() ^ objHash(inXsd) ^ objHash(outXsd) ^ objHash(faultXsd) & objHash(description) ^ (requestResponse ? 0xdeafdeaf : 0) ;
+ return service.hashCode() ^ objHash(inXsd) ^ objHash(outXsd) ^ objHash(faultXsd) & objHash(description) ^ (requestResponse ? 0xdeafdeaf : 0) ^
+ objHash(requestLocation) ^ objHash(responseLocation) ;
}
/**
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/ActionMapper.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/ActionMapper.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/ActionMapper.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -82,6 +82,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/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/XMLBeansModel.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/XMLBeansModel.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/XMLBeansModel.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -515,7 +515,8 @@
final WebserviceInfo webserviceInfo = new WebserviceInfo(
new org.jboss.soa.esb.Service(service.getCategory(), service.getName()),
actions.getInXsd(), actions.getOutXsd(), actions.getFaultXsd(),
- service.getDescription(), MepType.REQUEST_RESPONSE.equals(actions.getMep())) ;
+ service.getDescription(), MepType.REQUEST_RESPONSE.equals(actions.getMep()),
+ actions.getRequestLocation(), actions.getResponseLocation()) ;
endpointServices.add(webserviceInfo) ;
}
}
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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/trunk/product/rosetta/src/org/jboss/soa/esb/message/MessagePayloadProxy.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/MessagePayloadProxy.java 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/MessagePayloadProxy.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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/trunk/qa/junit/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/build.xml 2009-02-03 14:45:01 UTC (rev 25072)
+++ labs/jbossesb/trunk/qa/junit/build.xml 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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"
Copied: labs/jbossesb/trunk/qa/junit/resources/server/ebws (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws)
Copied: labs/jbossesb/trunk/qa/junit/resources/server/ebws/META-INF (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/META-INF)
Deleted: labs/jbossesb/trunk/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 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,32 +0,0 @@
-<?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>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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.1.0.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>
Deleted: labs/jbossesb/trunk/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 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbm-service.xml 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,27 +0,0 @@
-<?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>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbm-service.xml (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbm-service.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbm-service.xml (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbm-service.xml 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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>
Deleted: labs/jbossesb/trunk/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 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbmq-service.xml 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,27 +0,0 @@
-<?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>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbmq-service.xml (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/esb-jbmq-service.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbmq-service.xml (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/esb-jbmq-service.xml 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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>
Deleted: labs/jbossesb/trunk/qa/junit/resources/server/ebws/request.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/request.xsd 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/request.xsd 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,8 +0,0 @@
-<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>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/ebws/request.xsd (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/request.xsd)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/ebws/request.xsd (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/request.xsd 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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>
Deleted: labs/jbossesb/trunk/qa/junit/resources/server/ebws/response.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/response.xsd 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/response.xsd 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,8 +0,0 @@
-<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>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/ebws/response.xsd (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/response.xsd)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/ebws/response.xsd (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/response.xsd 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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>
Deleted: labs/jbossesb/trunk/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 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/test-ebws-service.xml 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
- <mbean name="jboss.esb:test=EBWSServer" code="org.jboss.soa.esb.server.ebws.EBWSServer"/>
-</server>
Copied: labs/jbossesb/trunk/qa/junit/resources/server/ebws/test-ebws-service.xml (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/test-ebws-service.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/resources/server/ebws/test-ebws-service.xml (rev 0)
+++ labs/jbossesb/trunk/qa/junit/resources/server/ebws/test-ebws-service.xml 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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>
Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws)
Deleted: labs/jbossesb/trunk/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 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,94 +0,0 @@
-/*
-* 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() ;
- }
- }
-}
Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServer.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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() ;
+ }
+ }
+}
Deleted: labs/jbossesb/trunk/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 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,36 +0,0 @@
-/*
-* 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) ;
-}
Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSServerMBean.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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) ;
+}
Deleted: labs/jbossesb/trunk/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 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,266 +0,0 @@
-/*
- * 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() });
- }
-}
Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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() });
+ }
+}
Deleted: labs/jbossesb/trunk/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 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,64 +0,0 @@
-/*
-* 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);
- }
-}
Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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);
+ }
+}
Deleted: labs/jbossesb/trunk/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 2008-10-22 08:50:42 UTC (rev 23548)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -1,103 +0,0 @@
-/*
-* 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)
- {
- }
-}
Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java (from rev 23548, labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java 2009-02-03 15:31:00 UTC (rev 25073)
@@ -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)
+ {
+ }
+}
More information about the jboss-svn-commits
mailing list