Revision: fae04d56c38a
Author:   [email protected] <[email protected]>
Date:     Mon Jul  9 12:04:25 2012
Log:      Issue 102:    Make the parameters of map/load test variable
http://code.google.com/p/jss7/source/detail?r=fae04d56c38a

Modified:
 /map/load/build.xml
 /map/load/src/main/java/org/mobicents/protocols/ss7/map/load/Client.java
 /map/load/src/main/java/org/mobicents/protocols/ss7/map/load/Server.java
/map/load/src/main/java/org/mobicents/protocols/ss7/map/load/TestHarness.java

=======================================
--- /map/load/build.xml Thu Mar  1 06:32:25 2012
+++ /map/load/build.xml Mon Jul  9 12:04:25 2012
@@ -80,6 +80,17 @@
                        <jvmarg value="-XX:+PrintGCDetails" />
                        <jvmarg value="-XX:+PrintGCTimeStamps" />
                        -->
+                       <arg value="sctp" /> <!-- socket type -->
+                       <arg value="127.0.0.1" /> <!-- Client IP -->
+                       <arg value="2345" /> <!-- Client Port -->
+                       <arg value="127.0.0.1" /> <!-- Server Ip -->
+                       <arg value="3434" /> <!-- Server Port -->
+                       <arg value="1" /> <!-- Client PC -->
+                       <arg value="2" /> <!-- Server PC -->
+                       <arg value="2" /> <!-- NI -->
+                       <arg value="3" /> <!-- SI -->
+                       <arg value="8" /> <!-- SSN -->
+                       <arg value="100" /> <!-- RC -->
                </java>
        </target>
        <target name="client" description="run the Load Test Client">
@@ -90,6 +101,17 @@
                        <jvmarg value="-Dlog.file.name=log4j-client.log" />
                        <arg value="10000000" />
                        <arg value="10" />
+                       <arg value="sctp" /> <!-- socket type -->
+                       <arg value="127.0.0.1" /> <!-- Client IP -->
+                       <arg value="2345" /> <!-- Client Port -->
+                       <arg value="127.0.0.1" /> <!-- Server Ip -->
+                       <arg value="3434" /> <!-- Server Port -->
+                       <arg value="1" /> <!-- Client PC -->
+                       <arg value="2" /> <!-- Server PC -->
+                       <arg value="2" /> <!-- NI -->
+                       <arg value="3" /> <!-- SI -->
+                       <arg value="8" /> <!-- SSN -->
+                       <arg value="100" /> <!-- RC -->
                </java>
        </target>
        <!-- -->
=======================================
--- /map/load/src/main/java/org/mobicents/protocols/ss7/map/load/Client.java Mon Jul 9 10:07:20 2012 +++ /map/load/src/main/java/org/mobicents/protocols/ss7/map/load/Client.java Mon Jul 9 12:04:25 2012
@@ -237,9 +237,54 @@
                int noOfCalls = Integer.parseInt(args[0]);
                int noOfConcurrentCalls = Integer.parseInt(args[1]);
                IpChannelType ipChannelType = IpChannelType.SCTP;
-               if (args.length >= 3 && args[2].toLowerCase().equals("tcp"))
+               if (args.length >= 3 && args[2].toLowerCase().equals("tcp")){
                        ipChannelType = IpChannelType.TCP;
-
+               } else {
+                       ipChannelType = IpChannelType.SCTP;
+               }
+
+               if (args.length >= 4  ){
+                       TestHarness.CLIENT_IP = args[3];
+               }
+
+               if (args.length >=  5 ){
+                       TestHarness.CLIENT_PORT = Integer.parseInt(args[4]);
+               }
+
+               if (args.length >= 6  ){
+                       TestHarness.SERVER_IP = args[5];
+               }
+
+               if (args.length >=  7 ){
+                       TestHarness.SERVER_PORT = Integer.parseInt(args[6]);
+               }
+
+               if (args.length >=  8 ){
+                       TestHarness.CLIENT_SPC = Integer.parseInt(args[7]);
+               }
+
+               if (args.length >=  9 ){
+                       TestHarness.SERVET_SPC = Integer.parseInt(args[8]);
+               }
+
+               if (args.length >=  10 ){
+                       TestHarness.NETWORK_INDICATOR = 
Integer.parseInt(args[9]);
+               }
+
+               if (args.length >=  11 ){
+                       TestHarness.SERVICE_INIDCATOR = 
Integer.parseInt(args[10]);
+               }
+
+               if (args.length >=  12 ){
+                       TestHarness.SSN = Integer.parseInt(args[11]);
+               }
+
+               if (args.length >=  13 ){
+                       TestHarness.ROUTING_CONTEXT = 
Integer.parseInt(args[12]);
+               }
+
+
+
                // logger.info("Number of calls to be completed = " + noOfCalls 
