You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by ga...@apache.org on 2007/01/19 14:20:47 UTC

svn commit: r497804 - in /webservices/sandesha/trunk/java: src/org/apache/sandesha2/msgprocessors/ src/org/apache/sandesha2/storage/beans/ src/org/apache/sandesha2/workers/ test/src/org/apache/sandesha2/ test/src/org/apache/sandesha2/scenarios/ test/sr...

Author: gatfora
Date: Fri Jan 19 05:20:44 2007
New Revision: 497804

URL: http://svn.apache.org/viewvc?view=rev&rev=497804
Log:
Make unit tests pass on XP.  Fix problem uncommitted transaction problem when terminating sequences, removed a few unused imports

Added:
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientAckRequestWaitTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientCloseWaitTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientLastErrorTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientTerminateWaitTest.java
Modified:
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/SequenceProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/beans/RMDBean.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/beans/RMSBean.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Invoker.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/SenderWorker.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/MessageContextPropertyTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaReportsTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaTestCase.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaUtilTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/AddressableEchoTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/AnonymousEchoTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/OptionalReliabilityTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/security/UnitTestSecurityManager.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/storage/SenderBeanMgrTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/AddressingVersionTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/RMVersionTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/SOAPVersionTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/workers/ForceInboundDispatchTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/CloseSequenceResponseTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/CloseSequenceTest.java
    webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/TerminateSequenceResponseTest.java

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java Fri Jan 19 05:20:44 2007
@@ -19,7 +19,6 @@
 
 import java.util.Collection;
 import java.util.Iterator;
-import java.util.List;
 
 import javax.xml.namespace.QName;
 

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java Fri Jan 19 05:20:44 2007
@@ -70,7 +70,6 @@
 		MessageContext msgCtx = rmMsgCtx.getMessageContext();
 
 		String sequenceId = closeSequence.getIdentifier().getIdentifier();
-		String sequencePropertyKey = SandeshaUtil.getSequencePropertyKey(rmMsgCtx);
 		
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configCtx, configCtx
 				.getAxisConfiguration());

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java Fri Jan 19 05:20:44 2007
@@ -17,7 +17,6 @@
 
 package org.apache.sandesha2.msgprocessors;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 
 import org.apache.axiom.om.OMElement;

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/SequenceProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/SequenceProcessor.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/SequenceProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/SequenceProcessor.java Fri Jan 19 05:20:44 2007
@@ -17,7 +17,6 @@
 
 package org.apache.sandesha2.msgprocessors;
 
-import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
@@ -32,8 +31,6 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.context.OperationContextFactory;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.engine.Handler.InvocationResponse;
 import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004Constants;
 import org.apache.commons.logging.Log;
@@ -438,10 +435,7 @@
 
 		if (log.isDebugEnabled())
 			log.debug("Enter: SequenceProcessor::sendAckIfNeeded");
-
-		String sequencePropertyKey = SandeshaUtil
-				.getSequencePropertyKey(rmMsgCtx);
-
+		
 		Sequence sequence = (Sequence) rmMsgCtx
 				.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
 		String sequenceId = sequence.getIdentifier().getIdentifier();

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/beans/RMDBean.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/beans/RMDBean.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/beans/RMDBean.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/beans/RMDBean.java Fri Jan 19 05:20:44 2007
@@ -17,8 +17,6 @@
 
 package org.apache.sandesha2.storage.beans;
 
