You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by th...@apache.org on 2007/02/09 13:19:59 UTC

svn commit: r505267 - in /webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json: Echo.java JSONIntegrationTest.java

Author: thilina
Date: Fri Feb  9 04:19:58 2007
New Revision: 505267

URL: http://svn.apache.org/viewvc?view=rev&rev=505267
Log:
Fixing the JSON Test to check whether it actually does JSON...
Also fix the client side of the test to use the correct configuration context... 

Modified:
    webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json/Echo.java
    webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json/JSONIntegrationTest.java

Modified: webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json/Echo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json/Echo.java?view=diff&rev=505267&r1=505266&r2=505267
==============================================================================
--- webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json/Echo.java (original)
+++ webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json/Echo.java Fri Feb  9 04:19:58 2007
@@ -1,6 +1,9 @@
 package org.apache.axis2.json;
 
 import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.context.MessageContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -8,7 +11,13 @@
 	private static final Log log = LogFactory.getLog(Echo.class);
     public Echo() {
     }
-     public OMElement echoOM(OMElement omEle) {
-        return omEle;
+     public OMElement echoOM(OMElement omEle) throws AxisFault {
+    	 Object object = MessageContext.getCurrentMessageContext().getProperty(Constants.Configuration.MESSAGE_TYPE);
+    	 String messageType =(String)object;
+    	 if (messageType.indexOf("json")<0)
+    	 {
+    		 throw new AxisFault("Type of the Received Message is not JSON");
+    	 }
+    	 return omEle;
     }
 }

Modified: webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json/JSONIntegrationTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json/JSONIntegrationTest.java?view=diff&rev=505267&r1=505266&r2=505267
==============================================================================
--- webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json/JSONIntegrationTest.java (original)
+++ webservices/axis2/trunk/java/modules/json/test/org/apache/axis2/json/JSONIntegrationTest.java Fri Feb  9 04:19:58 2007
@@ -103,8 +103,8 @@
         options.setTo(targetEPR);
         options.setProperty(Constants.Configuration.MESSAGE_TYPE, messageType);
         options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-        ConfigurationContext clientConfigurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
-        ServiceClient sender = new ServiceClient(clientConfigurationContext, null);
+//        ConfigurationContext clientConfigurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
+        ServiceClient sender = new ServiceClient(configurationContext, null);
         options.setAction(null);
         sender.setOptions(options);
         options.setTo(targetEPR);



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