You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by pa...@apache.org on 2011/09/23 07:27:53 UTC

svn commit: r1174523 [2/2] - in /incubator/airavata/trunk/modules: commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/impl/subscription/ ws-messenger/client/ ws-messenger/client/src/main/java/org/apache/airavata/wsmg/client/ ...

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java?rev=1174523&r1=1174522&r2=1174523&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java (original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java Fri Sep 23 05:27:52 2011
@@ -21,24 +21,14 @@
 
 package org.apache.airavata.wsmg.util;
 
-import java.io.File;
-import java.io.FilenameFilter;
-
 import javax.xml.namespace.QName;
 
 import org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.context.ServiceGroupContext;
-import org.apache.axis2.deployment.DeploymentEngine;
-import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.InOutAxisOperation;
-import org.apache.axis2.description.TransportInDescription;
-import org.apache.axis2.engine.ListenerManager;
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.engine.ServiceLifeCycle;
 import org.apache.axis2.transport.http.SimpleHTTPServer;
@@ -64,42 +54,7 @@ public class TestUtilServer {
         if (receiver.getConfigurationContext().getAxisConfiguration() != null) {
             receiver.getConfigurationContext().getAxisConfiguration().removeService("AnonymousService");
         }
-    }
-
-    public static synchronized void start() throws Exception {
-        start(prefixBaseDirectory(Constants.TESTING_REPOSITORY));
-    }
-
-    public static synchronized void start(String repository) throws Exception {
-        if (count == 0) {
-            ConfigurationContext er = getNewConfigurationContext(repository);
-
-            receiver = new SimpleHTTPServer(er, TESTING_PORT);
-
-            try {
-                receiver.start();
-                ListenerManager listenerManager = er.getListenerManager();
-                TransportInDescription trsIn = new TransportInDescription(Constants.TRANSPORT_HTTP);
-                trsIn.setReceiver(receiver);
-                if (listenerManager == null) {
-                    listenerManager = new ListenerManager();
-                    listenerManager.init(er);
-                }
-                listenerManager.addListener(trsIn, true);
-                System.out.print("Server started on port " + TESTING_PORT + ".....");
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-
-        try {
-            Thread.sleep(2000);
-        } catch (InterruptedException e1) {
-            throw new AxisFault("Thread interuptted", e1);
-        }
-
-        count++;
-    }
+    }    
 
     public static synchronized void start(String repository, String axis2xml) throws Exception {
         if (count == 0) {
@@ -225,22 +180,8 @@ public class TestUtilServer {
             axisService.mapActionToOperation(inputAction, operation1);
         }
     }
-
-    public static ConfigurationContext getNewConfigurationContext(String repository) throws Exception {
-        File file = new File(repository);
-        if (!file.exists()) {
-            throw new Exception("repository directory " + file.getAbsolutePath() + " does not exists");
-        }
-        return ConfigurationContextFactory.createConfigurationContextFromFileSystem(file.getAbsolutePath(),
-                file.getAbsolutePath() + "/conf/axis2.xml");
-    }
-
+    
     public static ConfigurationContext getNewConfigurationContext(String repository, String axis2xml) throws Exception {
-        // File file = new File(prefixBaseDirectory(repository));
-        // if (!file.exists()) {
-        // throw new Exception("repository directory "
-        // + file.getAbsolutePath() + " does not exists");
-        // }
         return ConfigurationContextFactory.createConfigurationContextFromFileSystem(repository, axis2xml);
     }
 
@@ -266,81 +207,4 @@ public class TestUtilServer {
     public static ConfigurationContext getConfigurationContext() {
         return receiver.getConfigurationContext();
     }
-
-    public static ServiceContext createAdressedEnabledClientSide(AxisService service) throws AxisFault {
-        File file = getAddressingMARFile();
-        assert (file.exists());
-        ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(
-                prefixBaseDirectory("target/test-resources/integrationRepo"), null);
-        AxisModule axisModule = DeploymentEngine.buildModule(file, configContext.getAxisConfiguration());
-        configContext.getAxisConfiguration().addModule(axisModule);
-
-        configContext.getAxisConfiguration().addService(service);
-
-        ServiceGroupContext serviceGroupContext = configContext
-                .createServiceGroupContext(service.getAxisServiceGroup());
-        return serviceGroupContext.getServiceContext(service);
-    }
-
-    static class AddressingFilter implements FilenameFilter {
-        public boolean accept(File dir, String name) {
-            return name.startsWith("addressing") && name.endsWith(".mar");
-        }
-    }
-
-    private static File getAddressingMARFile() {
-        File dir = new File(prefixBaseDirectory(Constants.TESTING_REPOSITORY + "/modules"));
-        File[] files = dir.listFiles(new AddressingFilter());
-        assert ((files.length == 1));
-        File file = files[0];
-        assert (file.exists());
-        return file;
-    }
-
-    public static ConfigurationContext createClientConfigurationContext() throws AxisFault {
-        File file = getAddressingMARFile();
-        assert (file.exists());
-
-        ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(
-                prefixBaseDirectory(Constants.TESTING_PATH + "/integrationRepo"),
-                prefixBaseDirectory(Constants.TESTING_PATH + "/integrationRepo/conf/axis2.xml"));
-        AxisModule axisModule = DeploymentEngine.buildModule(file, configContext.getAxisConfiguration());
-        configContext.getAxisConfiguration().addModule(axisModule);
-        return configContext;
-    }
-
-    public static ConfigurationContext createClientConfigurationContext(String repo) throws AxisFault {
-        return ConfigurationContextFactory.createConfigurationContextFromFileSystem(repo, repo + "/conf/axis2.xml");
-    }
-
-    public static ServiceContext createAdressedEnabledClientSide(AxisService service, String clientHome)
-            throws AxisFault {
-        File file = getAddressingMARFile();
-        assert (file.exists());
-
-        ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(
-                clientHome, null);
-        AxisModule axisModule = DeploymentEngine.buildModule(file, configContext.getAxisConfiguration());
-
-        configContext.getAxisConfiguration().addModule(axisModule);
-        // sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());
-
-        configContext.getAxisConfiguration().addService(service);
-        ServiceGroupContext serviceGroupContext = configContext
-                .createServiceGroupContext(service.getAxisServiceGroup());
-        return serviceGroupContext.getServiceContext(service);
-    }
-
-    public static String prefixBaseDirectory(String path) {
-        // String baseDir;
-        // try {
-        // baseDir = new File(System.getProperty("basedir",
-        // ".")).getCanonicalPath();
-        // } catch (IOException e) {
-        // throw new RuntimeException(e);
-        // }
-        // return baseDir + "/" + path;
-        return path;
-    }
-
 }

Added: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/resources/conf/msgBroker.properties
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/resources/conf/msgBroker.properties?rev=1174523&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/resources/conf/msgBroker.properties (added)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/resources/conf/msgBroker.properties Fri Sep 23 05:27:52 2011
@@ -0,0 +1,45 @@
+#Sample configuration file for broker
+
+
+#database realted settings (only applicable if 'broker.storage.type=persistent')
+#For mysql database configuration
+#broker.jdbc.driver=com.mysql.jdbc.Driver
+#broker.jdbc.url=jdbc:mysql://localhost:3306/wsmg?user=airavata&password=airavata
+
+#Default derby database configuration
+broker.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
+broker.jdbc.url=jdbc:derby:wsmg;create=true;user=airavata;password=airavata
+
+#socket time out in milliseconds for sending messages. (defaults is 20000)
+broker.socket.timeout=60000
+
+
+#broker.storage.type=persistent
+broker.storage.type=memory
+
+#specifies wether delivery component should be started or not.
+broker.start.delivery.thread=true
+
+
+#fixed thread pool based delivery
+#broker.delivery.method=pcrew
+
+#dynamic thread pool based delivery
+#broker.delivery.method=parallel
+
+#single thread delivery
+broker.delivery.method=serial
+
+#number of message delivery failures before a url become black listed (default is 2)
+#broker.msg.delivery.retries=2
+
+#time period (in seconds) a url will be kept blacklisted (default is 5 seconds) 
+#consumer.expiration.time.gap=5 
+
+#maximum number of messages to be send to a one consumer/url at time. 
+#applicable if 'broker.delivery.method' is 'pcrew' . (default is 10)
+
+#sending.batch.size=10
+
+#size of the thread pool. only applicable if 'broker.delivery.method' is 'pcrew'. (default is 4)
+#sending.thread.pool.size=4

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties?rev=1174523&r1=1174522&r2=1174523&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties (original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties Fri Sep 23 05:27:52 2011
@@ -18,10 +18,6 @@
 # under the License.
 #
 #
-
-
-broker.eventing.service.epr=http://localhost:8080/axis2/services/EventingService
-broker.notification.service.epr=http://localhost:8080/axis2/services/NotificationService
 consumer.port=2222
 consumer.location=http://localhost:2222
 topic.simple=MySimpleTestTopic