-import java.util.ArrayList;
-import java.util.List;
 import org.apache.sandesha2.util.RangeString;
 
 /**

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/beans/RMSBean.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/beans/RMSBean.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/beans/RMSBean.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/beans/RMSBean.java Fri Jan 19 05:20:44 2007
@@ -17,8 +17,6 @@
 
 package org.apache.sandesha2.storage.beans;
 
-import java.util.ArrayList;
-import java.util.List;
 import org.apache.sandesha2.util.RangeString;
 
 /**
@@ -329,6 +327,10 @@
 		result.append("\nTransportTo      : "); result.append(transportTo);
 		result.append("\nOfferedEndPoint  : "); result.append(offeredEndPoint);
 		result.append("\nOfferedSequence  : "); result.append(offeredSequence);
+		if (lastSendErrorTimestamp > 0) {
+			result.append("\nLastError        : "); result.append(lastSendError);
+			result.append("\nLastErrorTime    : "); result.append(lastSendErrorTimestamp);
+		}
 		return result.toString();
 	}
 	

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Invoker.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Invoker.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Invoker.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Invoker.java Fri Jan 19 05:20:44 2007
@@ -215,6 +215,8 @@
 
 			try {
 				if(sleep && !runMainLoop()) Thread.sleep(Sandesha2Constants.INVOKER_SLEEP_TIME);
+				if (!isThreadStarted())
+					continue;
 				// Indicate that we are running the main loop
 				setRanMainLoop();
 			} catch (InterruptedException ex) {
@@ -292,6 +294,8 @@
 				
 				// If there aren't any beans to process then move on to the next sequence
 				if (invokerBeans.size() == 0) {
+					if (log.isDebugEnabled())
+						log.debug("No beans to invoke on sequence " + sequenceId);
 					continue;
 				}
 				
@@ -300,6 +304,9 @@
 				//TODO correct the locking mechanism to have one lock per sequence.
 				
 				if (stMapIt.hasNext()) { //some invokation work is present
+					if (!isThreadStarted())
+						continue;
+					
 					InvokerBean bean = (InvokerBean) stMapIt.next();
 					//see if this is an out of order msg
 					boolean beanIsOutOfOrderMsg = bean.getMsgNo()!=nextMsgno;

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/SenderWorker.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/SenderWorker.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/SenderWorker.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/SenderWorker.java Fri Jan 19 05:20:44 2007
@@ -299,19 +299,16 @@
 				}
 			}
 
-			if (successfullySent) {
-				if (!msgCtx.isServerSide())
-				{
-					// Commit the transaction to release the SenderBean
+			// Commit the transaction to release the SenderBean
 
-					if (transaction!=null)
-						transaction.commit();
-					
-					transaction = null;
-					checkForSyncResponses(msgCtx);
-				}
-			}
+			if (transaction!=null)
+				transaction.commit();
+			
+			transaction = null;
 
+			if (successfullySent && !msgCtx.isServerSide()) 
+				checkForSyncResponses(msgCtx);
+			
 			if ((rmMsgCtx.getMessageType() == Sandesha2Constants.MessageTypes.TERMINATE_SEQ)
 					&&
 					 (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(rmMsgCtx.getRMNamespaceValue()))) {
@@ -329,6 +326,8 @@
 				RMSBean rmsBean = SandeshaUtil.getRMSBeanFromSequenceId(storageManager, sequenceID);
 				TerminateManager.terminateSendingSide(rmsBean, msgCtx.isServerSide(),
 						storageManager);
+				
+				transaction.commit();
 			}
 
 		} catch (Exception e) {

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/MessageContextPropertyTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/MessageContextPropertyTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/MessageContextPropertyTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/MessageContextPropertyTest.java Fri Jan 19 05:20:44 2007
@@ -141,7 +141,7 @@
 		Long lastReceivedMessage = null;
 		String sequenceId = null;
 		
-		public void invokeBusinessLogic(MessageContext msgContext) throws AxisFault {
+		public void invokeBusinessLogic(MessageContext msgContext) {
 			Long msgNo = (Long) msgContext.getProperty(Sandesha2Constants.MessageContextProperties.MESSAGE_NUMBER);
 			String sequenceId = (String) msgContext.getProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_ID);
 			

Added: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientAckRequestWaitTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientAckRequestWaitTest.java?view=auto&rev=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientAckRequestWaitTest.java (added)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientAckRequestWaitTest.java Fri Jan 19 05:20:44 2007
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.sandesha2;
+
+import java.io.File;
+
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+
+public class SandeshaClientAckRequestWaitTest extends SandeshaTestCase {
+
+	String server_repoPath = "target" + File.separator + "repos" + File.separator + "server";
+	String server_axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
+
+	public SandeshaClientAckRequestWaitTest () {
+		super ("SandeshaClientTest");
+	}
+
+	public void setUp () throws Exception {
+	}
+
+    /**
+		 * Checks the following scenario
+		 * 
+		 * Don't start the server
+		 * 1) send an application message (will generate the create sequence)
+		 * 2) Send ACK Request (should not be rejected)
+		 * 3) start the server
+		 * 4) wait a bit then terminate sequence
+		 * 5) Issue wait until sequence completed (with a wait time)
+		 * 6) Ensure that the sequence was terminated
+		 * 
+		 */
+		public void testAckRequestWithWait () throws Exception {
+			String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+			
+			String repoPath = "target" + File.separator + "repos" + File.separator + "client";
+			String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
+			
+			ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+			
+			Options clientOptions = new Options ();
+			clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+		   clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION, 
+		       Sandesha2Constants.SPEC_VERSIONS.v1_1);
+			clientOptions.setTo(new EndpointReference (to));
+			
+			ServiceClient serviceClient = new ServiceClient (configContext,null);
+			clientOptions.setAction(pingAction);
+			
+			String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+			clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+			clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+				//serviceClient.
+			serviceClient.setOptions(clientOptions);
+				
+			try{
+				// 1) Send the application message
+				serviceClient.fireAndForget(getPingOMBlock("ping1"));
+				
+				// 2) Send Ack request for the sequence
+				SandeshaClient.sendAckRequest(serviceClient);
+								
+				// 3) Start the server			
+				startServer(server_repoPath, server_axis2_xml);
+
+				// 4) Wait a bit then terminate
+				long limit = System.currentTimeMillis() + waitTime;
+				Error lastError = null;
+				while(System.currentTimeMillis() < limit) {
+					Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
+					
+					try {
+						//now check the sequence is running
+						SequenceReport report = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+						assertEquals(report.getSequenceStatus(), SequenceReport.SEQUENCE_STATUS_ESTABLISHED);
+
+						lastError = null;
+						break;
+					} catch(Error e) {
+						lastError = e;
+					}
+				}
+				if(lastError != null) throw lastError;
+				
+				SandeshaClient.terminateSequence(serviceClient);
+				
+				// 5) wait for the sequence completion (30 second wait)
+				SandeshaClient.waitUntilSequenceCompleted(serviceClient, 30000);
+				
+				// 6) Check that the sequence has terminated
+				SequenceReport report = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+				assertNotNull(report);
+				assertEquals(SequenceReport.SEQUENCE_STATUS_TERMINATED, report.getSequenceStatus());
+
+			}
+			finally {
+				configContext.getListenerManager().stop();
+				serviceClient.cleanup();			
+			}
+			
+		}
+	
+}

