Author: bbrodt
Date: 2010-05-28 16:37:17 -0400 (Fri, 28 May 2010)
New Revision: 681
Added:
trunk/stress-tests/lib/
trunk/stress-tests/lib/commons-httpclient-3.1.jar
trunk/stress-tests/lib/jboss-logging-spi-2.1.0.GA.jar
trunk/stress-tests/lib/jbossesb-rosetta-4.7.jar
trunk/stress-tests/lib/jetty-util-6.1.12rc1.jar
trunk/stress-tests/lib/log4j-1.2.14.jar
trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/performance/
trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/performance/PerformanceTestCase.java
trunk/stress-tests/src/test/resources/performance/
trunk/stress-tests/src/test/resources/performance/bpel/
trunk/stress-tests/src/test/resources/performance/bpel/HelloWorldWS.wsdl
trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.bpel
trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.cbp
trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.wsdl
trunk/stress-tests/src/test/resources/performance/bpel/bpel-deploy.xml
trunk/stress-tests/src/test/resources/performance/build.xml
trunk/stress-tests/src/test/resources/performance/messages/
trunk/stress-tests/src/test/resources/performance/messages/hello_request1.xml
trunk/stress-tests/src/test/resources/performance/messages/hello_request2.xml
trunk/stress-tests/src/test/resources/performance/war/
trunk/stress-tests/src/test/resources/performance/war/resources/
trunk/stress-tests/src/test/resources/performance/war/resources/WEB-INF/
trunk/stress-tests/src/test/resources/performance/war/resources/WEB-INF/classes/
trunk/stress-tests/src/test/resources/performance/war/resources/WEB-INF/lib/
trunk/stress-tests/src/test/resources/performance/war/resources/WEB-INF/web.xml
trunk/stress-tests/src/test/resources/performance/war/src/
trunk/stress-tests/src/test/resources/performance/war/src/org/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/bpel/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/bpel/samples/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/bpel/samples/quickstart/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/bpel/samples/quickstart/simple_invoke/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/bpel/samples/quickstart/simple_invoke/HelloWorldWS.java
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/TeargasConst.java
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/AbstractMessageGenerator.java
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/ImmediateMessageGenerator.java
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/QSMessageGenerator.java
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/sender/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/sender/HTTPSender.java
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/sender/MessageSender.java
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/qs/
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/qs/QSRunTest.java
trunk/stress-tests/src/test/resources/performance/war/view/
trunk/stress-tests/src/test/resources/performance/war/view/index.jsp
Modified:
trunk/stress-tests/.classpath
trunk/stress-tests/build.xml
trunk/stress-tests/pom.xml
trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTest.java
trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw155TestCase.java
trunk/stress-tests/src/test/resources/testcases/RiftSaw_155/build.xml
Log:
https://jira.jboss.org/browse/RIFTSAW-182
Added Petr's performance tests
Modified: trunk/stress-tests/.classpath
===================================================================
--- trunk/stress-tests/.classpath 2010-05-28 14:39:11 UTC (rev 680)
+++ trunk/stress-tests/.classpath 2010-05-28 20:37:17 UTC (rev 681)
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/test/java"/>
+ <classpathentry kind="src"
path="src/test/resources/performance/war/src"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-1.6.0-openjdk-1.6.0.0"/>
<classpathentry kind="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
- <classpathentry kind="lib"
path="/home/bbrodt/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
- <classpathentry kind="lib"
path="/home/bbrodt/.m2/repository/org/jboss/logging/jboss-logging-spi/2.1.0.GA/jboss-logging-spi-2.1.0.GA.jar"/>
- <classpathentry kind="lib"
path="/home/bbrodt/.m2/repository/org/jboss/soa/bpel/dependencies/esb/jbossesb-rosetta/4.7/jbossesb-rosetta-4.7.jar"/>
- <classpathentry kind="lib"
path="/home/bbrodt/.m2/repository/org/mortbay/jetty/jetty-util/6.1.12rc1/jetty-util-6.1.12rc1.jar"
sourcepath="/home/bbrodt/.m2/repository/org/mortbay/jetty/jetty-util/6.1.12rc1/jetty-util-6.1.12rc1-sources.jar">
+ <classpathentry kind="lib"
path="lib/commons-httpclient-3.1.jar"/>
+ <classpathentry kind="lib"
path="lib/jboss-logging-spi-2.1.0.GA.jar"/>
+ <classpathentry kind="lib"
path="lib/jbossesb-rosetta-4.7.jar"/>
+ <classpathentry kind="lib"
path="lib/jetty-util-6.1.12rc1.jar">
<attributes>
<attribute name="maven.groupId" value="org.mortbay.jetty"/>
<attribute name="maven.artifactId" value="jetty-util"/>
@@ -14,5 +15,6 @@
<attribute name="maven.scope" value="test"/>
</attributes>
</classpathentry>
+ <classpathentry kind="lib" path="lib/log4j-1.2.14.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/stress-tests/build.xml
===================================================================
--- trunk/stress-tests/build.xml 2010-05-28 14:39:11 UTC (rev 680)
+++ trunk/stress-tests/build.xml 2010-05-28 20:37:17 UTC (rev 681)
@@ -124,6 +124,7 @@
<mkdir dir="target/tests"/>
<ant antfile="src/test/resources/testcases/RiftSaw_155/build.xml" />
+ <ant antfile="src/test/resources/performance/build.xml" />
</target>
</project>
Added: trunk/stress-tests/lib/commons-httpclient-3.1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/stress-tests/lib/commons-httpclient-3.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/stress-tests/lib/jboss-logging-spi-2.1.0.GA.jar
===================================================================
(Binary files differ)
Property changes on: trunk/stress-tests/lib/jboss-logging-spi-2.1.0.GA.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/stress-tests/lib/jbossesb-rosetta-4.7.jar
===================================================================
(Binary files differ)
Property changes on: trunk/stress-tests/lib/jbossesb-rosetta-4.7.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/stress-tests/lib/jetty-util-6.1.12rc1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/stress-tests/lib/jetty-util-6.1.12rc1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/stress-tests/lib/log4j-1.2.14.jar
===================================================================
(Binary files differ)
Property changes on: trunk/stress-tests/lib/log4j-1.2.14.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/stress-tests/pom.xml
===================================================================
--- trunk/stress-tests/pom.xml 2010-05-28 14:39:11 UTC (rev 680)
+++ trunk/stress-tests/pom.xml 2010-05-28 20:37:17 UTC (rev 681)
@@ -11,6 +11,33 @@
<artifactId>bpel</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
+
+ <profiles>
+ <profile>
+ <id>tools.jar</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.6.0</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
<properties>
<jboss.jbosssx.version>2.0.2.SP3</jboss.jbosssx.version>
<jboss.common.version>1.2.1.GA</jboss.common.version>
Modified: trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTest.java
===================================================================
--- trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTest.java 2010-05-28
14:39:11 UTC (rev 680)
+++ trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTest.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -183,4 +183,19 @@
return(result);
}
+
+ protected String sendAndValidate(String service, String request, String response) throws
Exception {
+ String result=sendSOAPMessage(request, service);
+
+ // If testing against cxf, then result is presented slightly differently
+ if (result.indexOf("SOAP-ENV") != -1) {
+ result = result.replaceAll("SOAP-ENV", "env");
+ result = result.replaceAll(" xmlns=\"\"","");
+ result = result.replaceAll("\"","'");
+ result = result.replaceAll("<env:Header
/>","<env:Header></env:Header>");
+ }
+
+ assertMessageFromFile(result, response);
+ return result;
+ }
}
Added:
trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/performance/PerformanceTestCase.java
===================================================================
---
trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/performance/PerformanceTestCase.java
(rev 0)
+++
trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/performance/PerformanceTestCase.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,50 @@
+package org.jboss.soa.bpel.tests.performance;
+
+import junit.framework.Test;
+
+import org.jboss.soa.bpel.tests.RiftSawTest;
+import org.jboss.soa.bpel.tests.RiftSawTestSetup;
+import org.jboss.soa.esb.qa.teargas.qs.QSRunTest;
+
+public class PerformanceTestCase extends RiftSawTest {
+
+ private static final String TEST_NAME = "Performance";
+
+ public PerformanceTestCase(String name) {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return(new RiftSawTestSetup(PerformanceTestCase.class,
+ TEST_NAME, "")); // nothing to do here - jars and wars are already
deployed
+ }
+
+ public void testRun() throws Exception {
+ String resources = System.getProperty("resources.dir");
+ int count = 1;
+ if (resources==null)
+ resources = "src/test/resources";
+ try
+ {
+ count = Integer.parseInt(System.getProperty("count"));
+ }
+ catch(Exception ex)
+ {
+ fail(ex.getMessage());
+ }
+
+ String[] args = new String[3];
+ args[0] =
"-message="+resources+"/performance/messages/hello_request1.xml";
+ args[1] = "-address=http://localhost:8080/SimpleInvoke";
+ args[2] = "-count="+count;
+
+ QSRunTest qs = new QSRunTest();
+ qs.parseArguments(args);
+ if (!qs.validArguments()) {
+ System.out.println("Usage: QSRunTest -address=<WS URL> -message=<message
file> -count=<number of messages>");
+ System.out.println("Additional properties for message sender can be specified
using -D<property_name>=<value>");
+ } else {
+ qs.runTest();
+ }
+ }
+}
Modified:
trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw155TestCase.java
===================================================================
---
trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw155TestCase.java 2010-05-28
14:39:11 UTC (rev 680)
+++
trunk/stress-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw155TestCase.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -33,7 +33,8 @@
import org.mortbay.util.ajax.JSON;
/**
- * Test case for running the RiftSaw_10_doclit testcase.
+ * Test case for running the RIFTSAW-155 JIRA validation.
+ * See
https://jira.jboss.org/browse/RIFTSAW-155
*/
public class RiftSaw155TestCase extends RiftSawTest {
@@ -153,22 +154,6 @@
}
}
- private String sendAndValidate(String service, String request, String response) throws
Exception
- {
- String result=sendSOAPMessage(request, service);
-
- // If testing against cxf, then result is presented slightly differently
- if (result.indexOf("SOAP-ENV") != -1) {
- result = result.replaceAll("SOAP-ENV", "env");
- result = result.replaceAll(" xmlns=\"\"","");
- result = result.replaceAll("\"","'");
- result = result.replaceAll("<env:Header
/>","<env:Header></env:Header>");
- }
-
- assertMessageFromFile(result, response);
- return result;
- }
-
private TreeMap<String,ProcInfo> getProcesses(String name) throws Exception
{
TreeMap<String,ProcInfo> procs = new TreeMap<String,ProcInfo>();
Added: trunk/stress-tests/src/test/resources/performance/bpel/HelloWorldWS.wsdl
===================================================================
--- trunk/stress-tests/src/test/resources/performance/bpel/HelloWorldWS.wsdl
(rev 0)
+++ trunk/stress-tests/src/test/resources/performance/bpel/HelloWorldWS.wsdl 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<definitions name='HelloWorldWSService'
+targetNamespace='http://simple_invoke/helloworld'
+xmlns='http://schemas.xmlsoap.org/wsdl/'
+xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+xmlns:tns='http://simple_invoke/helloworld'
+xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+>
+ <types>
+ <xs:schema targetNamespace='http://simple_invoke/helloworld'
version='1.0' xmlns:tns='http://simple_invoke/helloworld'
xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:element name='sayGoodbye' type='tns:sayGoodbye'/>
+ <xs:element name='sayGoodbyeResponse'
type='tns:sayGoodbyeResponse'/>
+ <xs:element name='sayHello' type='tns:sayHello'/>
+ <xs:element name='sayHelloResponse'
type='tns:sayHelloResponse'/>
+ <xs:complexType name='sayGoodbye'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='toWhom'
type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name='sayGoodbyeResponse'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='return'
type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name='sayHello'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='toWhom'
type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name='sayHelloResponse'>
+ <xs:sequence>
+ <xs:element minOccurs='0' name='return'
type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name='HelloWorld_sayGoodbye'>
+ <part element='tns:sayGoodbye' name='sayGoodbye'></part>
+ </message>
+ <message name='HelloWorld_sayHello'>
+ <part element='tns:sayHello' name='sayHello'></part>
+ </message>
+ <message name='HelloWorld_sayHelloResponse'>
+ <part element='tns:sayHelloResponse'
name='sayHelloResponse'></part>
+ </message>
+ <message name='HelloWorld_sayGoodbyeResponse'>
+ <part element='tns:sayGoodbyeResponse'
name='sayGoodbyeResponse'></part>
+ </message>
+ <portType name='HelloWorld'>
+ <operation name='sayGoodbye' parameterOrder='sayGoodbye'>
+ <input message='tns:HelloWorld_sayGoodbye'></input>
+ <output message='tns:HelloWorld_sayGoodbyeResponse'></output>
+ </operation>
+ <operation name='sayHello' parameterOrder='sayHello'>
+ <input message='tns:HelloWorld_sayHello'></input>
+ <output message='tns:HelloWorld_sayHelloResponse'></output>
+ </operation>
+ </portType>
+ <binding name='HelloWorldBinding' type='tns:HelloWorld'>
+ <soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='sayGoodbye'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='sayHello'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='HelloWorldWSService'>
+ <port binding='tns:HelloWorldBinding' name='HelloWorldPort'>
+ <soap:address
location='http://127.0.0.1:8080/Quickstart_bpel_simple_invoke/HelloWorldWS'/>
+ </port>
+ </service>
+ <plnk:partnerLinkType name="theExternalService_PartnerLinkType">
+ <plnk:role name="callingTheExternalService"
portType="tns:HelloWorld"/>
+ </plnk:partnerLinkType>
+</definitions>
\ No newline at end of file
Added: trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.bpel
===================================================================
--- trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.bpel
(rev 0)
+++ trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.bpel 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,96 @@
+<!--
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ -->
+<process name="SimpleInvoke"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ xmlns:intf2="http://simple_invoke/helloworld"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+ <import location="SimpleInvoke.wsdl"
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <import location="HelloWorldWS.wsdl"
+ namespace="http://simple_invoke/helloworld"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="theClient_PartnerLink"
+ partnerLinkType="intf:myClientCalling_PartnerLinkType"
+ myRole="me" />
+ <partnerLink name="theExternalService_PartnerLink"
+ partnerLinkType="intf2:theExternalService_PartnerLinkType"
+ partnerRole="callingTheExternalService"
+ initializePartnerRole="yes"/>
+ </partnerLinks>
+
+ <variables>
+ <variable name="myVar"
messageType="intf:GreetingTarget_Message"/>
+ <variable name="inVar"
messageType="intf2:HelloWorld_sayHello"/>
+ <variable name="outVar"
messageType="intf2:HelloWorld_sayHelloResponse"/>
+ <variable name="tempVar" type="xsd:string"/>
+ </variables>
+
+ <sequence>
+ <receive
+ name="request"
+ partnerLink="theClient_PartnerLink"
+ portType="intf:SimpleInvoke_PortType"
+ operation="sayHelloTo"
+ variable="myVar"
+ createInstance="yes"/>
+
+ <assign name="assignRequestToHelloWorldWS">
+ <!-- Ode requires variable initialization -->
+ <copy>
+ <from><literal><intf2:sayHello><toWhom
xmlns=""/></intf2:sayHello></literal></from>
+ <to variable="inVar" part="sayHello"/>
+ </copy>
+ <!-- now the real copy -->
+ <copy>
+ <from variable="myVar" part="ToWhom"/>
+ <to>$inVar.sayHello/toWhom</to>
+ </copy>
+ </assign>
+
+ <invoke name="ICallTheExternalService"
+ partnerLink="theExternalService_PartnerLink"
+ portType="intf2:HelloWorld"
+ operation="sayHello"
+ inputVariable="inVar"
+ outputVariable="outVar"
+ />
+
+ <assign name="assignResponseOfHelloWorldWS">
+ <copy>
+ <from>$outVar.sayHelloResponse/return</from>
+ <to variable="myVar" part="ToWhom"/>
+ </copy>
+ </assign>
+
+ <reply name="response"
+ partnerLink="theClient_PartnerLink"
+ portType="intf:SimpleInvoke_PortType"
+ operation="sayHelloTo"
+ variable="myVar"/>
+ </sequence>
+</process>
Added: trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.cbp
===================================================================
(Binary files differ)
Property changes on:
trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.cbp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.wsdl
===================================================================
--- trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.wsdl
(rev 0)
+++ trunk/stress-tests/src/test/resources/performance/bpel/SimpleInvoke.wsdl 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ -->
+<wsdl:definitions
+
targetNamespace="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:tns="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <wsdl:message name="GreetingTarget_Message">
+ <wsdl:part name="ToWhom" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="SimpleInvoke_PortType">
+ <wsdl:operation name="sayHelloTo">
+ <wsdl:input message="tns:GreetingTarget_Message"
name="TestIn"/>
+ <wsdl:output message="tns:GreetingTarget_Message"
name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="SimpleInvoke_SoapBinding"
type="tns:SimpleInvoke_PortType">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="sayHelloTo">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SimpleInvoke_Service">
+ <wsdl:port name="SimpleInvoke_Port"
binding="tns:SimpleInvoke_SoapBinding">
+ <soap:address
location="http://localhost:8080/bpel/processes/simpleInvoke"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="myClientCalling_PartnerLinkType">
+ <plnk:role name="me"
portType="tns:SimpleInvoke_PortType"/>
+ <plnk:role name="you"
portType="tns:SimpleInvoke_PortType"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
+
Added: trunk/stress-tests/src/test/resources/performance/bpel/bpel-deploy.xml
===================================================================
--- trunk/stress-tests/src/test/resources/performance/bpel/bpel-deploy.xml
(rev 0)
+++ trunk/stress-tests/src/test/resources/performance/bpel/bpel-deploy.xml 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,32 @@
+<!--
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ -->
+<deploy
xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+
xmlns:bpl="http://www.jboss.org/bpel/examples"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ xmlns:intf2="http://simple_invoke/helloworld">
+
+ <process name="bpl:SimpleInvoke">
+ <active>true</active>
+ <provide partnerLink="theClient_PartnerLink">
+ <service name="intf:SimpleInvoke_Service"
port="SimpleInvoke_Port"/>
+ </provide>
+ <invoke partnerLink="theExternalService_PartnerLink">
+ <service name="intf2:HelloWorldWSService"
port="HelloWorldPort"/>
+ </invoke>
+ </process>
+</deploy>
Added: trunk/stress-tests/src/test/resources/performance/build.xml
===================================================================
--- trunk/stress-tests/src/test/resources/performance/build.xml
(rev 0)
+++ trunk/stress-tests/src/test/resources/performance/build.xml 2010-05-28 20:37:17 UTC
(rev 681)
@@ -0,0 +1,108 @@
+<project name="Quickstart_bpel_simple_invoke" default="deploy"
basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <property file="${riftsaw.test.deployment.properties}" />
+
+ <property name="version" value="1" />
+
+ <property name="server.dir"
value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
+ <property name="conf.dir" value="${server.dir}/conf"/>
+ <property name="deploy.dir" value="${server.dir}/deploy"/>
+ <property name="server.lib.dir" value="${server.dir}/lib"/>
+ <property name="sample.jar.name"
value="${ant.project.name}-${version}.jar" />
+ <property name="test.dir"
value="src/test/resources/performance"/>
+
+ <property name="war.build.dir" value="bin"/>
+
+ <path id="compile-classpath">
+ <fileset dir="${org.jboss.as.home}/client" includes="*.jar"
/> <!-- Required for JMS Client Code. -->
+ </path>
+ <property name="compile-classpath"
refid="compile-classpath"/>
+
+ <target name="makewar" description="make war">
+ <!-- Compile... -->
+ <mkdir dir="${war.build.dir}" />
+ <javac srcdir="${test.dir}/war/src"
destdir="${war.build.dir}" debug="true">
+ <classpath>
+ <pathelement location="${war.build.dir}"/>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ <classpath>
+ <path refid="compile-classpath" />
+ <fileset dir="${test.dir}/war/resources/WEB-INF/lib"
includes="*.jar" />
+ </classpath>
+ </javac>
+
+ <!-- War... -->
+ <war warfile="${war.build.dir}/${ant.project.name}.war"
+ webxml="${test.dir}/war/resources/WEB-INF/web.xml">
+ <webinf dir="${test.dir}/war/resources/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <classes dir="${war.build.dir}"
includes="**/*.class"/>
+ <fileset dir="${test.dir}/war/view">
+ <include name="**/*"/>
+ </fileset>
+ <classes dir="${test.dir}">
+ <include name="juddi.properties"/>
+ </classes>
+ </war>
+ </target>
+
+ <target name="deploywar" depends="makewar" >
+ <copy todir="${deploy.dir}"
+ file="${war.build.dir}/${ant.project.name}.war"/>
+ </target>
+
+ <target name="undeploywar">
+ <delete file="${deploy.dir}/${ant.project.name}.war"/>
+ </target>
+
+ <target name="deploy" depends="deploywar" >
+ <echo>Deploy ${ant.project.name}</echo>
+ <jar basedir="${test.dir}/bpel"
destfile="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="undeploy" depends="undeploywar" >
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+<!-- this is executed from the PerformanceTestCase JUNIT test class
+ <target name="perf-ws" description="Performance test">
+ <path id="exec-classpath">
+ <pathelement location="${deploy.dir}/${ant.project.name}.war" />
+ </path>
+ <java fork="yes"
classname="org.jboss.soa.esb.qa.teargas.qs.QSRunTest"
failonerror="true">
+ <arg value="-message=messages/hello_request2.xml" />
+ <arg
value="-address=http://localhost:8080/Quickstart_bpel_simple_invoke/HelloWorldWS"
/>
+ <arg value="-count=100" />
+ <classpath>
+ <pathelement location="build/war/classes"/>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="perf-bpel" description="Performance test">
+ <path id="exec-classpath">
+ <pathelement location="${deploy.dir}/${ant.project.name}.war" />
+ </path>
+ <java fork="yes"
classname="org.jboss.soa.esb.qa.teargas.qs.QSRunTest"
failonerror="true">
+ <arg value="-message=messages/hello_request1.xml" />
+ <arg value="-address=http://localhost:8080/bpel/processes/simpleInvoke"
/>
+ <arg value="-count=100" />
+ <classpath>
+ <pathelement location="build/war/classes"/>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+ </target>
+-->
+
+</project>
Added: trunk/stress-tests/src/test/resources/performance/messages/hello_request1.xml
===================================================================
--- trunk/stress-tests/src/test/resources/performance/messages/hello_request1.xml
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/messages/hello_request1.xml 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,8 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:sayHelloTo>
+ <ToWhom>Jehu</ToWhom>
+ </wsdl:sayHelloTo>
+ </soapenv:Body>
+</soapenv:Envelope>
Added: trunk/stress-tests/src/test/resources/performance/messages/hello_request2.xml
===================================================================
--- trunk/stress-tests/src/test/resources/performance/messages/hello_request2.xml
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/messages/hello_request2.xml 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,8 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:hel="http://simple_invoke/helloworld">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <hel:sayHello>
+ <toWhom>Jehu</toWhom>
+ </hel:sayHello>
+ </soapenv:Body>
+</soapenv:Envelope>
Added: trunk/stress-tests/src/test/resources/performance/war/resources/WEB-INF/web.xml
===================================================================
--- trunk/stress-tests/src/test/resources/performance/war/resources/WEB-INF/web.xml
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/war/resources/WEB-INF/web.xml 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>HelloWorldWS</servlet-name>
+
<servlet-class>org.jboss.soa.bpel.samples.quickstart.simple_invoke.HelloWorldWS</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>HelloWorldWS</servlet-name>
+ <url-pattern>/HelloWorldWS</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added:
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/bpel/samples/quickstart/simple_invoke/HelloWorldWS.java
===================================================================
---
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/bpel/samples/quickstart/simple_invoke/HelloWorldWS.java
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/bpel/samples/quickstart/simple_invoke/HelloWorldWS.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,56 @@
+/*
+ * 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,
+ * @author JBoss Inc.
+ */
+
+package org.jboss.soa.bpel.samples.quickstart.simple_invoke;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.WebParam;
+
+@WebService(name = "HelloWorld", targetNamespace =
"http://simple_invoke/helloworld")
+public class HelloWorldWS
+{
+ @WebMethod
+ public String sayHello(@WebParam(name = "toWhom")
+ String toWhom)
+ {
+ System.out.println("\n");
+ System.out.println("*************************************************");
+ System.out.println("toWhom Parameter: " + toWhom );
+ System.out.println("*************************************************");
+ System.out.println("\n");
+ String greeting = "Hello " + toWhom + ". Sincerely, JBossWS";
+ return greeting;
+
+ }
+
+ @WebMethod
+ public String sayGoodbye(@WebParam(name = "toWhom")
+ String toWhom)
+ {
+
+ String greeting = "Goodbye Cruel World, sincerely '" + toWhom +
"' at " + new java.util.Date();
+
+ return greeting;
+
+ }
+}
Added:
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/TeargasConst.java
===================================================================
---
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/TeargasConst.java
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/TeargasConst.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,38 @@
+/*
+ * 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-2008,
+ */
+
+package org.jboss.soa.esb.qa.teargas;
+
+/**
+ *
+ * @author mvecera
+ */
+public class TeargasConst {
+
+ public static final String MONITORING_QUEUE = "queue/teargas_jms_monitor";
+ public static final String STOP_MESSAGE_PROPERTY =
"This_is_the_very_last_message";
+ public static final String PERFORMANCE_MESSAGE_PROPERTY =
"Teargas_Performance";
+ public static final String TIME_MESSAGE_PROPERTY =
"Teargas_Performance_Time";
+ public static final String COUNT_MESSAGE_PROPERTY =
"Teargas_Performance_Count";
+ public static final String START_VALUE = "**START**";
+ public static final String STOP_VALUE = "**STOP**";
+ public static final String CHECK_POINT_VALUE = "**CHECK**";
+
+}
Added:
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/AbstractMessageGenerator.java
===================================================================
---
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/AbstractMessageGenerator.java
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/AbstractMessageGenerator.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,31 @@
+package org.jboss.soa.esb.qa.teargas.message.generator;
+
+import java.io.Serializable;
+import org.jboss.soa.esb.qa.teargas.message.sender.MessageSender;
+
+/**
+ *
+ * @author pmacik
+ */
+public abstract class AbstractMessageGenerator {
+
+ protected MessageSender sender;
+ protected int threads = 1;
+
+ public void setProperty(String property, String value) {
+ if ("threads".equals(property)) {
+ threads = Integer.valueOf(value);
+ }
+ }
+
+ public void init(String address, MessageSender sender) throws Exception {
+ this.sender = sender;
+ this.sender.init(address);
+ }
+
+ public void close() {
+ sender.close();
+ }
+
+ public abstract void generate(Serializable message, int count) throws Exception;
+}
Added:
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/ImmediateMessageGenerator.java
===================================================================
---
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/ImmediateMessageGenerator.java
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/ImmediateMessageGenerator.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,111 @@
+/*
+ * 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.qa.teargas.message.generator;
+
+import java.io.Serializable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.qa.teargas.message.sender.MessageSender;
+
+/**
+ *
+ * @author mvecera
+ */
+public class ImmediateMessageGenerator extends AbstractMessageGenerator {
+ private static final Logger log = Logger.getLogger(ImmediateMessageGenerator.class);
+ private AtomicInteger counter = new AtomicInteger(0);
+ protected long start = -1;
+ protected long stop = -1;
+
+ protected void setStartTime() {
+ if (start == -1) {
+ start = System.currentTimeMillis();
+ }
+ }
+
+ protected void setStopTime() {
+ if (stop == -1) {
+ stop = System.currentTimeMillis();
+ }
+ }
+
+ protected float getSpeed(int count) {
+ long now = (stop == -1) ? System.currentTimeMillis() : stop;
+ return 1000f * count / (now - start);
+ }
+
+ @Override
+ public void generate(Serializable message, int count) throws Exception {
+ setStartTime();
+
+ log.info("Preparing senders");
+ ExecutorService es = Executors.newFixedThreadPool(threads);
+ for (int i = 0; i < count; i++) {
+ es.submit(new SenderTask(counter, sender, message));
+ }
+
+ es.shutdown();
+ boolean terminated = false;
+ int lastValue = 0;
+ while (!terminated) {
+ try {
+ terminated = es.awaitTermination(1, TimeUnit.SECONDS);
+
+ // should we log a change?
+ int cnt = counter.get();
+ if (cnt != lastValue) {
+ lastValue = cnt;
+ log.info("Messages sent: " + cnt + " (" +
getSpeed(cnt) + " msgs/s)");
+ }
+ } catch (InterruptedException ie) {
+ // "Shit happens!", Forrest Gump
+ }
+ }
+
+ setStopTime();
+ }
+
+ private static class SenderTask implements Runnable {
+ private MessageSender sender;
+ private Serializable message;
+ private AtomicInteger counter;
+
+ public SenderTask(AtomicInteger counter, MessageSender sender, Serializable
message) {
+ this.sender = sender;
+ this.message = message;
+ this.counter = counter;
+ }
+
+ @Override
+ public void run() {
+ try {
+ sender.send(message, null);
+ counter.incrementAndGet();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
Added:
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/QSMessageGenerator.java
===================================================================
---
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/QSMessageGenerator.java
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/generator/QSMessageGenerator.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,40 @@
+/*
+ * 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.qa.teargas.message.generator;
+
+import java.io.Serializable;
+import org.apache.log4j.Logger;
+
+/**
+ *
+ * @author mvecera
+ */
+public class QSMessageGenerator extends ImmediateMessageGenerator {
+ private static final Logger log = Logger.getLogger(QSMessageGenerator.class);
+
+ @Override
+ public void generate(Serializable message, int count) throws Exception {
+ super.generate(message, count);
+
+ System.out.println("Messages sent: " + count + " (" +
getSpeed(count) + " msgs/s)");
+ }
+}
Added:
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/sender/HTTPSender.java
===================================================================
---
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/sender/HTTPSender.java
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/sender/HTTPSender.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,119 @@
+/*
+ * 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.qa.teargas.message.sender;
+
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Serializable;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.log4j.Logger;
+
+/**
+ *
+ * @author mvecera(a)redhat.com, pmacik(a)redhat.com
+ */
+public class HTTPSender implements MessageSender {
+
+ private URL url;
+ private String method = "POST";
+ private Map<String, String> headers = new HashMap<String, String>();
+ private final Logger log = Logger.getLogger(HTTPSender.class);
+
+ @Override
+ public void setProperty(String prop, String value) {
+ if ("method".equals(prop)) {
+ method = value;
+ }
+ }
+
+ public void setHeader(String name, String value) {
+ headers.put(name, value);
+ }
+
+ @Override
+ public void init(String address) throws Exception {
+ url = new URL(address);
+ }
+
+ @Override
+ public void close() {
+ }
+
+ @Override
+ public Serializable send(Serializable message, Map properties) throws Exception {
+ HttpURLConnection rc = (HttpURLConnection) url.openConnection();
+ rc.setRequestMethod(method);
+ rc.setDoOutput(true);
+ rc.setDoInput(true);
+ rc.setRequestProperty("Content-Type", "text/xml;
charset=utf-8");
+
+ String reqStr = message.toString();
+ int len = reqStr.length();
+ rc.setRequestProperty("Content-Length", Integer.toString(len));
+ //rc.setRequestProperty("SOAPAction",
soapActions[actionLookup(action)]);
+
+ if(headers.entrySet().size() > 0){
+ log.debug("Setting HTTP headers");
+ for (Map.Entry<String, String> header : headers.entrySet()) {
+ log.debug(header.getKey() + ": " + header.getValue());
+ rc.setRequestProperty(header.getKey(), header.getValue());
+ }
+ }
+ rc.connect();
+
+ OutputStreamWriter out = new OutputStreamWriter(rc.getOutputStream());
+ out.write(reqStr, 0, len);
+ out.flush();
+
+ rc.getOutputStream().close();
+
+ char[] cbuf = new char[10 * 1024];
+ InputStreamReader read = new InputStreamReader(rc.getInputStream());
+ // note that Content-Length is available at this point
+ StringBuilder sb = new StringBuilder();
+ int ch = read.read(cbuf);
+ while (ch != -1) {
+ sb.append(cbuf, 0, ch);
+ ch = read.read(cbuf);
+ }
+ read.close();
+ rc.getInputStream().close();
+ rc.disconnect();
+
+ return sb.toString();
+ }
+
+ @Override
+ public MessageSender clone() {
+ HTTPSender senderClone = new HTTPSender();
+ senderClone.url = this.url;
+ senderClone.method = this.method;
+ for (Map.Entry<String, String> header : headers.entrySet()) {
+ senderClone.setHeader(header.getKey(), header.getValue());
+ }
+ return senderClone;
+ }
+}
Added:
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/sender/MessageSender.java
===================================================================
---
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/sender/MessageSender.java
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/message/sender/MessageSender.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,21 @@
+package org.jboss.soa.esb.qa.teargas.message.sender;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ *
+ * @author pmacik
+ */
+public interface MessageSender {
+
+ public void setProperty(String prop, String value);
+
+ public void init(String address) throws Exception;
+
+ public void close();
+
+ public Serializable send(Serializable message, Map properties) throws Exception;
+
+ public MessageSender clone();
+}
Added:
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/qs/QSRunTest.java
===================================================================
---
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/qs/QSRunTest.java
(rev 0)
+++
trunk/stress-tests/src/test/resources/performance/war/src/org/jboss/soa/esb/qa/teargas/qs/QSRunTest.java 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,163 @@
+/*
+ * 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.qa.teargas.qs;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.Map.Entry;
+import java.util.Vector;
+import org.jboss.soa.esb.qa.teargas.message.generator.AbstractMessageGenerator;
+import org.jboss.soa.esb.qa.teargas.message.generator.QSMessageGenerator;
+import org.jboss.soa.esb.qa.teargas.message.sender.HTTPSender;
+import org.jboss.soa.esb.qa.teargas.message.sender.MessageSender;
+
+/**
+ *
+ * @author mvecera
+ */
+public class QSRunTest {
+ private Vector<String> params = new Vector<String>();
+ private Hashtable<String, String> options = new Hashtable<String,
String>();
+ private Hashtable<String, String> properties = new Hashtable<String,
String>();
+
+ private int count;
+ private StringBuilder sbMessage = new StringBuilder();
+ private String address;
+ private MessageSender sender = null;
+
+ public void parseArguments(String[] args) {
+ int paramIndex = 0;
+ for (int i = 0; i < args.length; i++) {
+ if (args[i].startsWith("-")) {
+ if (args[i].startsWith("-D")) {
+ int loc = args[i].indexOf("=");
+ String key = (loc > 0) ? args[i].substring(2, loc) :
args[i].substring(2);
+ String value = (loc > 0) ? args[i].substring(loc + 1) : "";
+ properties.put(key.toLowerCase(), value);
+ } else {
+ int loc = args[i].indexOf("=");
+ String key = (loc > 0) ? args[i].substring(1, loc) :
args[i].substring(1);
+ String value = (loc > 0) ? args[i].substring(loc + 1) : "";
+ options.put(key.toLowerCase(), value);
+ }
+ } else {
+ params.addElement(args[i]);
+ }
+ }
+ }
+
+ private boolean hasOption(String opt) {
+ return options.containsKey(opt.toLowerCase());
+ }
+
+ private String getOption(String opt) {
+ return options.get(opt.toLowerCase());
+ }
+
+ public void runTest() throws Exception {
+ AbstractMessageGenerator generator = new QSMessageGenerator();
+ if (sender == null) {
+ sender = new HTTPSender();
+ }
+
+ for (Entry<String, String> e: properties.entrySet()) {
+ sender.setProperty(e.getKey(), e.getValue());
+ generator.setProperty(e.getKey(), e.getValue());
+ }
+
+ generator.init(address, sender);
+ generator.generate(sbMessage.toString(), count);
+ generator.close();
+ }
+
+ private void loadMessage(String fileName) throws IOException {
+ FileReader fr = new FileReader(fileName);
+ BufferedReader br = new BufferedReader(fr);
+
+ String line = "";
+ while ((line = br.readLine()) != null) {
+ sbMessage.append(line);
+ }
+
+ br.close();
+ fr.close();
+ }
+
+ public boolean validArguments() {
+ if (hasOption("message") && hasOption("address")
&& hasOption("count")) {
+ try {
+ count = Integer.parseInt(getOption("count"));
+ } catch (NumberFormatException e) {
+ System.err.println("Option count is not a valid number.");
+ return false;
+ }
+
+ try {
+ loadMessage(getOption("message"));
+ } catch (IOException e) {
+ System.err.println("Unable to read meesage file.");
+ return false;
+ }
+
+ address = getOption("address");
+ if (address == null || "".equals(address)) {
+ System.err.println("Invalid address.");
+ return false;
+ }
+ }
+
+ if (hasOption("sender")) {
+ String senderClass = "org.jboss.soa.esb.qa.teargas.message.sender." +
getOption("sender");
+
+ try {
+ sender = (MessageSender) Class.forName(senderClass, false,
this.getClass().getClassLoader()).newInstance();
+ } catch (ClassNotFoundException e) {
+ System.err.println("Unable to instantiate sender class - class not
found: " + senderClass);
+ return false;
+ } catch (InstantiationException e) {
+ System.err.println("Unable to instantiate sender class.");
+ return false;
+ } catch (IllegalAccessException e) {
+ System.err.println("Unable to instantiate sender class.");
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static void main(String[] args) throws Exception {
+ System.out.println("Teargas testing framework - QS Performance
measurement");
+
+ QSRunTest qs = new QSRunTest();
+ qs.parseArguments(args);
+ if (!qs.validArguments()) {
+ System.out.println("Usage: QSRunTest -address=<WS URL>
-message=<message file> -count=<number of messages>");
+ System.out.println("Additional properties for message sender can be
specified using -D<property_name>=<value>");
+ } else {
+ qs.runTest();
+ }
+ }
+
+}
Added: trunk/stress-tests/src/test/resources/performance/war/view/index.jsp
===================================================================
--- trunk/stress-tests/src/test/resources/performance/war/view/index.jsp
(rev 0)
+++ trunk/stress-tests/src/test/resources/performance/war/view/index.jsp 2010-05-28
20:37:17 UTC (rev 681)
@@ -0,0 +1,9 @@
+<html>
+ <body>
+ This is just a place holder.<br>
+ Verify the that the WS has been deployed by hitting
+ <a href="http://localhost:8080/jbossws">
+
http://localhost:8080/jbossws
+ </a>
+ </body>
+</html>
\ No newline at end of file
Modified: trunk/stress-tests/src/test/resources/testcases/RiftSaw_155/build.xml
===================================================================
--- trunk/stress-tests/src/test/resources/testcases/RiftSaw_155/build.xml 2010-05-28
14:39:11 UTC (rev 680)
+++ trunk/stress-tests/src/test/resources/testcases/RiftSaw_155/build.xml 2010-05-28
20:37:17 UTC (rev 681)
@@ -1,4 +1,4 @@
-<project name="RiftSaw_155" default="deploy"
basedir="/home/bbrodt/workspace/test">
+<project name="RiftSaw_155" default="deploy"
basedir=".">
<description>
${ant.project.name}