qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject svn commit: r881896 - in /qpid/trunk/qpid/java/testkit: bin/qpid-python-testkit bin/setenv.sh brokertest.py src/main/java/org/apache/qpid/testkit/TestLauncher.java testkit.py
Date Wed, 18 Nov 2009 19:36:39 GMT
Author: rajith
Date: Wed Nov 18 19:36:38 2009
New Revision: 881896

URL: http://svn.apache.org/viewvc?rev=881896&view=rev
Log:
Added log4j config to the test launcher
Added shell script to run testkit.py
Removed brokertest.py, instead using the version checked in under python/qpid folder by Alan.
The shell scripts and the setup is work in progress, checking in now to help Alan reproduce
an issue.

Added:
    qpid/trunk/qpid/java/testkit/bin/qpid-python-testkit   (with props)
    qpid/trunk/qpid/java/testkit/bin/setenv.sh
Removed:
    qpid/trunk/qpid/java/testkit/brokertest.py
Modified:
    qpid/trunk/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/TestLauncher.java
    qpid/trunk/qpid/java/testkit/testkit.py

Added: qpid/trunk/qpid/java/testkit/bin/qpid-python-testkit
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/testkit/bin/qpid-python-testkit?rev=881896&view=auto
==============================================================================
--- qpid/trunk/qpid/java/testkit/bin/qpid-python-testkit (added)
+++ qpid/trunk/qpid/java/testkit/bin/qpid-python-testkit Wed Nov 18 19:36:38 2009
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# 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.
+#
+
+# This is wrapper script to run the tests defined in testkit.py 
+# via the python test runner. The defaults are set for a running
+# from an svn checkout
+
+. ./setenv.sh
+
+export PYTHONPATH=../:$PYTHONPATH
+
+echo $PYTHONPATH
+
+$PYTHON_DIR/qpid-python-test -m testkit
+

Propchange: qpid/trunk/qpid/java/testkit/bin/qpid-python-testkit
------------------------------------------------------------------------------
    svn:executable = *

Added: qpid/trunk/qpid/java/testkit/bin/setenv.sh
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/testkit/bin/setenv.sh?rev=881896&view=auto
==============================================================================
--- qpid/trunk/qpid/java/testkit/bin/setenv.sh (added)
+++ qpid/trunk/qpid/java/testkit/bin/setenv.sh Wed Nov 18 19:36:38 2009
@@ -0,0 +1,44 @@
+#
+# 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.
+#
+
+# Environment for python tests
+test -d ../../../python || { echo "WARNING: skipping test, no python directory."; exit 0;
}
+PYTHON_DIR=../../../python
+PYTHONPATH=$PYTHON_DIR:$PYTHON_DIR/qpid
+
+if [ "$QPIDD_EXEC" = "" ] ; then
+   test -x ../../../cpp/src/qpidd || { echo "WARNING: skipping test, QPIDD_EXEC not set and
qpidd not found."; exit 0; }
+   QPIDD_EXEC=../../../cpp/src/qpidd
+fi
+
+if [ "$CLUSTER_LIB" = "" ] ; then
+   test -x ../../../cpp/src/.libs/cluster.so || { echo "WARNING: skipping test, CLUSTER_LIB
not set and cluster.so not found."; exit 0; }
+   CLUSTER_LIB=../../../cpp/src/.libs/cluster.so
+fi
+
+if [ "$QP_CP" = "" ] ; then
+   QP_CP=`find ../../build/lib/ -name '*.jar' | tr '\n' ':'`
+fi
+
+if [ "$QUTDIR" = "" ] ; then
+   OUTDIR=../
+fi
+
+
+export PYTHONPATH PYTHON_DIR QPIDD_EXEC CLUSTER_LIB QP_CP OUTDIR

Modified: qpid/trunk/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/TestLauncher.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/TestLauncher.java?rev=881896&r1=881895&r2=881896&view=diff
==============================================================================
--- qpid/trunk/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/TestLauncher.java (original)
+++ qpid/trunk/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/TestLauncher.java Wed
Nov 18 19:36:38 2009
@@ -39,6 +39,11 @@
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
+import org.apache.log4j.BasicConfigurator;
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.PatternLayout;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQTopic;
@@ -117,8 +122,26 @@
     	   
     	   System.out.println("Failover exchange " + url );
        }
+       
+       configureLogging();
     }
 
+    protected void configureLogging()
+    {
+    	PatternLayout layout = new PatternLayout();
+    	layout.setConversionPattern("%t %d %p [%c{4}] %m%n");
+    	BasicConfigurator.configure(new ConsoleAppender(layout));
+    	
+    	String logLevel = System.getProperty("log.level","warn");
+    	String logComponent = System.getProperty("log.comp","org.apache.qpid");
+    	
+    	Logger logger = Logger.getLogger(logComponent);
+    	logger.setLevel(Level.toLevel(logLevel, Level.WARN));
+    	
+    	System.out.println("Level " + logger.getLevel());
+    	
+    }
+    
     public void setUpControlChannel()
     {
         try

Modified: qpid/trunk/qpid/java/testkit/testkit.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/testkit/testkit.py?rev=881896&r1=881895&r2=881896&view=diff
==============================================================================
--- qpid/trunk/qpid/java/testkit/testkit.py (original)
+++ qpid/trunk/qpid/java/testkit/testkit.py Wed Nov 18 19:36:38 2009
@@ -66,7 +66,8 @@
         cmd += ["-Dmsg_count=" + str(options.get("msg_count",10))]
         cmd += ["-Dsleep_time=" + str(options.get("sleep_time",1000))]
         cmd += ["-Dfailover=" + options.get("failover", "failover_exchange")]
-        cmd += ["-Dreliability=" + options.get("reliability", "exactly_once")]        
+        cmd += ["-Dreliability=" + options.get("reliability", "exactly_once")]  
+        cmd += ["-Dlog.level=" + options.get("log.level", "warn")]  
         cmd += [self.client_class]
 
         print str(options.get("port",5672))  
@@ -119,7 +120,7 @@
 class ConcurrencyTest(JavaClientTest):
     """A concurrency test suite for the JMS client"""
 
-    def test_multiplexing_con(self):
+    def xtest_multiplexing_con(self):
         """Tests multiple sessions on a single connection""" 
 
         cluster = Cluster(self, 2)
@@ -146,7 +147,7 @@
     def test_multiplexing_con_tx(self):
         """Tests multiple transacted sessions on a single connection""" 
 
-        cluster = Cluster(self, 2)
+        cluster = Cluster(self,2)
         ssn = cluster[0].connect().session()
         p = cluster[0].port
      
@@ -173,7 +174,7 @@
 class SoakTest(JavaClientTest):
     """A soak test suite for the JMS client"""
 
-    def test_failover(self):
+    def xtest_failover(self):
         cluster = self.cluster(4, expect=EXPECT_EXIT_FAIL)
         p = cluster[0].port
         self.start_error_watcher(broker=cluster[0])
@@ -209,7 +210,4 @@
         self.verify(receiver,sender)
         if error_msg:      
             raise Exception(error_msg)            
-  
-if __name__ == '__main__':
-    if not test.main(): sys.exit(1)
-        
+     



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message