Added: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientCloseWaitTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientCloseWaitTest.java?view=auto&rev=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientCloseWaitTest.java (added)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientCloseWaitTest.java Fri Jan 19 05:20:44 2007
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.sandesha2;
+
+import java.io.File;
+
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+
+public class SandeshaClientCloseWaitTest extends SandeshaTestCase {
+
+	String server_repoPath = "target" + File.separator + "repos" + File.separator + "server";
+	String server_axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
+
+	public SandeshaClientCloseWaitTest () {
+		super ("SandeshaClientTest");
+	}
+
+		/**
+		 * Checks the following scenario
+		 * 
+		 * Don't start the server
+		 * 1) send an application message (will generate the create sequence)
+		 * 2) close the sequence
+		 * 3) send another application message (this should fail)
+		 * 4) start the server
+		 * 5) wait a bit then terminate sequence
+		 * 6) Issue wait until sequence completed (with a wait time)
+		 * 7) Ensure that the sequence was terminated
+		 * 
+		 */
+		public void testCloseSequenceWithWait () throws Exception {
+			String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+			
+			String repoPath = "target" + File.separator + "repos" + File.separator + "client";
+			String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
+			
+			ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+			
+			Options clientOptions = new Options ();
+			clientOptions.setAction(pingAction);
+			clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+		   clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION, 
+		       Sandesha2Constants.SPEC_VERSIONS.v1_1);
+			clientOptions.setTo(new EndpointReference (to));
+			
+			ServiceClient serviceClient = new ServiceClient (configContext,null);
+			
+			String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+			clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+			clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+				//serviceClient.
+			serviceClient.setOptions(clientOptions);
+				
+			try{
+				// 1) Send the application message
+				serviceClient.fireAndForget(getPingOMBlock("ping1"));
+				
+				// 2) Close the sequence
+				SandeshaClient.closeSequence(serviceClient);
+				
+				// 3) Send the second application message (this should fail)
+				try{
+					serviceClient.fireAndForget(getPingOMBlock("ping2"));
+					fail(); //this should have failed
+				}
+				catch(Exception e){
+					//good
+				}
+				
+				// 4) Start the server			
+				startServer(server_repoPath, server_axis2_xml);
+
+				// 5) Wait a bit then terminate
+				long limit = System.currentTimeMillis() + waitTime;
+				Error lastError = null;
+				while(System.currentTimeMillis() < limit) {
+					Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
+					
+					try {
+						//now check the sequence is running
+						SequenceReport report = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+						assertEquals(report.getSequenceStatus(), SequenceReport.SEQUENCE_STATUS_ESTABLISHED);
+
+						lastError = null;
+						break;
+					} catch(Error e) {
+						lastError = e;
+					}
+				}
+				if(lastError != null) throw lastError;
+				SandeshaClient.terminateSequence(serviceClient);
+				
+				// 6) wait for the sequence completion (30 second wait)
+				SandeshaClient.waitUntilSequenceCompleted(serviceClient, 30000);
+				
+				// 7) Check that the sequence has terminated
+				SequenceReport report = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+				assertNotNull(report);
+				assertEquals(SequenceReport.SEQUENCE_STATUS_TERMINATED, report.getSequenceStatus());
+
+			}
+			finally {
+				configContext.getListenerManager().stop();
+				serviceClient.cleanup();			
+			}
+			
+		}
+}

Added: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientLastErrorTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientLastErrorTest.java?view=auto&rev=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientLastErrorTest.java (added)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientLastErrorTest.java Fri Jan 19 05:20:44 2007
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.sandesha2;
+
+import java.io.File;
+
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axis2.Constants.Configuration;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+
+public class SandeshaClientLastErrorTest extends SandeshaTestCase {
+
+	String server_repoPath = "target" + File.separator + "repos" + File.separator + "server";
+	String server_axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
+
+	public SandeshaClientLastErrorTest () {
+		super ("SandeshaClientTest");
+	}
+	
+	/**
+	 * Tests that the last error and timestamp are set for the simple case of the target service not being available
+	 */
+	public void testLastErrorAndTimestamp() throws Exception
+	{
+		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+		String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+
+		String repoPath = "target" + File.separator + "repos" + File.separator + "client";
+		String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
+
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+
+		//clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+		Options clientOptions = new Options ();
+		clientOptions.setAction(pingAction);
+		clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+		
+		clientOptions.setTo(new EndpointReference (to));
+		clientOptions.setProperty(Configuration.TRANSPORT_URL,transportTo);
+		
+		String sequenceKey = "sequence1";
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+		
+		ServiceClient serviceClient = new ServiceClient (configContext,null);
+		
+		serviceClient.setOptions(clientOptions);
+	
+		serviceClient.fireAndForget(getPingOMBlock("ping1"));
+		
+		// Let an error occur before we start the server
+		long limit = System.currentTimeMillis() + waitTime;
+		Error lastError = null;
+		while(System.currentTimeMillis() < limit) {
+			Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
+			
+			try {
+				// Check that the last error and last error time stamp have been set
+				Exception lastSendError = SandeshaClient.getLastSendError(serviceClient);
+				long lastSendErrorTime = SandeshaClient.getLastSendErrorTimestamp(serviceClient);
+				
+				// Check the values are valid
+				assertNotNull(lastSendError);
+				assertTrue(lastSendErrorTime > -1);
+
+				lastError = null;
+				break;
+			} catch(Error e) {
+				lastError = e;
+			}
+		}
+		if(lastError != null) throw lastError;
+		
+		startServer(server_repoPath, server_axis2_xml);
+
+		serviceClient.fireAndForget(getPingOMBlock("ping2"));
+		
+		
+		limit = System.currentTimeMillis() + waitTime;
+		while(System.currentTimeMillis() < limit) {
+			Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
+			
+			try {
+				SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+				assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
+				assertTrue(sequenceReport.getCompletedMessages().contains(new Long(2)));
+				assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
+
+				lastError = null;
+				break;
+			} catch(Error e) {
+				lastError = e;
+			}
+		}
+		if(lastError != null) throw lastError;
+	
+		SandeshaClient.terminateSequence(serviceClient, sequenceKey);
+		
+		configContext.getListenerManager().stop();
+		serviceClient.cleanup();
+	}
+	
+}

