axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r179767 - in /webservices/axis/trunk/java: ./ modules/core/src/org/apache/axis/ modules/core/src/org/apache/axis/clientapi/ modules/core/src/org/apache/axis/engine/ modules/core/test/org/apache/axis/engine/ modules/samples/
Date Fri, 03 Jun 2005 10:35:05 GMT
Author: hemapani
Date: Fri Jun  3 03:35:01 2005
New Revision: 179767

URL: http://svn.apache.org/viewcvs?rev=179767&view=rev
Log:
adding the samples to the binary distribution

Added:
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/MessageContextInjectionTest.java
Modified:
    webservices/axis/trunk/java/maven.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfigurationImpl.java
    webservices/axis/trunk/java/modules/samples/maven.xml

Modified: webservices/axis/trunk/java/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/maven.xml?rev=179767&r1=179766&r2=179767&view=diff
==============================================================================
--- webservices/axis/trunk/java/maven.xml (original)
+++ webservices/axis/trunk/java/maven.xml Fri Jun  3 03:35:01 2005
@@ -170,9 +170,7 @@
 			</ant:fileset> 
 		</ant:copy>
 		<ant:copy todir="target/dist-bin/samples">
-			<ant:fileset dir="modules/samples/src">
-				<ant:include name="userguide/**"/>
-			</ant:fileset> 
+			<ant:fileset dir="modules/samples/target/samples"/>
 		</ant:copy> 
 		<ant:copy todir="target/dist-bin/">
 			<ant:fileset dir=".">

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java?rev=179767&r1=179766&r2=179767&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java Fri Jun  3
03:35:01 2005
@@ -178,7 +178,7 @@
     public static final String CONTAINER_MANAGED = "ContainerManaged";
     
     public static final String TESTING_REPOSITORY = "target/test-resources/samples";
-     //public static final String TESTING_REPOSITORY = "modules/samples/target/test-resources/samples";
+    //public static final String TESTING_REPOSITORY = "modules/samples/target/test-resources/samples";
 
 
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java?rev=179767&r1=179766&r2=179767&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
Fri Jun  3 03:35:01 2005
@@ -321,9 +321,9 @@
         this.listenerTransport = serviceContext.getEngineContext().getAxisConfiguration().getTransportIn(new
QName(listenerTransport));
 
         if (useSeparateListener == true) {
-//            listener = this.listenerTransport.getReciever();
-//            listener.init(serviceContext.getEngineContext(),this.listenerTransport);
-//            listener.start();
+            if(!serviceContext.getEngineContext().getAxisConfiguration().isEngaged(new QName(Constants.MODULE_ADDRESSING))){
+                throw new AxisFault("to do two Transport Channels the Addressing Modules
must be engeged");
+            }
             ListenerManager.makeSureStarted(listenerTransport, serviceContext.getEngineContext());
         }
     }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java?rev=179767&r1=179766&r2=179767&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java
Fri Jun  3 03:35:01 2005
@@ -87,6 +87,8 @@
      * @throws AxisFault
      */
     public void addMdoule(ModuleDescription module) throws AxisFault;
