Author: senaka
Date: Wed Oct 22 06:38:56 2008
New Revision: 707071

URL: http://svn.apache.org/viewvc?rev=707071&view=rev
Log:
Adding latest changes that adds a partial implementation of the test system for 
JMS Transport's Map Message support.

Added:
    
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/async/MapTestCase.java
Modified:
    
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/pom.xml
    
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/TransportTestSuiteBuilder.java
    
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/http/HttpTransportTestSuiteBuilder.java
    
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/tests/pom.xml
    
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/tests/src/test/java/org/apache/axis2/transport/jms/JMSTransportTest.java

Modified: 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/pom.xml
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/pom.xml?rev=707071&r1=707070&r2=707071&view=diff
==============================================================================
--- 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/pom.xml
 (original)
+++ 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/pom.xml
 Wed Oct 22 06:38:56 2008
@@ -76,6 +76,11 @@
             <artifactId>jetty</artifactId>
             <version>5.1.10</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>sciflex-axiom-patch</artifactId>
+            <version>0.9-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 
     <build>

Modified: 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/TransportTestSuiteBuilder.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/TransportTestSuiteBuilder.java?rev=707071&r1=707070&r2=707071&view=diff
==============================================================================
--- 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/TransportTestSuiteBuilder.java
 (original)
+++ 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/TransportTestSuiteBuilder.java
 Wed Oct 22 06:38:56 2008
@@ -27,6 +27,7 @@
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.axis2.transport.testkit.channel.AsyncChannel;
@@ -44,6 +45,7 @@
 import org.apache.axis2.transport.testkit.message.RESTMessage.Parameter;
 import org.apache.axis2.transport.testkit.tests.async.BinaryTestCase;
 import 
org.apache.axis2.transport.testkit.tests.async.LargeSOAPAsyncMessageTestCase;
+import org.apache.axis2.transport.testkit.tests.async.MapTestCase;
 import org.apache.axis2.transport.testkit.tests.async.RESTTestCase;
 import org.apache.axis2.transport.testkit.tests.async.SwATestCase;
 import org.apache.axis2.transport.testkit.tests.async.TextPlainTestCase;
@@ -113,11 +115,13 @@
     private final ResourceList<AsyncTestClient<XMLMessage>> xmlAsyncClients = 
new ResourceList<AsyncTestClient<XMLMessage>>();
     private final ResourceList<AsyncTestClient<RESTMessage>> restAsyncClients 
= new ResourceList<AsyncTestClient<RESTMessage>>();
     private final ResourceList<AsyncTestClient<String>> stringAsyncClients = 
new ResourceList<AsyncTestClient<String>>();
+/*    private final ResourceList<AsyncTestClient<Map>> mapAsyncClients = new 
ResourceList<AsyncTestClient<Map>>();*/
     
     private final ResourceList<AsyncEndpoint<byte[]>> byteAsyncEndpoints = new 
ResourceList<AsyncEndpoint<byte[]>>();
     private final ResourceList<AsyncEndpoint<XMLMessage>> xmlAsyncEndpoints = 
new ResourceList<AsyncEndpoint<XMLMessage>>();
     private final ResourceList<AsyncEndpoint<RESTMessage>> restAsyncEndpoints 
= new ResourceList<AsyncEndpoint<RESTMessage>>();
     private final ResourceList<AsyncEndpoint<String>> stringAsyncEndpoints = 
new ResourceList<AsyncEndpoint<String>>();
+/*    private final ResourceList<AsyncEndpoint<Map>> mapAsyncEndpoints = new 
ResourceList<AsyncEndpoint<Map>>();*/
     
     private final ResourceList<RequestResponseChannel> requestResponseChannels 
= new ResourceList<RequestResponseChannel>();
     
@@ -163,6 +167,10 @@
         xmlAsyncClients.add(adapt(client, MessageEncoder.XML_TO_STRING), 
relatedResources);
         stringAsyncClients.add(client, relatedResources);
     }
+
+    public void addMapAsyncTestClient(AsyncTestClient<Map> client, Object... 
relatedResources) {
+/*        mapAsyncClients.add(client, relatedResources);*/
+    }
     
     public void addAxisAsyncEndpoint(AsyncEndpoint<AxisMessage> endpoint, 
Object... relatedResources) {
         byteAsyncEndpoints.add(adapt(endpoint, MessageDecoder.AXIS_TO_BYTE), 
relatedResources);
@@ -180,6 +188,10 @@
     public void addRESTAsyncEndpoint(AsyncEndpoint<RESTMessage> endpoint, 
Object... relatedResources) {
         restAsyncEndpoints.add(endpoint, relatedResources);
     }
+
+    public void addMapAsyncEndpoint(AsyncEndpoint<Map> endpoint, Object... 
relatedResources) {
+/*        mapAsyncEndpoints.add(endpoint, relatedResources);*/
+    }
     
     public void addRequestResponseChannel(RequestResponseChannel channel, 
Object... relatedResources) {
         requestResponseChannels.add(channel, relatedResources);
@@ -249,6 +261,12 @@
 //                    addTest(new RESTTestCase(env, channel, client, endpoint, 
restTestMessage2));
                 }
             }
