You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2005/05/05 05:36:50 UTC
svn commit: r168250 - in /webservices/axis/trunk/java/modules/core:
project.xml test/org/apache/axis/context/
test/org/apache/axis/context/MEPContextTest.java
Author: chathura
Date: Wed May 4 20:36:48 2005
New Revision: 168250
URL: http://svn.apache.org/viewcvs?rev=168250&view=rev
Log:
Added a test case to test the relates to corelation of the messageContext in the MEPContext.
Added:
webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/
webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/MEPContextTest.java
Modified:
webservices/axis/trunk/java/modules/core/project.xml
Modified: webservices/axis/trunk/java/modules/core/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/project.xml?rev=168250&r1=168249&r2=168250&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/project.xml (original)
+++ webservices/axis/trunk/java/modules/core/project.xml Wed May 4 20:36:48 2005
@@ -106,5 +106,13 @@
<module>true</module>
</properties>
</dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis-wsdl4j</artifactId>
+ <version>1.2-RC3</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
</dependencies>
</project>
Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/MEPContextTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/MEPContextTest.java?rev=168250&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/MEPContextTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/MEPContextTest.java Wed May 4 20:36:48 2005
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2001-2004 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.axis.context;
+
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AbstractTestCase;
+import org.apache.axis.addressing.miheaders.RelatesTo;
+import org.apache.axis.description.AxisOperation;
+import org.apache.axis.description.AxisTransportIn;
+import org.apache.axis.description.AxisTransportOut;
+import org.apache.axis.engine.AxisFault;
+
+/**
+ * @author chathura@opensource.lk
+ *
+ */
+public class MEPContextTest extends AbstractTestCase {
+
+ private EngineContext engineCtx = new EngineContext(null);
+
+ public MEPContextTest(String arg0) {
+ super(arg0);
+ }
+
+ public void testMEPfindingOnRelatesTO() throws Exception{
+ MessageContext messageContext1 = this.getBasicMessageContext();
+
+ messageContext1.setMessageID(new Long(System.currentTimeMillis()).toString());
+ AxisOperation axisOperation = new AxisOperation(new QName("test"));
+ MEPContext mepContext1 = axisOperation.findMEPContext(messageContext1, true);
+
+ MessageContext messageContext2 = this.getBasicMessageContext();
+ messageContext2.setMessageID(new Long(System.currentTimeMillis()).toString());
+ messageContext2.getMessageInformationHeaders().setRelatesTo(new RelatesTo(messageContext1.getMessageID()));
+ MEPContext mepContext2 = axisOperation.findMEPContext(messageContext2, true);
+ assertEquals(mepContext1, mepContext2);
+ }
+
+ public MessageContext getBasicMessageContext() throws AxisFault{
+ return new MessageContext(engineCtx ,new HashMap(), new SessionContext() {
+ /* (non-Javadoc)
+ * @see org.apache.axis.context.SessionContext#get(java.lang.Object)
+ */
+ public Object get(Object key) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis.context.SessionContext#put(java.lang.Object, java.lang.Object)
+ */
+ public void put(Object key, Object obj) {
+ // TODO Auto-generated method stub
+
+ }
+ },new AxisTransportIn(new QName("axis")), new AxisTransportOut(new QName("axis")));
+ }
+
+}