Added: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientTerminateWaitTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientTerminateWaitTest.java?view=auto&rev=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientTerminateWaitTest.java (added)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientTerminateWaitTest.java Fri Jan 19 05:20:44 2007
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.sandesha2;
+
+import java.io.File;
+
+import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+
+public class SandeshaClientTerminateWaitTest extends SandeshaTestCase {
+
+	String server_repoPath = "target" + File.separator + "repos" + File.separator + "server";
+	String server_axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
+
+	public SandeshaClientTerminateWaitTest () {
+		super ("SandeshaClientTest");
+	}
+
+  /**
+	 * Checks the following scenario
+	 * 
+	 * Don't start the server
+	 * 1) send an application message (will generate the create sequence)
+	 * 2) terminate the sequence
+	 * 3) send another application message (this should fail)
+	 * 4) start the server
+	 * 5) Issue wait until sequence completed (with a wait time)
+	 * 6) Ensure that the sequence was terminated
+	 * 
+	 */
+	public void testTerminateSequenceWithWait () throws Exception {
+		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
+		
+		String repoPath = "target" + File.separator + "repos" + File.separator + "client";
+		String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
+		
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
+		
+		Options clientOptions = new Options ();
+		clientOptions.setAction(pingAction);
+		clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+	   clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION, 
+	       Sandesha2Constants.SPEC_VERSIONS.v1_1);
+		clientOptions.setTo(new EndpointReference (to));
+		
+		ServiceClient serviceClient = new ServiceClient (configContext,null);
+		
+		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+			//serviceClient.
+		serviceClient.setOptions(clientOptions);
+			
+		try{
+			// 1) Send the application message
+			serviceClient.fireAndForget(getPingOMBlock("ping1"));
+			
+			// 2) Terminate the sequence
+			SandeshaClient.terminateSequence(serviceClient);
+			
+			// 3) Send the second application message (this should fail)
+			try{
+				serviceClient.fireAndForget(getPingOMBlock("ping2"));
+				fail(); //this should have failed
+			}
+			catch(Exception e){
+				//good
+			}
+			
+			// 4) Start the server			
+			startServer(server_repoPath, server_axis2_xml);
+
+			// 5) wait for the sequence completion (30 second wait)
+			SandeshaClient.waitUntilSequenceCompleted(serviceClient, 30000);
+			
+			// 6) Check that the sequence has terminated
+			SequenceReport report = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+			assertNotNull(report);
+			assertEquals(SequenceReport.SEQUENCE_STATUS_TERMINATED, report.getSequenceStatus());
+
+		}
+		finally {
+			configContext.getListenerManager().stop();
+			serviceClient.cleanup();			
+		}		
+	}
+}

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaClientTest.java Fri Jan 19 05:20:44 2007
@@ -39,11 +39,28 @@
 
 	String server_repoPath = "target" + File.separator + "repos" + File.separator + "server";
 	String server_axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
+	private static boolean startedServer = false;
 
 	public SandeshaClientTest () {
 		super ("SandeshaClientTest");
 	}
 