+
                // " Number of concurrent calls to be maintained = " +
                // noOfConcurrentCalls);
=======================================
--- /map/load/src/main/java/org/mobicents/protocols/ss7/map/load/Server.java Wed May 9 07:10:08 2012 +++ /map/load/src/main/java/org/mobicents/protocols/ss7/map/load/Server.java Mon Jul 9 12:04:25 2012
@@ -507,8 +507,51 @@

        public static void main(String args[]) {
                IpChannelType ipChannelType = IpChannelType.SCTP;
-               if (args.length >= 1 && args[0].toLowerCase().equals("tcp"))
+               if (args.length >= 1 && args[0].toLowerCase().equals("tcp")){
                        ipChannelType = IpChannelType.TCP;
+               } else {
+                       ipChannelType = IpChannelType.SCTP;
+               }
+
+               if (args.length >= 2  ){
+                       TestHarness.CLIENT_IP = args[1];
+               }
+
+               if (args.length >=  3 ){
+                       TestHarness.CLIENT_PORT = Integer.parseInt(args[2]);
+               }
+
+               if (args.length >= 4  ){
+                       TestHarness.SERVER_IP = args[3];
+               }
+
+               if (args.length >=  5 ){
+                       TestHarness.SERVER_PORT = Integer.parseInt(args[4]);
+               }
+
+               if (args.length >=  6 ){
+                       TestHarness.CLIENT_SPC = Integer.parseInt(args[5]);
+               }
+
+               if (args.length >=  7 ){
+                       TestHarness.SERVET_SPC = Integer.parseInt(args[6]);
+               }
+
+               if (args.length >=  8 ){
+                       TestHarness.NETWORK_INDICATOR = 
Integer.parseInt(args[7]);
+               }
+
+               if (args.length >=  9 ){
+                       TestHarness.SERVICE_INIDCATOR = 
Integer.parseInt(args[8]);
+               }
+
+               if (args.length >=  10 ){
+                       TestHarness.SSN = Integer.parseInt(args[9]);
+               }
+
+               if (args.length >=  11 ){
+                       TestHarness.ROUTING_CONTEXT = 
Integer.parseInt(args[10]);
+               }

                final Server server = new Server();
                try {
=======================================
--- /map/load/src/main/java/org/mobicents/protocols/ss7/map/load/TestHarness.java Thu Mar 1 06:32:25 2012 +++ /map/load/src/main/java/org/mobicents/protocols/ss7/map/load/TestHarness.java Mon Jul 9 12:04:25 2012
@@ -53,22 +53,22 @@
        protected static int MAXCONCURRENTDIALOGS = 15;

        // MTP Details
-       protected final int CLIENT_SPC = 1;
-       protected final int SERVET_SPC = 2;
-       protected final int NETWORK_INDICATOR = 2;
-       protected final int SERVICE_INIDCATOR = 3; //SCCP
-       protected final int SSN = 8;
+       protected static int CLIENT_SPC = 1;
+       protected static int SERVET_SPC = 2;
+       protected static int NETWORK_INDICATOR = 2;
+       protected static int SERVICE_INIDCATOR = 3; //SCCP
+       protected static int SSN = 8;

        // M3UA details
        //protected final String CLIENT_IP = "172.31.96.40";
-       protected final String CLIENT_IP = "127.0.0.1";
-       protected final int CLIENT_PORT = 2345;
+       protected static String CLIENT_IP = "127.0.0.1";
+       protected static int CLIENT_PORT = 2345;

        //protected final String SERVER_IP = "172.31.96.41";
-       protected final String SERVER_IP = "127.0.0.1";
-       protected final int SERVER_PORT = 3434;
-
-       protected final int ROUTING_CONTEXT = 100;
+       protected static String SERVER_IP = "127.0.0.1";
+       protected static int SERVER_PORT = 3434;
+
+       protected static int ROUTING_CONTEXT = 100;

        protected final String SERVER_ASSOCIATION_NAME = "serverAsscoiation";
        protected final String CLIENT_ASSOCIATION_NAME = "clientAsscoiation";

Reply via email to