carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenliang...@apache.org
Subject [1/2] incubator-carbondata git commit: correct possible errors in test cases due to url not present
Date Tue, 03 Jan 2017 15:56:49 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 84e727bc2 -> cb2148040


correct possible errors in test cases due to url not present


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

Branch: refs/heads/master
Commit: 4d882dff4a2b185de7d829faf7cd099f370b42cc
Parents: 84e727b
Author: vincentchenfei <vincent.chenfei@huawei.com>
Authored: Sat Dec 31 00:10:04 2016 +0530
Committer: chenliang613 <chenliang613@apache.org>
Committed: Tue Jan 3 23:55:49 2017 +0800

----------------------------------------------------------------------
 .../cache/dictionary/AbstractDictionaryCacheTest.java  | 13 +++++++++----
 .../core/writer/CarbonDictionaryWriterImplTest.java    | 12 ++++++++----
 2 files changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/4d882dff/core/src/test/java/org/apache/carbondata/core/cache/dictionary/AbstractDictionaryCacheTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/carbondata/core/cache/dictionary/AbstractDictionaryCacheTest.java
b/core/src/test/java/org/apache/carbondata/core/cache/dictionary/AbstractDictionaryCacheTest.java
index e647ae0..0b64846 100644
--- a/core/src/test/java/org/apache/carbondata/core/cache/dictionary/AbstractDictionaryCacheTest.java
+++ b/core/src/test/java/org/apache/carbondata/core/cache/dictionary/AbstractDictionaryCacheTest.java
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.net.URL;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -162,10 +163,14 @@ public class AbstractDictionaryCacheTest {
     InputStream in = null;
     props = new Properties();
     try {
-      URI uri = getClass().getClassLoader().getResource(PROPERTY_FILE_NAME).toURI();
-      File file = new File(uri);
-      in = new FileInputStream(file);
-      props.load(in);
+      URL url = getClass().getClassLoader().getResource(PROPERTY_FILE_NAME);
+      if (null != url){
+
+        URI uri = url.toURI();
+        File file = new File(uri);
+        in = new FileInputStream(file);
+        props.load(in);
+      }
     } catch (IOException e) {
       e.printStackTrace();
     } catch (URISyntaxException e) {

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/4d882dff/core/src/test/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImplTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImplTest.java
b/core/src/test/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImplTest.java
index 5c80bef..4cce250 100644
--- a/core/src/test/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImplTest.java
+++ b/core/src/test/java/org/apache/carbondata/core/writer/CarbonDictionaryWriterImplTest.java
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.net.URL;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -502,10 +503,13 @@ public class CarbonDictionaryWriterImplTest {
     InputStream in = null;
     props = new Properties();
     try {
-      URI uri = getClass().getClassLoader().getResource(PROPERTY_FILE_NAME).toURI();
-      File file = new File(uri);
-      in = new FileInputStream(file);
-      props.load(in);
+      URL url = getClass().getClassLoader().getResource(PROPERTY_FILE_NAME);
+      if (null != url) {
+        URI uri = url.toURI();
+        File file = new File(uri);
+        in = new FileInputStream(file);
+        props.load(in);
+      }
     } catch (IOException e) {
       e.printStackTrace();
     } catch (URISyntaxException e) {


Mime
View raw message