+    
+    public boolean isEngaged(QName moduleName);
 
      /**
       * To engae a module at the run time it can be used this method

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfigurationImpl.java?rev=179767&r1=179766&r2=179767&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfigurationImpl.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfigurationImpl.java
Fri Jun  3 03:35:01 2005
@@ -330,5 +330,9 @@
         }
         engagedModules.add(moduleref);
     }
+    
+    public boolean isEngaged(QName moduleName){
+        return engagedModules.contains(moduleName);
+    }
 
 }

Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/MessageContextInjectionTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/MessageContextInjectionTest.java?rev=179767&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/MessageContextInjectionTest.java
(added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/MessageContextInjectionTest.java
Fri Jun  3 03:35:01 2005
@@ -0,0 +1,116 @@
+/*
+ * 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.axis.engine;
+
+//todo
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.axis.Constants;
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.clientapi.MessageSender;
+import org.apache.axis.context.ConfigurationContext;
+import org.apache.axis.context.ConfigurationContextFactory;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.OperationDescription;
+import org.apache.axis.description.ParameterImpl;
+import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.receivers.AbstractMessageReceiver;
+import org.apache.axis.receivers.RawXMLINOnlyMessageRecevier;
+import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.soap.SOAPFactory;
+import org.apache.axis.transport.local.LocalTransportReceiver;
+import org.apache.axis.util.Utils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class MessageContextInjectionTest extends TestCase {
+    private EndpointReference targetEPR =
+        new EndpointReference(
+            AddressingConstants.WSA_TO,"/axis/services/EchoXMLService/echoOMElement");
+    private Log log = LogFactory.getLog(getClass());
+    private QName serviceName = new QName("EchoXMLService");
+    private QName operationName = new QName("echoOMElement");
+
+
+    private AxisConfiguration engineRegistry;
+    private MessageContext mc;
+
+    private SOAPEnvelope envelope;
+
+    private boolean finish = false;
+
+    public MessageContextInjectionTest() {
+        super(MessageContextInjectionTest.class.getName());
+    }
+
+    public MessageContextInjectionTest(String testName) {
+        super(testName);
+    }
+
+    protected void setUp() throws Exception {
+        ConfigurationContextFactory builder = new ConfigurationContextFactory();
+        ConfigurationContext configContext =
+            builder.buildEngineContext(org.apache.axis.Constants.TESTING_REPOSITORY);
+        LocalTransportReceiver.CONFIG_CONTEXT = configContext;
+
+        ServiceDescription service = new ServiceDescription(serviceName);
+        service.addParameter(new ParameterImpl(AbstractMessageReceiver.SERVICE_CLASS, MessageContextEnabledEcho.class.getName()));
+        OperationDescription operation = new OperationDescription(operationName);
+        operation.setMessageReciever(new RawXMLINOnlyMessageRecevier());
+        service.addOperation(operation);
+        service.setClassLoader(Thread.currentThread().getContextClassLoader());
+        LocalTransportReceiver.CONFIG_CONTEXT.getAxisConfiguration().addService(service);
+        Utils.resolvePhases(LocalTransportReceiver.CONFIG_CONTEXT.getAxisConfiguration(),
service);
+    }
+
+    protected void tearDown() throws Exception {
+    }
+
+    private OMElement createEnvelope() {
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+        OMElement method = fac.createOMElement("echoOMElement", omNs);
+        OMElement value = fac.createOMElement("myValue", omNs);
+        value.addChild(fac.createText(value, "Isaac Assimov, the foundation Sega"));
+        method.addChild(value);
+
+        return method;
+    }
+
+    public void testEchoXMLSync() throws Exception {
+        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
+
+        OMElement payload = createEnvelope();
+
+        MessageSender sender = new MessageSender();
+
+        sender.setTo(targetEPR);
+        sender.setSenderTransport(Constants.TRANSPORT_LOCAL);
+
+        sender.send(operationName.getLocalPart(), payload);
+        
+    }
+
+}

Modified: webservices/axis/trunk/java/modules/samples/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/maven.xml?rev=179767&r1=179766&r2=179767&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/maven.xml (original)
+++ webservices/axis/trunk/java/modules/samples/maven.xml Fri Jun  3 03:35:01 2005
@@ -6,8 +6,9 @@
     xmlns:j="jelly:core"
     xmlns:maven="jelly:maven"
     xmlns:deploy="deploy"
-    xmlns:ant="jelly:ant">
-    <postGoal name="test:compile">
+    xmlns:ant="jelly:ant">
+    <j:set var="samples.dir" value="target/samples"/>
+    <postGoal name="test:compile">
         <mkdir dir="target/test-resources/samples/modules"/>
         <mkdir dir="target/test-resources/repository-client/modules"/>
         <copy file="../addressing/target/addressing.mar" 
@@ -17,5 +18,108 @@
         <mkdir dir="target/echo"/>
         <copy file="../core/target/echo/echo.aar"
 		tofile="target/echo/echo.aar"/>
-    </postGoal>
+    </postGoal>
+
+    <postGoal name="test:test">
+        <attainGoal name="create-samples"/>
+    </postGoal>
+
+    <goal name="create-samples">
+	<mkdir dir="target/samples"/>
+        <mkdir dir="${samples.dir}/userguide"/>
+        <attainGoal name="userguide"/>
+        <attainGoal name="amazonQS"/>
+        <attainGoal name="googleSearch"/>
+        <attainGoal name="googleSpellcheck"/>
+    </goal>
+    <goal name="userguide">
+	<mkdir dir="target/samples"/>
+        <mkdir dir="${samples.dir}/userguide"/>
+        <mkdir dir="${samples.dir}/userguide/src"/>
+        <ant:copy todir="${samples.dir}/userguide/src">
+        	<ant:fileset dir="src">
+        		<ant:include name="userguide/**"/>
+        	</ant:fileset> 
+	</ant:copy> 
+        <jar destfile="${samples.dir}/userguide/sample.jar">
+            <fileset dir="target/classes">
+                <include name="userguide/**"/>
+            </fileset>           
+        </jar>
+        <jar destfile="${samples.dir}/userguide/MyService.jar">
+            <fileset dir="src/userguide/example1/">
+                <include name="META-INF/**"/>
+            </fileset>           
+            <fileset dir="target/classes">
+                <include name="userguide/example1/**/*.class"/>
+            </fileset>           
+        </jar>
+        <jar destfile="${samples.dir}/userguide/MyServiceWithHandler.jar">
+            <fileset dir="src/userguide/example1/">
+                <include name="META-INF/**"/>
+            </fileset>           
+            <fileset dir="target/classes">
+                <include name="userguide/example2/**/*.class"/>
+            </fileset>           
+        </jar>
+
+    </goal>
+        
+    <goal name="amazonQS">
+        <mkdir dir="${samples.dir}/amazonQS"/>
+        <mkdir dir="${samples.dir}/amazonQS/src"/>
+        <ant:copy todir="${samples.dir}/amazonQS/src">
+        	<ant:fileset dir="src">
+        		<ant:include name="sample/amazon/amazonSimpleQueueService/**"/>
+        	</ant:fileset> 
+	</ant:copy> 
+        <mkdir dir="${samples.dir}/amazonQS/docs"/>
+        <ant:copy todir="${samples.dir}/amazonQS/docs">
+        	<ant:fileset dir="xdocs/amazonQS"/>
+	</ant:copy> 
+        <jar destfile="${samples.dir}/amazonQS/amazonQS.jar">
+            <fileset dir="target/classes">
+                <include name="sample/amazon/amazonSimpleQueueService/**"/>
+            </fileset>           
+        </jar>
+    </goal>
+
+    <goal name="googleSearch">
+        <mkdir dir="${samples.dir}/googleSearch"/>
+        <mkdir dir="${samples.dir}/googleSearch/src"/>
+        <ant:copy todir="${samples.dir}/googleSearch/src">
+        	<ant:fileset dir="src">
+        		<ant:include name="sample/google/search/**"/>
+        	</ant:fileset> 
+	</ant:copy> 
+        <mkdir dir="${samples.dir}/googleSearch/docs"/>
+        <ant:copy todir="${samples.dir}/googleSearch/docs">
+        	<ant:fileset dir="xdocs/googleSearch"/>
+	</ant:copy> 
+        <jar destfile="${samples.dir}/googleSearch/googleSearch.jar">
+            <fileset dir="target/classes">
+                <include name="sample/google/search/**"/>
+            </fileset>           
+        </jar>
+    </goal>
+    <goal name="googleSpellcheck">
+        <mkdir dir="${samples.dir}/googleSpellcheck"/>
+        <mkdir dir="${samples.dir}/googleSpellcheck/src"/>
+        <ant:copy todir="${samples.dir}/googleSpellcheck/src">
+        	<ant:fileset dir="src">
+        		<ant:include name="sample/google/spellcheck/**"/>
+        	</ant:fileset> 
+	</ant:copy> 
+        <mkdir dir="${samples.dir}/googleSpellcheck/docs"/>
+        <ant:copy todir="${samples.dir}/googleSpellcheck/docs">
+        	<ant:fileset dir="xdocs/googleSpellcheck"/>
+	</ant:copy> 
+        <jar destfile="${samples.dir}/googleSpellcheck/googleSpellcheck.jar">
+            <fileset dir="target/classes">
+                <include name="sample/google/spellcheck/**"/>
+            </fileset>           
+        </jar>
+    </goal>
+
+
  </project>



Mime
View raw message