eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qingwz...@apache.org
Subject incubator-eagle git commit: TestSerDeserPer failed with Windows Git bash
Date Mon, 15 Aug 2016 08:17:18 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/develop b4732cb2f -> ecabbe4ca


TestSerDeserPer failed with Windows Git bash

https://issues.apache.org/jira/browse/EAGLE-466

Author: Qingwen Zhao <qingwen220@gmail.com>

Closes #346 from qingwen220/EAGLE-466.


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/ecabbe4c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/ecabbe4c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/ecabbe4c

Branch: refs/heads/develop
Commit: ecabbe4ca98b43356e8e1410b6f4eabc159791d6
Parents: b4732cb
Author: Qingwen Zhao <qingwen220@gmail.com>
Authored: Mon Aug 15 16:17:09 2016 +0800
Committer: Qingwen Zhao <qingwen220@gmail.com>
Committed: Mon Aug 15 16:17:09 2016 +0800

----------------------------------------------------------------------
 .../alert/engine/perf/TestSerDeserPer.java      | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ecabbe4c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/perf/TestSerDeserPer.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/perf/TestSerDeserPer.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/perf/TestSerDeserPer.java
index 251e47f..f2027b2 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/perf/TestSerDeserPer.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/perf/TestSerDeserPer.java
@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.commons.io.FilenameUtils;
 import org.apache.eagle.alert.engine.coordinator.StreamPartition;
 import org.apache.eagle.alert.engine.coordinator.StreamSortSpec;
 import org.apache.eagle.alert.engine.model.PartitionedEvent;
@@ -49,15 +50,20 @@ public class TestSerDeserPer {
         data = new Object[]{sb.toString()};
     }
 
+    private String getTmpPath() {
+        return System.getProperty("java.io.tmpdir");
+    }
+
     @Test
     public void testSerDeserPerf() throws Exception{
         Kryo kryo = new Kryo();
-        Output output = new Output(new FileOutputStream("/tmp/file.bin"));
+        String outputPath = FilenameUtils.concat(getTmpPath(), "file.bin");
+        Output output = new Output(new FileOutputStream(outputPath));
         for(int i=0; i<1000; i++){
             kryo.writeObject(output, constructPE());
         }
         output.close();
-        Input input = new Input(new FileInputStream("/tmp/file.bin"));
+        Input input = new Input(new FileInputStream(outputPath));
         PartitionedEvent someObject = kryo.readObject(input, PartitionedEvent.class);
         input.close();
         Assert.assertTrue(someObject.getData().length == 1);
@@ -88,12 +94,13 @@ public class TestSerDeserPer {
     @Test
     public void testSerDeserPerf2() throws Exception{
         Kryo kryo = new Kryo();
-        Output output = new Output(new FileOutputStream("/tmp/file2.bin"));
+        String outputPath = FilenameUtils.concat(getTmpPath(), "file2.bin");
+        Output output = new Output(new FileOutputStream(outputPath));
         for(int i=0; i<1000; i++){
             kryo.writeObject(output, constructNewPE());
         }
         output.close();
-        Input input = new Input(new FileInputStream("/tmp/file2.bin"));
+        Input input = new Input(new FileInputStream(outputPath));
         NewPartitionedEvent someObject = kryo.readObject(input, NewPartitionedEvent.class);
         input.close();
         Assert.assertTrue(someObject.getData().length == 1);
@@ -119,12 +126,13 @@ public class TestSerDeserPer {
     @Test
     public void testSerDeserPerf3() throws Exception{
         Kryo kryo = new Kryo();
-        Output output = new Output(new FileOutputStream("/tmp/file3.bin"));
+        String outputPath = FilenameUtils.concat(getTmpPath(), "file3.bin");
+        Output output = new Output(new FileOutputStream(outputPath));
         for(int i=0; i<1000; i++){
             kryo.writeObject(output, constructNewPE2());
         }
         output.close();
-        Input input = new Input(new FileInputStream("/tmp/file3.bin"));
+        Input input = new Input(new FileInputStream(outputPath));
         NewPartitionedEvent2 someObject = kryo.readObject(input, NewPartitionedEvent2.class);
         input.close();
         Assert.assertTrue(someObject.getData().length == 1);


Mime
View raw message