activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r674841 - /activemq/trunk/activemq-protocol-buffer/src/test/java/org/apache/activemq/protocolbuffer/PerformanceTest.java
Date Tue, 08 Jul 2008 14:28:51 GMT
Author: jstrachan
Date: Tue Jul  8 07:28:51 2008
New Revision: 674841

URL: http://svn.apache.org/viewvc?rev=674841&view=rev
Log:
minor tweak trying to get PB to actually work :)

Modified:
    activemq/trunk/activemq-protocol-buffer/src/test/java/org/apache/activemq/protocolbuffer/PerformanceTest.java

Modified: activemq/trunk/activemq-protocol-buffer/src/test/java/org/apache/activemq/protocolbuffer/PerformanceTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-protocol-buffer/src/test/java/org/apache/activemq/protocolbuffer/PerformanceTest.java?rev=674841&r1=674840&r2=674841&view=diff
==============================================================================
--- activemq/trunk/activemq-protocol-buffer/src/test/java/org/apache/activemq/protocolbuffer/PerformanceTest.java
(original)
+++ activemq/trunk/activemq-protocol-buffer/src/test/java/org/apache/activemq/protocolbuffer/PerformanceTest.java
Tue Jul  8 07:28:51 2008
@@ -21,8 +21,6 @@
 import com.google.protobuf.CodedOutputStream;
 import junit.framework.TestCase;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 
@@ -35,7 +33,7 @@
 
 
     public void testPerformance() throws Exception {
-        BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(fileName));
+        FileOutputStream out = new FileOutputStream(fileName);
         CodedOutputStream cout = CodedOutputStream.newInstance(out);
         OpenWire.Destination destination = OpenWire.Destination.newBuilder().setName("FOO.BAR").setType(OpenWire.Destination.DestinationType.QUEUE).build();
 
@@ -50,20 +48,16 @@
 
             System.out.println("Writing message: " + i + " = " + message);
             message.writeTo(cout);
-            //cout.flush();
+            cout.flush();
         }
-        cout.flush();
         out.close();
 
         // now lets try read them!
-        BufferedInputStream in = new BufferedInputStream(new FileInputStream(fileName));
+        FileInputStream in = new FileInputStream(fileName);
         CodedInputStream cin = CodedInputStream.newInstance(in);
         for (int i = 0; i < messageCount; i++) {
             OpenWire.Message message = OpenWire.Message.parseFrom(cin);
-            // todo test its not null or something?
-
             System.out.println("Reading message: " + i + " = " + message);
-
         }
         in.close();
     }



Mime
View raw message