Author: hiranya
Date: Thu Dec 8 11:01:42 2011
New Revision: 1211825
URL: http://svn.apache.org/viewvc?rev=1211825&view=rev
Log:
Adding qos samples
Added:
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/Sample100.java
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/Sample101.java
synapse/trunk/java/modules/integration/src/test/resources/sample100.xml
synapse/trunk/java/modules/integration/src/test/resources/sample101.xml
Modified:
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/TestSamplesHandlerSuite.java
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/endpoint/Sample57.java
Modified:
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/TestSamplesHandlerSuite.java
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/TestSamplesHandlerSuite.java?rev=1211825&r1=1211824&r2=1211825&view=diff
==============================================================================
---
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/TestSamplesHandlerSuite.java
(original)
+++
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/TestSamplesHandlerSuite.java
Thu Dec 8 11:01:42 2011
@@ -24,6 +24,8 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.synapse.samples.framework.tests.endpoint.*;
import org.apache.synapse.samples.framework.tests.message.*;
+import org.apache.synapse.samples.framework.tests.qos.Sample100;
+import org.apache.synapse.samples.framework.tests.qos.Sample101;
import java.util.ArrayList;
import java.util.HashMap;
@@ -182,5 +184,9 @@ public class TestSamplesHandlerSuite ext
//sampleClassRepo.put("57", Sample57.class); //intermittently fail
sampleClassRepo.put("58", Sample58.class);
sampleClassRepo.put("59", Sample59.class);
+
+ //QoS
+ sampleClassRepo.put("100", Sample100.class);
+ sampleClassRepo.put("101", Sample101.class);
}
}
\ No newline at end of file
Modified:
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/endpoint/Sample57.java
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/endpoint/Sample57.java?rev=1211825&r1=1211824&r2=1211825&view=diff
==============================================================================
---
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/endpoint/Sample57.java
(original)
+++
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/endpoint/Sample57.java
Thu Dec 8 11:01:42 2011
@@ -58,19 +58,6 @@ public class Sample57 extends SynapseTes
}
- t = new Thread(new Runnable() {
- public void run() {
- result = client.sessionlessClient(addUrl, null, 500);
- }
- });
- t.start();
-
- try {
- t.join();
- } catch (InterruptedException e) {
-
- }
-
assertResponseReceived(result);
}
}
Added:
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/Sample100.java
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/Sample100.java?rev=1211825&view=auto
==============================================================================
---
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/Sample100.java
(added)
+++
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/Sample100.java
Thu Dec 8 11:01:42 2011
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.synapse.samples.framework.tests.qos;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample100 extends SynapseTestCase {
+
+ private static final Log log = LogFactory.getLog(Sample100.class);
+ SampleClientResult result;
+ StockQuoteSampleClient client;
+
+ public Sample100() {
+ super(100);
+ client = getStockQuoteClient();
+ }
+
+
+ public void testWSSecurity() {
+ String trpUrl = "http://localhost:8280/";
+ log.info("Running test: Using WS-Security for outgoing messages");
+ result = client.requestStandardQuote(null, trpUrl, null, "IBM", null);
+ assertTrue("Client did not run successfully",
result.responseReceived());
+ }
+
+}
Added:
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/Sample101.java
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/Sample101.java?rev=1211825&view=auto
==============================================================================
---
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/Sample101.java
(added)
+++
synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/qos/Sample101.java
Thu Dec 8 11:01:42 2011
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.synapse.samples.framework.tests.qos;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample101 extends SynapseTestCase {
+
+ private static final Log log = LogFactory.getLog(Sample101.class);
+ SampleClientResult result;
+ StockQuoteSampleClient client;
+
+ public Sample101() {
+ super(101);
+ client = getStockQuoteClient();
+ }
+
+
+ public void testWSRM() {
+ String addUrl = "http://localhost:8280/";
+
+ log.info("Running test: Reliable message exchange");
+ result = client.requestStandardQuote(addUrl, null, null, "IBM" ,null);
+ assertTrue("Client did not run successfully ",
result.responseReceived());
+ }
+
+}
Added: synapse/trunk/java/modules/integration/src/test/resources/sample100.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/resources/sample100.xml?rev=1211825&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/resources/sample100.xml
(added)
+++ synapse/trunk/java/modules/integration/src/test/resources/sample100.xml Thu
Dec 8 11:01:42 2011
@@ -0,0 +1,18 @@
+<synapseSample>
+ <sampleID>100</sampleID>
+ <sampleName>Using WS-Security for outgoing messages</sampleName>
+ <synapseConfig>
+ <axis2Repo>modules/integration/target/test_repos/synapse</axis2Repo>
+
<axis2Xml>modules/integration/target/test_repos/synapse/conf/axis2_def.xml</axis2Xml>
+ <synapseXml>repository/conf/sample/synapse_sample_100.xml</synapseXml>
+ </synapseConfig>
+ <backEndServerConfig>
+ <axis2Server id='0'>
+
<axis2Repo>modules/integration/target/test_repos/axis2Server</axis2Repo>
+
<axis2Xml>modules/integration/target/test_repos/axis2Server/conf/axis2_def.xml</axis2Xml>
+ </axis2Server>
+ </backEndServerConfig>
+ <clientConfig>
+
<clientRepo>modules/integration/target/test_repos/axis2Client</clientRepo>
+ </clientConfig>
+</synapseSample>
Added: synapse/trunk/java/modules/integration/src/test/resources/sample101.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/resources/sample101.xml?rev=1211825&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/resources/sample101.xml
(added)
+++ synapse/trunk/java/modules/integration/src/test/resources/sample101.xml Thu
Dec 8 11:01:42 2011
@@ -0,0 +1,18 @@
+<synapseSample>
+ <sampleID>101</sampleID>
+ <sampleName>Reliable message exchange between Synapse and the back-end
server using WS-ReliableMessaging</sampleName>
+ <synapseConfig>
+ <axis2Repo>modules/integration/target/test_repos/synapse</axis2Repo>
+
<axis2Xml>modules/integration/target/test_repos/synapse/conf/axis2_def.xml</axis2Xml>
+ <synapseXml>repository/conf/sample/synapse_sample_101.xml</synapseXml>
+ </synapseConfig>
+ <backEndServerConfig>
+ <axis2Server id='0'>
+
<axis2Repo>modules/integration/target/test_repos/axis2Server</axis2Repo>
+
<axis2Xml>modules/integration/target/test_repos/axis2Server/conf/axis2_def.xml</axis2Xml>
+ </axis2Server>
+ </backEndServerConfig>
+ <clientConfig>
+
<clientRepo>modules/integration/target/test_repos/axis2Client</clientRepo>
+ </clientConfig>
+</synapseSample>