axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chamik...@apache.org
Subject svn commit: r419173 [2/2] - in /webservices/axis2/trunk/java/modules/savan: ./ conf/ src/org/apache/savan/ src/org/apache/savan/configuration/ src/org/apache/savan/eventing/ src/org/apache/savan/eventing/client/ src/org/apache/savan/filters/ src/org/ap...
Date Wed, 05 Jul 2006 06:07:37 GMT
Added: webservices/axis2/trunk/java/modules/savan/test-resources/savan-config-test.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/test-resources/savan-config-test.xml?rev=419173&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/test-resources/savan-config-test.xml (added)
+++ webservices/axis2/trunk/java/modules/savan/test-resources/savan-config-test.xml Tue Jul
 4 23:07:35 2006
@@ -0,0 +1,24 @@
+<savan-config>
+
+    <protocols>
+        <protocol>
+        	<name>eventing</name>
+        	<utilFactory>org.apache.savan.eventing.EventingUtilFactory</utilFactory>
+        	<mapping-rules>
+                <action>http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe</action>
+                <action>http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew</action>
+                <action>http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus</action>
+                <action>http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe</action>
+                <!-- <SOAPAction></SOAPAction> -->
+        	</mapping-rules>
+        </protocol>
+    </protocols>
+    
+    <subscriberStores>
+    	<subscriberStore>
+    		<key>default</key>
+    		<class>org.apache.savan.subscribers.DefaultSubscriberStore</class>
+    	</subscriberStore>
+    </subscriberStores>
+    
+</savan-config>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/savan/test/org/apache/axis2/savan/ConfigurationManagerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/test/org/apache/axis2/savan/ConfigurationManagerTest.java?rev=419173&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/test/org/apache/axis2/savan/ConfigurationManagerTest.java
(added)
+++ webservices/axis2/trunk/java/modules/savan/test/org/apache/axis2/savan/ConfigurationManagerTest.java
Tue Jul  4 23:07:35 2006
@@ -0,0 +1,26 @@
+package org.apache.axis2.savan;
+
+import java.io.File;
+
+import org.apache.savan.SavanException;
+import org.apache.savan.configuration.ConfigurationManager;
+
+import junit.framework.TestCase;
+
+public class ConfigurationManagerTest extends TestCase {
+
+	public void testFromXMLFile () throws SavanException {
+        File baseDir = new File("");
+        String testRource = baseDir.getAbsolutePath() + File.separator + "test-resources";
+        String testConfigurationFile = testRource + File.separator + "savan-config-test.xml";
+        
+		File f = new File (testConfigurationFile);  //test-resources configuration file.
+		if (!f.isFile())
+			throw new SavanException ("Cant find the test configuration file");
+		
+		ConfigurationManager cm = new ConfigurationManager ();
+		cm.configure(f);
+		
+		
+	}
+}

Modified: webservices/axis2/trunk/java/modules/savan/test/org/apache/axis2/savan/EventingSubscripitonProcessorTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/test/org/apache/axis2/savan/EventingSubscripitonProcessorTest.java?rev=419173&r1=419172&r2=419173&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/test/org/apache/axis2/savan/EventingSubscripitonProcessorTest.java
(original)
+++ webservices/axis2/trunk/java/modules/savan/test/org/apache/axis2/savan/EventingSubscripitonProcessorTest.java
Tue Jul  4 23:07:35 2006
@@ -3,17 +3,25 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.Date;
+
 import javax.xml.namespace.QName;
+
 import junit.framework.TestCase;
+
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.databinding.utils.ConverterUtil;
+import org.apache.axis2.description.AxisService;
 import org.apache.savan.SavanMessageContext;
+import org.apache.savan.configuration.Protocol;
 import org.apache.savan.eventing.EventingConstants;
 import org.apache.savan.eventing.EventingSubscriber;
 import org.apache.savan.eventing.EventingSubscriptionProcessor;
+import org.apache.savan.eventing.EventingUtilFactory;
+import org.apache.savan.storage.DefaultSubscriberStore;
+import org.apache.savan.storage.SubscriberStore;
 import org.apache.savan.subscription.ExpirationBean;
 import org.apache.savan.util.CommonUtil;
 
@@ -21,6 +29,16 @@
 
 	public void testSubscriberExtraction () throws Exception {
 		SavanMessageContext smc = getSubscriptionMessage();
+		
+		Protocol protocol = new Protocol ();
+		protocol.setName("eventing");
+		protocol.setUtilFactory(new EventingUtilFactory ());
+		
+		SubscriberStore store = new DefaultSubscriberStore ();
+		
+		smc.setProtocol(protocol);
+		smc.setSubscriberStore(store);
+		
 		EventingSubscriptionProcessor esp = new EventingSubscriptionProcessor ();
 		EventingSubscriber eventingSubscriber = (EventingSubscriber) esp.getSubscriberFromMessage(smc);
 		assertNotNull(eventingSubscriber);
@@ -68,6 +86,9 @@
 		EndpointReference replyToEPR = new EndpointReference ("http://DummyReplyToAddress/");
 		replyToEPR.addReferenceParameter(new QName ("RefParam1"),"RefParamVal1");
 		options.setTo(replyToEPR);
+		
+		//adding a dummy AxisService to avoid NullPointer Exceptions.
+		mc.setAxisService(new AxisService ("DummyService"));
 		
 		options.setAction("urn:uuid:DummyAction");
 		



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


Mime
View raw message