qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arnaudsi...@apache.org
Subject svn commit: r710075 - in /incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message: UTF8En UTF8Jp UTF8Test.java
Date Mon, 03 Nov 2008 14:52:31 GMT
Author: arnaudsimon
Date: Mon Nov  3 06:52:31 2008
New Revision: 710075

URL: http://svn.apache.org/viewvc?rev=710075&view=rev
Log:
QPID-1384: Changed for storing UTF8 Strings in files

Added:
    incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8En
    incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Jp
  (with props)
Modified:
    incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java

Added: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8En
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8En?rev=710075&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8En
(added)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8En
Mon Nov  3 06:52:31 2008
@@ -0,0 +1,4 @@
+exhangeName
+queueName
+routingkey
+data
\ No newline at end of file

Added: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Jp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Jp?rev=710075&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Jp
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java?rev=710075&r1=710074&r2=710075&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java
(original)
+++ incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java
Mon Nov  3 06:52:31 2008
@@ -30,6 +30,7 @@
 import javax.naming.InitialContext;
 import javax.jms.*;
 import java.util.Properties;
+import java.io.*;
 
 
 /**
@@ -46,15 +47,24 @@
 
     public void testPlainEn() throws Exception
     {
-        runTest("exhangeName", "queueName", "routingkey", "data");
+         invoke("UTF8En");
     }
 
 
     public void testUTF8Jp() throws Exception
     {
-        runTest("設定がそのように構成されていなければな",
"的某些更新没有出现在这个 README 中。你可以访问下面的",
"的发行版本包括多张光盘,其中包括安装光盘和源码光盘",
"目のインストール CD は、ほとんどの最近のシス");
+        invoke("UTF8Jp");
     }
 
+
+    private void invoke(String name) throws Exception
+    {
+        String path = System.getProperties().getProperty("QPID_HOME");
+        path = path + "/../systests/src/main/java/org/apache/qpid/test/unit/message/" + name;
+         BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(path),
"UTF8"));
+        runTest(in.readLine(), in.readLine(), in.readLine(), in.readLine());
+        in.close();
+    }
     private void runTest(String exchangeName, String queueName, String routingKey, String
data) throws Exception
     {
         _logger.info("Running test for exchange: " + exchangeName
@@ -94,8 +104,7 @@
             sess.queueDeclare(qname, null, null);
             sess.exchangeBind(qname, exch, routkey, null);
             sess.sync();
-
-            conn.close();
+            conn.close();        
     }
 
     private Destination getDestination(String exch, String routkey, String qname)



Mime
View raw message