You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2011/12/20 21:50:44 UTC

svn commit: r1221487 - /axis/axis2/java/sandesha/trunk/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java

Author: veithen
Date: Tue Dec 20 20:50:43 2011
New Revision: 1221487

URL: http://svn.apache.org/viewvc?rev=1221487&view=rev
Log:
Make TestCallback thread safe.

Modified:
    axis/axis2/java/sandesha/trunk/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java

Modified: axis/axis2/java/sandesha/trunk/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/sandesha/trunk/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java?rev=1221487&r1=1221486&r2=1221487&view=diff
==============================================================================
--- axis/axis2/java/sandesha/trunk/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java (original)
+++ axis/axis2/java/sandesha/trunk/modules/tests/src/test/java/org/apache/sandesha2/SandeshaTestCase.java Tue Dec 20 20:50:43 2011
@@ -220,15 +220,15 @@ public class SandeshaTestCase extends Te
 		boolean errorReported = false;
 		String resultStr;
 		
-		public boolean isComplete() {
+		public synchronized boolean isComplete() {
 			return completed;
 		}
 		
-		public boolean isErrorReported() {
+		public synchronized boolean isErrorReported() {
 			return errorReported;
 		}
 
-		public String getResult () {
+		public synchronized String getResult () {
 			return resultStr;
 		}
 		
@@ -236,23 +236,23 @@ public class SandeshaTestCase extends Te
 			this.name = name;
 		}
 		
-		public void onComplete() {
+		public synchronized void onComplete() {
 			completed = true;
 		}
 
-		public void onMessage(MessageContext result) {
+		public synchronized void onMessage(MessageContext result) {
 			SOAPBody body = result.getEnvelope().getBody();
 			OMElement contents = body.getFirstElement();
 			this.resultStr = checkEchoOMBlock(contents);
 			System.out.println("TestCallback got text: '" + resultStr + "'");
 		}
 		
-		public void onFault(MessageContext result) {
+		public synchronized void onFault(MessageContext result) {
 			errorReported = true;
 			System.out.println("TestCallback got fault: " + result.getEnvelope());
 		}
 
-		public void onError (Exception e) {
+		public synchronized void onError (Exception e) {
 			errorReported = true;
 			System.out.println("TestCallback got exception");
 			e.printStackTrace();