+            /*for (ResourceRelation<AsyncTestClient<Map>> client : 
mapAsyncClients) {
+                for (ResourceRelation<AsyncEndpoint<Map>> endpoint : 
mapAsyncEndpoints) {
+                    Object[] resources = merge(env, channel, client, endpoint);
+                    suite.addTest(new 
MapTestCase(channel.getPrimaryResource(), client.getPrimaryResource(), 
endpoint.getPrimaryResource(), resources));
+                }
+            }*/
         }
         for (ResourceRelation<RequestResponseChannel> channel : 
requestResponseChannels) {
             for 
(ResourceRelation<RequestResponseTestClient<XMLMessage,XMLMessage>> client : 
xmlRequestResponseClients) {

Modified: 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/http/HttpTransportTestSuiteBuilder.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/http/HttpTransportTestSuiteBuilder.java?rev=707071&r1=707070&r2=707071&view=diff
==============================================================================
--- 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/http/HttpTransportTestSuiteBuilder.java
 (original)
+++ 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/http/HttpTransportTestSuiteBuilder.java
 Wed Oct 22 06:38:56 2008
@@ -68,16 +68,11 @@
         }
         builder.addRESTAsyncTestClient(new JavaNetRESTClient());
         
-        builder.addAxisAsyncEndpoint(new AxisAsyncEndpoint());
-        builder.addByteArrayAsyncEndpoint(new JettyByteArrayAsyncEndpoint());
-        builder.addRESTAsyncEndpoint(new JettyRESTAsyncEndpoint());
         
         builder.addRequestResponseChannel(channel);
         
         builder.addAxisRequestResponseTestClient(new 
AxisRequestResponseTestClient());
         
-        builder.addEchoEndpoint(new AxisEchoEndpoint());
-        builder.addEchoEndpoint(new JettyEchoEndpoint());
         
         builder.build();
         

Added: 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/async/MapTestCase.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/async/MapTestCase.java?rev=707071&view=auto
==============================================================================
--- 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/async/MapTestCase.java
 (added)
+++ 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/testkit/src/main/java/org/apache/axis2/transport/testkit/tests/async/MapTestCase.java
 Wed Oct 22 06:38:56 2008
@@ -0,0 +1,51 @@
+/*
+ *  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.axis2.transport.testkit.tests.async;
+
+import java.util.Map;
+import java.util.Random;
+import java.util.TreeMap;
+
+import javax.mail.internet.ContentType;
+
+import org.apache.axis2.transport.testkit.channel.AsyncChannel;
+import org.apache.axis2.transport.testkit.client.AsyncTestClient;
+import org.apache.axis2.transport.testkit.endpoint.AsyncEndpoint;
+import org.apache.axis2.transport.testkit.name.Name;
+
[EMAIL PROTECTED]("AsyncMap")
+public class MapTestCase extends AsyncMessageTestCase<Map> {
+    private static final Random random = new Random();
+    
+    public MapTestCase(AsyncChannel channel, AsyncTestClient<Map> client, 
AsyncEndpoint<Map> endpoint, Object... resources) {
+        super(channel, client, endpoint, null, null, resources);
+    }
+    
+    @Override
+    protected Map prepareMessage() throws Exception {
+        Map content = new TreeMap();
+        return content;
+    }
+
+    @Override
+    protected void checkMessageData(Map expected, Map actual) throws Exception 
{
+        assertTrue(expected.equals(actual));
+    }
+}

Modified: 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/tests/pom.xml
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/tests/pom.xml?rev=707071&r1=707070&r2=707071&view=diff
==============================================================================
--- 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/tests/pom.xml
 (original)
+++ 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/tests/pom.xml
 Wed Oct 22 06:38:56 2008
@@ -85,7 +85,12 @@
             <artifactId>axis2-transport-jms</artifactId>
             <version>${pom.version}</version>
             <scope>test</scope>
-        </dependency>    
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>sciflex-axiom-patch</artifactId>
+            <version>0.9-SNAPSHOT</version>
+        </dependency>
         <dependency>
             <groupId>org.mockejb</groupId>
             <artifactId>mockejb</artifactId>

Modified: 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/tests/src/test/java/org/apache/axis2/transport/jms/JMSTransportTest.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/tests/src/test/java/org/apache/axis2/transport/jms/JMSTransportTest.java?rev=707071&r1=707070&r2=707071&view=diff
==============================================================================
--- 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/tests/src/test/java/org/apache/axis2/transport/jms/JMSTransportTest.java
 (original)
+++ 
webservices/commons/trunk/scratch/senaka/sci-flex/transport/modules/tests/src/test/java/org/apache/axis2/transport/jms/JMSTransportTest.java
 Wed Oct 22 06:38:56 2008
@@ -19,6 +19,8 @@
 
 package org.apache.axis2.transport.jms;
 
+import java.util.Map;
+
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
@@ -72,6 +74,7 @@
         builder.addAxisAsyncTestClient(new AxisAsyncTestClient(), new 
JMSAxisTestClientConfigurator(JMSConstants.JMS_TEXT_MESSAGE));
         builder.addByteArrayAsyncTestClient(new 
JMSAsyncClient<byte[]>(JMSBytesMessageFactory.INSTANCE));
         builder.addStringAsyncTestClient(new 
JMSAsyncClient<String>(JMSTextMessageFactory.INSTANCE));
+/*        builder.addMapAsyncTestClient(new 
JMSAsyncClient<Map>(JMSMapMessageFactory.INSTANCE));*/
         
         builder.addAxisAsyncEndpoint(new AxisAsyncEndpoint());
         


Reply via email to