+	public void setUp () throws Exception {
+		super.setUp();
+		String repoPath = "target" + File.separator + "repos" + File.separator + "server";
+		String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
+		if (!startedServer)
+			startServer(repoPath, axis2_xml);
+		startedServer = true;
+	}
+	
+	/**
+	 * Override the teardown processing
+	 */
+	public void tearDown () {
+	
+	}
+
 	public void testCreateSequenceWithOffer () throws Exception {
 		
 		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
@@ -63,7 +80,6 @@
 		
 		ServiceClient serviceClient = new ServiceClient (configContext,null);
 		
-		startServer(server_repoPath, server_axis2_xml);
 		try
 		{
 			String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
@@ -112,7 +128,6 @@
 	}
 	
 	public void testSequenceCloseTerminate()throws Exception{
-			startServer(server_repoPath, server_axis2_xml);
 			String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
 			
 			String repoPath = "target" + File.separator + "repos" + File.separator + "client";
@@ -215,248 +230,6 @@
 //	}
 //
 
-    /**
-		 * Checks the following scenario
-		 * 
-		 * Don't start the server
-		 * 1) send an application message (will generate the create sequence)
-		 * 2) Send ACK Request (should not be rejected)
-		 * 3) start the server
-		 * 4) wait a bit then terminate sequence
-		 * 5) Issue wait until sequence completed (with a wait time)
-		 * 6) Ensure that the sequence was terminated
-		 * 
-		 */
-		public void testAckRequestWithWait () throws Exception {
-			String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
-			
-			String repoPath = "target" + File.separator + "repos" + File.separator + "client";
-			String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
-			
-			ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
-			
-			Options clientOptions = new Options ();
-			clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-		   clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION, 
-		       Sandesha2Constants.SPEC_VERSIONS.v1_1);
-			clientOptions.setTo(new EndpointReference (to));
-			
-			ServiceClient serviceClient = new ServiceClient (configContext,null);
-			clientOptions.setAction(pingAction);
-			
-			String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
-			clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
-			clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-				//serviceClient.
-			serviceClient.setOptions(clientOptions);
-				
-			try{
-				// 1) Send the application message
-				serviceClient.fireAndForget(getPingOMBlock("ping1"));
-				
-				// 2) Send Ack request for the sequence
-				SandeshaClient.sendAckRequest(serviceClient);
-								
-				// 3) Start the server			
-				startServer(server_repoPath, server_axis2_xml);
-
-				// 4) Wait a bit then terminate
-				long limit = System.currentTimeMillis() + waitTime;
-				Error lastError = null;
-				while(System.currentTimeMillis() < limit) {
-					Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
-					
-					try {
-						//now check the sequence is running
-						SequenceReport report = SandeshaClient.getOutgoingSequenceReport(serviceClient);
-						assertEquals(report.getSequenceStatus(), SequenceReport.SEQUENCE_STATUS_ESTABLISHED);
-
-						lastError = null;
-						break;
-					} catch(Error e) {
-						lastError = e;
-					}
-				}
-				if(lastError != null) throw lastError;
-				
-				SandeshaClient.terminateSequence(serviceClient);
-				
-				// 5) wait for the sequence completion (30 second wait)
-				SandeshaClient.waitUntilSequenceCompleted(serviceClient, 30000);
-				
-				// 6) Check that the sequence has terminated
-				SequenceReport report = SandeshaClient.getOutgoingSequenceReport(serviceClient);
-				assertNotNull(report);
-				assertEquals(SequenceReport.SEQUENCE_STATUS_TERMINATED, report.getSequenceStatus());
-
-			}
-			finally {
-				configContext.getListenerManager().stop();
-				serviceClient.cleanup();			
-			}
-			
-		}
-
-		/**
-		 * Checks the following scenario
-		 * 
-		 * Don't start the server
-		 * 1) send an application message (will generate the create sequence)
-		 * 2) close the sequence
-		 * 3) send another application message (this should fail)
-		 * 4) start the server
-		 * 5) wait a bit then terminate sequence
-		 * 6) Issue wait until sequence completed (with a wait time)
-		 * 7) Ensure that the sequence was terminated
-		 * 
-		 */
-		public void testCloseSequenceWithWait () throws Exception {
-			String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
-			
-			String repoPath = "target" + File.separator + "repos" + File.separator + "client";
-			String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
-			
-			ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
-			
-			Options clientOptions = new Options ();
-			clientOptions.setAction(pingAction);
-			clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-		   clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION, 
-		       Sandesha2Constants.SPEC_VERSIONS.v1_1);
-			clientOptions.setTo(new EndpointReference (to));
-			
-			ServiceClient serviceClient = new ServiceClient (configContext,null);
-			
-			String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
-			clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
-			clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-				//serviceClient.
-			serviceClient.setOptions(clientOptions);
-				
-			try{
-				// 1) Send the application message
-				serviceClient.fireAndForget(getPingOMBlock("ping1"));
-				
-				// 2) Close the sequence
-				SandeshaClient.closeSequence(serviceClient);
-				
-				// 3) Send the second application message (this should fail)
-				try{
-					serviceClient.fireAndForget(getPingOMBlock("ping2"));
-					fail(); //this should have failed
-				}
-				catch(Exception e){
-					//good
-				}
-				
-				// 4) Start the server			
-				startServer(server_repoPath, server_axis2_xml);
-
-				// 5) Wait a bit then terminate
-				long limit = System.currentTimeMillis() + waitTime;
-				Error lastError = null;
-				while(System.currentTimeMillis() < limit) {
-					Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
-					
-					try {
-						//now check the sequence is running
-						SequenceReport report = SandeshaClient.getOutgoingSequenceReport(serviceClient);
-						assertEquals(report.getSequenceStatus(), SequenceReport.SEQUENCE_STATUS_ESTABLISHED);
-
-						lastError = null;
-						break;
-					} catch(Error e) {
-						lastError = e;
-					}
-				}
-				if(lastError != null) throw lastError;
-				SandeshaClient.terminateSequence(serviceClient);
-				
-				// 6) wait for the sequence completion (30 second wait)
-				SandeshaClient.waitUntilSequenceCompleted(serviceClient, 30000);
-				
-				// 7) Check that the sequence has terminated
-				SequenceReport report = SandeshaClient.getOutgoingSequenceReport(serviceClient);
-				assertNotNull(report);
-				assertEquals(SequenceReport.SEQUENCE_STATUS_TERMINATED, report.getSequenceStatus());
-
-			}
-			finally {
-				configContext.getListenerManager().stop();
-				serviceClient.cleanup();			
-			}
-			
-		}
-
-  /**
-	 * Checks the following scenario
-	 * 
-	 * Don't start the server
-	 * 1) send an application message (will generate the create sequence)
-	 * 2) terminate the sequence
-	 * 3) send another application message (this should fail)
-	 * 4) start the server
-	 * 5) Issue wait until sequence completed (with a wait time)
-	 * 6) Ensure that the sequence was terminated
-	 * 
-	 */
-	public void testTerminateSequenceWithWait () throws Exception {
-		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
-		
-		String repoPath = "target" + File.separator + "repos" + File.separator + "client";
-		String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
-		
-		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
-		
-		Options clientOptions = new Options ();
-		clientOptions.setAction(pingAction);
-		clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-	   clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION, 
-	       Sandesha2Constants.SPEC_VERSIONS.v1_1);
-		clientOptions.setTo(new EndpointReference (to));
-		
-		ServiceClient serviceClient = new ServiceClient (configContext,null);
-		
-		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
-		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
-		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-			//serviceClient.
-		serviceClient.setOptions(clientOptions);
-			
-		try{
-			// 1) Send the application message
-			serviceClient.fireAndForget(getPingOMBlock("ping1"));
-			
-			// 2) Terminate the sequence
-			SandeshaClient.terminateSequence(serviceClient);
-			
-			// 3) Send the second application message (this should fail)
-			try{
-				serviceClient.fireAndForget(getPingOMBlock("ping2"));
-				fail(); //this should have failed
-			}
-			catch(Exception e){
-				//good
-			}
-			
-			// 4) Start the server			
-			startServer(server_repoPath, server_axis2_xml);
-
-			// 5) wait for the sequence completion (30 second wait)
-			SandeshaClient.waitUntilSequenceCompleted(serviceClient, 30000);
-			
-			// 6) Check that the sequence has terminated
-			SequenceReport report = SandeshaClient.getOutgoingSequenceReport(serviceClient);
-			assertNotNull(report);
-			assertEquals(SequenceReport.SEQUENCE_STATUS_TERMINATED, report.getSequenceStatus());
-
-		}
-		finally {
-			configContext.getListenerManager().stop();
-			serviceClient.cleanup();			
-		}		
-	}
-	
   /**
 	 * Checks the following scenario
 	 * 
@@ -471,8 +244,6 @@
 	 */
 	public void testTerminateCreateWithWait () throws Exception {
 
-		startServer(server_repoPath, server_axis2_xml);
-
 		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
 		
 		String repoPath = "target" + File.separator + "repos" + File.separator + "client";
@@ -540,7 +311,6 @@
 	 * SenderBean no longer exists for it.
 	 */
 	public void testAckRequest () throws Exception {
-		startServer(server_repoPath, server_axis2_xml);
 		
 		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
 		String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
@@ -631,87 +401,5 @@
 //	public void getSequenceIDTest () {
 //		
 //	}
-	
-	/**
-	 * Tests that the last error and timestamp are set for the simple case of the target service not being available
-	 */
-	public void testLastErrorAndTimestamp() throws Exception
-	{
-		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
-		String transportTo = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
-
-		String repoPath = "target" + File.separator + "repos" + File.separator + "client";
-		String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
-
-		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
-
-		//clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-		Options clientOptions = new Options ();
-		clientOptions.setAction(pingAction);
-		clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-		
-		clientOptions.setTo(new EndpointReference (to));
-		clientOptions.setProperty(Configuration.TRANSPORT_URL,transportTo);
-		
-		String sequenceKey = "sequence1";
-		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
-		
-		ServiceClient serviceClient = new ServiceClient (configContext,null);
-		
-		serviceClient.setOptions(clientOptions);
-	
-		serviceClient.fireAndForget(getPingOMBlock("ping1"));
-		
-		// Let an error occur before we start the server
-		long limit = System.currentTimeMillis() + waitTime;
-		Error lastError = null;
-		while(System.currentTimeMillis() < limit) {
-			Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
-			
-			try {
-				// Check that the last error and last error time stamp have been set
-				Exception lastSendError = SandeshaClient.getLastSendError(serviceClient);
-				long lastSendErrorTime = SandeshaClient.getLastSendErrorTimestamp(serviceClient);
-				
-				// Check the values are valid
-				assertNotNull(lastSendError);
-				assertTrue(lastSendErrorTime > -1);
-
-				lastError = null;
-				break;
-			} catch(Error e) {
-				lastError = e;
-			}
-		}
-		if(lastError != null) throw lastError;
-		
-		startServer(server_repoPath, server_axis2_xml);
-
-		serviceClient.fireAndForget(getPingOMBlock("ping2"));
-		
-		
-		limit = System.currentTimeMillis() + waitTime;
-		while(System.currentTimeMillis() < limit) {
-			Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
-			
-			try {
-				SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
-				assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
-				assertTrue(sequenceReport.getCompletedMessages().contains(new Long(2)));
-				assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
-
-				lastError = null;
-				break;
-			} catch(Error e) {
-				lastError = e;
-			}
-		}
-		if(lastError != null) throw lastError;
-	
-		SandeshaClient.terminateSequence(serviceClient, sequenceKey);
-		
-		configContext.getListenerManager().stop();
-		serviceClient.cleanup();
-	}
 	
 }

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaReportsTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaReportsTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaReportsTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaReportsTest.java Fri Jan 19 05:20:44 2007
@@ -35,6 +35,8 @@
 
 public class SandeshaReportsTest extends SandeshaTestCase {
 
+	private static boolean startedServer = false;
+
 	public SandeshaReportsTest () {
 		super ("SandeshaReportsTest");
 	}
@@ -45,7 +47,16 @@
 		String repoPath = "target" + File.separator + "repos" + File.separator + "server";
 		String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
 
-		startServer(repoPath, axis2_xml);
+		if (!startedServer)
+			startServer(repoPath, axis2_xml);
+		startedServer = true;
+	}
+	
+	/**
+	 * Override the teardown processing
+	 */
+	public void tearDown () {
+	
 	}
 	
 	public void testSequenceReports () throws Exception  {

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaTestCase.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaTestCase.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaTestCase.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaTestCase.java Fri Jan 19 05:20:44 2007
@@ -199,8 +199,8 @@
     public String getTestProperty (String key) {
     	if (properties!=null)
     		return properties.getProperty(key);
-    	else 
-    		return null;
+    	 
+    	return null;
     }
     
     public void overrideConfigurationContext (ConfigurationContext context,MessageReceiver messageReceiver, String operationName, boolean newOperation, int mep) throws Exception  {

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaUtilTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaUtilTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaUtilTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/SandeshaUtilTest.java Fri Jan 19 05:20:44 2007
@@ -41,7 +41,7 @@
 		assertTrue(UUID2.startsWith("urn:uuid:"));
 	}
 	
-	public void testInternalSequenceIDToSequenceKeyConversion()throws SandeshaException{
+	public void testInternalSequenceIDToSequenceKeyConversion() {
 		String toEPR = "http://127.0.0.1:1111/some_random_uri";
 		String sequenceKey = "1234abcd";
 		

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/AddressableEchoTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/AddressableEchoTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/AddressableEchoTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/AddressableEchoTest.java Fri Jan 19 05:20:44 2007
@@ -19,6 +19,7 @@
 public class AddressableEchoTest extends SandeshaTestCase {
 
 	int serverPort = DEFAULT_SERVER_TEST_PORT;
+	private static boolean serverStarted = false; 
 	
 	public AddressableEchoTest () {
 		super ("AddressableEchoTest");
@@ -30,9 +31,18 @@
 		String repoPath = "target" + File.separator + "repos" + File.separator + "server";
 		String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
 
-		startServer(repoPath, axis2_xml);
+		if (!serverStarted)
+			startServer(repoPath, axis2_xml);
+		serverStarted = true;
 	}
 	
+	/**
+	 * Override the teardown processing
+	 */
+	public void tearDown () {
+	
+	}
+
 	public void testAsyncEcho () throws Exception {
 	
 		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
@@ -51,12 +61,11 @@
 		
 		ServiceClient serviceClient = new ServiceClient (configContext,null);
 		
-		String acksTo = null;//serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+		String acksTo = null;
 		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
 		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
 		
 		serviceClient.setOptions(clientOptions);
-		//serviceClient.
 		
 		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
 		clientOptions.setUseSeparateListener(true);
@@ -136,28 +145,18 @@
 		
 		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
 
+		ServiceClient serviceClient = new ServiceClient (configContext,null);
+		String sequenceKey = SandeshaUtil.getUUID();
+		String offeredSequenceId = SandeshaUtil.getUUID();
 		Options clientOptions = new Options ();
 		clientOptions.setAction(echoAction);
-		clientOptions.setTo(new EndpointReference (to));
-		
-		String sequenceKey = SandeshaUtil.getUUID();
+		clientOptions.setTo(new EndpointReference (to));		
 		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
-		
-		ServiceClient serviceClient = new ServiceClient (configContext,null);
-		
-		String acksTo = null;//serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
-		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+		clientOptions.setProperty(SandeshaClientConstants.AcksTo,null);
 		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-		
-		String offeredSequenceId = SandeshaUtil.getUUID();
-		clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,offeredSequenceId);
-		
-		serviceClient.setOptions(clientOptions);
-		//serviceClient.
-		
+		clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,offeredSequenceId);		
 		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-		clientOptions.setUseSeparateListener(true);
-		
+		clientOptions.setUseSeparateListener(true);	
 		clientOptions.setAction("urn:wsrm:EchoString");
 		
 		serviceClient.setOptions(clientOptions);

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/AnonymousEchoTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/AnonymousEchoTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/AnonymousEchoTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/AnonymousEchoTest.java Fri Jan 19 05:20:44 2007
@@ -40,6 +40,8 @@
  */
 public class AnonymousEchoTest extends SandeshaTestCase {
 
+	private static boolean startedServer = false;
+	
 	public AnonymousEchoTest () {
 		super ("AnonymousEchoTest");
 	}
@@ -48,11 +50,19 @@
 		super.setUp();
 		String repoPath = "target" + File.separator + "repos" + File.separator + "server";
 		String axis2_xml = repoPath + File.separator + "server_axis2.xml";
-		startServer(repoPath, axis2_xml);
+		if (!startedServer)
+			startServer(repoPath, axis2_xml);
+		startedServer = true;
 	}
+
+	/**
+	 * Override the teardown processing
+	 */
+	public void tearDown () {
 	
-	public void testSyncEchoWithOffer_1_1 () throws Exception {
+	}
 
+	public void testSyncEchoWithOffer_1_1 () throws Exception {	
 		Options clientOptions = new Options ();
 		String offeredSequenceID = SandeshaUtil.getUUID();
 		clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,offeredSequenceID);

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/OptionalReliabilityTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/OptionalReliabilityTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/OptionalReliabilityTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/scenarios/OptionalReliabilityTest.java Fri Jan 19 05:20:44 2007
@@ -60,7 +60,7 @@
 		serviceClient.cleanup();
 	}
 
-	public void testSyncEcho () throws AxisFault, InterruptedException {
+	public void testSyncEcho () throws AxisFault {
 		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
 		
 		String repoPath = "target" + File.separator + "repos" + File.separator + "client";

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/security/UnitTestSecurityManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/security/UnitTestSecurityManager.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/security/UnitTestSecurityManager.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/security/UnitTestSecurityManager.java Fri Jan 19 05:20:44 2007
@@ -54,7 +54,6 @@
 	}
 
 	public SecurityToken getSecurityToken(MessageContext message)
-	throws SandeshaException
 	{
 		log.debug("Enter: UnitTestSecurityManager::getSecurityToken(MessageContext)");
 
@@ -66,7 +65,6 @@
 	}
 
 	public SecurityToken getSecurityToken(OMElement theSTR,	MessageContext message)
-	throws SandeshaException
 	{
 		log.debug("Enter: UnitTestSecurityManager::getSecurityToken(OMElement,MessageContext)");
 
@@ -79,15 +77,14 @@
 		return result;
 	}
 
-	public String getTokenRecoveryData(SecurityToken token) throws SandeshaException {
+	public String getTokenRecoveryData(SecurityToken token)  {
 		log.debug("Enter: UnitTestSecurityManager::getTokenRecoveryData");
 		String key = ((UnitTestSecurityToken)token).getURI();
 		log.debug("Exit: UnitTestSecurityManager::getTokenRecoveryData " + key);
 		return key;
 	}
 
-	public SecurityToken recoverSecurityToken(String tokenData)
-			throws SandeshaException {
+	public SecurityToken recoverSecurityToken(String tokenData) {
 		log.debug("Enter: UnitTestSecurityManager::recoverSecurityToken");
 		SecurityToken result = (SecurityToken) tokens.get(tokenData);
 		log.debug("Exit: UnitTestSecurityManager::recoverSecurityToken " + result);
@@ -118,7 +115,7 @@
 		log.debug("Exit: UnitTestSecurityManager::checkProofOfPossession");
 	}
 
-	public OMElement createSecurityTokenReference(SecurityToken token, MessageContext message) throws SandeshaException {
+	public OMElement createSecurityTokenReference(SecurityToken token, MessageContext message) {
 		log.debug("Enter: UnitTestSecurityManager::createSecurityTokenReference");
 
 		String uri = ((UnitTestSecurityToken)token).getURI();

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/storage/SenderBeanMgrTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/storage/SenderBeanMgrTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/storage/SenderBeanMgrTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/storage/SenderBeanMgrTest.java Fri Jan 19 05:20:44 2007
@@ -72,7 +72,7 @@
         assertNotNull(mgr.retrieve("MsgId1"));
     }
 
-    public void testFind() throws SandeshaStorageException {
+    public void testFind() {
         try {
             mgr.insert(new SenderBean("MsgId2", "Key2", false , 1001 , "TmpSeqId2", 1002));
             mgr.insert(new SenderBean("MsgId3", "Key3", false , 1001 , "TmpSeqId2", 1003));
@@ -99,7 +99,7 @@
 
     }
 
-    public void testInsert() throws SandeshaStorageException {
+    public void testInsert() {
 //        try {
 //            mgr.insert(new SenderBean());
 //            fail("should throw an exception");

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/AddressingVersionTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/AddressingVersionTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/AddressingVersionTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/AddressingVersionTest.java Fri Jan 19 05:20:44 2007
@@ -31,7 +31,8 @@
 import org.apache.sandesha2.client.SequenceReport;
 
 public class AddressingVersionTest extends SandeshaTestCase {
-	
+
+	private static boolean serverStarted = false;
 
 	public AddressingVersionTest () {
 		super ("AddressingVersionTest");
@@ -41,7 +42,16 @@
 		super.setUp();
 		String repoPath = "target" + File.separator + "repos" + File.separator + "server";
 		String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
-		startServer(repoPath, axis2_xml);
+		if (!serverStarted)
+			startServer(repoPath, axis2_xml);
+		serverStarted = true;
+	}
+	
+	/**
+	 * Override the teardown processing
+	 */
+	public void tearDown () {
+	
 	}
 	
 	public void testAddressingFinal() throws Exception  {

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/RMVersionTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/RMVersionTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/RMVersionTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/RMVersionTest.java Fri Jan 19 05:20:44 2007
@@ -32,6 +32,8 @@
 
 public class RMVersionTest extends SandeshaTestCase {
 
+	private static boolean serverStarted = false;
+
 	public RMVersionTest () {
 		super ("RMVersionTest");
 	}
@@ -40,9 +42,18 @@
 		super.setUp();
 		String repoPath = "target" + File.separator + "repos" + File.separator + "server";
 		String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
-		startServer(repoPath, axis2_xml);
+		if (!serverStarted)
+			startServer(repoPath, axis2_xml);
+		serverStarted = true;
 	}
 	
+	/**
+	 * Override the teardown processing
+	 */
+	public void tearDown () {
+	
+	}
+
 	public void testRMSubmission () throws Exception  {
 		
 		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/SOAPVersionTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/SOAPVersionTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/SOAPVersionTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/versions/SOAPVersionTest.java Fri Jan 19 05:20:44 2007
@@ -33,6 +33,8 @@
 
 public class SOAPVersionTest extends SandeshaTestCase {
 
+	private static boolean serverStarted = false;
+
 	public SOAPVersionTest () {
 		super ("SOAPVersionTest");
 	}
@@ -41,7 +43,16 @@
 		super.setUp();
 		String repoPath = "target" + File.separator + "repos" + File.separator + "server";
 		String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
-		startServer(repoPath, axis2_xml);
+		if (!serverStarted)
+		  startServer(repoPath, axis2_xml);
+		serverStarted = true;
+	}
+	
+	/**
+	 * Override the teardown processing
+	 */
+	public void tearDown () {
+	
 	}
 	
 	public void testSOAP11 () throws Exception  {
@@ -109,7 +120,7 @@
 		
 		clientOptions.setTo(new EndpointReference (to));
 		
-		String sequenceKey = "sequence1";
+		String sequenceKey = "sequence2";
 		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
 		
 		//setting the SOAP version as 1.2

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/workers/ForceInboundDispatchTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/workers/ForceInboundDispatchTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/workers/ForceInboundDispatchTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/workers/ForceInboundDispatchTest.java Fri Jan 19 05:20:44 2007
@@ -23,7 +23,8 @@
 
 public class ForceInboundDispatchTest extends SandeshaTestCase  {
 
-	ConfigurationContext serverConfigCtx = null;
+	private static ConfigurationContext serverConfigCtx = null;
+	private static boolean startedServer = false;
 	
 	public ForceInboundDispatchTest () {
         super ("ForceDispatchTest");
@@ -33,9 +34,18 @@
 		super.setUp();
 		String repoPath = "target" + File.separator + "repos" + File.separator + "server";
 		String axis2_xml = "target" + File.separator + "repos" + File.separator + "server" + File.separator + "server_axis2.xml";
-		serverConfigCtx = startServer(repoPath, axis2_xml);
+		if (!startedServer)
+			serverConfigCtx = startServer(repoPath, axis2_xml);
+		startedServer = true;
 	}
 	
+	/**
+	 * Override the teardown processing
+	 */
+	public void tearDown () {
+	
+	}
+
 	public void testForceInvoke () throws AxisFault,InterruptedException  {
 		
 		String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
@@ -123,7 +133,7 @@
 		
 		clientOptions.setTo(new EndpointReference (to));
 		
-		String sequenceKey = "sequence1";
+		String sequenceKey = "sequence2";
 		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
 		ServiceClient serviceClient = new ServiceClient (configContext,null);
 		serviceClient.setOptions(clientOptions);

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/CloseSequenceResponseTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/CloseSequenceResponseTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/CloseSequenceResponseTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/CloseSequenceResponseTest.java Fri Jan 19 05:20:44 2007
@@ -20,7 +20,6 @@
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
 
 import junit.framework.TestCase;
 
@@ -35,9 +34,9 @@
 
     }
 
-    public void testFromOMElement() throws SandeshaException {
+    public void testFromOMElement()  {
     	
     }
 
-    public void testToSOAPEnvelope()  throws SandeshaException {}
+    public void testToSOAPEnvelope() {}
 }

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/CloseSequenceTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/CloseSequenceTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/CloseSequenceTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/CloseSequenceTest.java Fri Jan 19 05:20:44 2007
@@ -20,7 +20,6 @@
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
 
 import junit.framework.TestCase;
 
@@ -35,9 +34,9 @@
 
     }
 
-    public void testFromOMElement() throws SandeshaException {
+    public void testFromOMElement() {
     	
     }
 
-    public void testToSOAPEnvelope()  throws SandeshaException {}
+    public void testToSOAPEnvelope() {}
 }

Modified: webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/TerminateSequenceResponseTest.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/TerminateSequenceResponseTest.java?view=diff&rev=497804&r1=497803&r2=497804
==============================================================================
--- webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/TerminateSequenceResponseTest.java (original)
+++ webservices/sandesha/trunk/java/test/src/org/apache/sandesha2/wsrm/TerminateSequenceResponseTest.java Fri Jan 19 05:20:44 2007
@@ -20,7 +20,6 @@
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.sandesha2.Sandesha2Constants;
-import org.apache.sandesha2.SandeshaException;
 
 import junit.framework.TestCase;
 
@@ -35,9 +34,9 @@
 
     }
 
-    public void testFromOMElement() throws SandeshaException {
+    public void testFromOMElement() {
     	
     }
 
-    public void testToSOAPEnvelope()  throws SandeshaException {}
+    public void testToSOAPEnvelope() {}
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org