You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ab...@apache.org on 2017/02/27 20:44:23 UTC
ranger git commit: RANGER-1413: Fix issues uncovered by static code
analysis
Repository: ranger
Updated Branches:
refs/heads/master fdb098c24 -> cd4dbcbde
RANGER-1413: Fix issues uncovered by static code analysis
Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/cd4dbcbd
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/cd4dbcbd
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/cd4dbcbd
Branch: refs/heads/master
Commit: cd4dbcbdea320f7782a9998a039919694fe544d5
Parents: fdb098c
Author: Abhay Kulkarni <ak...@hortonworks.com>
Authored: Mon Feb 27 12:32:27 2017 -0800
Committer: Abhay Kulkarni <ak...@hortonworks.com>
Committed: Mon Feb 27 12:32:27 2017 -0800
----------------------------------------------------------------------
.../TestDefaultPolicyResourceMatcherForPolicy.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ranger/blob/cd4dbcbd/agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/TestDefaultPolicyResourceMatcherForPolicy.java
----------------------------------------------------------------------
diff --git a/agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/TestDefaultPolicyResourceMatcherForPolicy.java b/agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/TestDefaultPolicyResourceMatcherForPolicy.java
index f4d76ad..3458c26 100644
--- a/agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/TestDefaultPolicyResourceMatcherForPolicy.java
+++ b/agents-common/src/test/java/org/apache/ranger/plugin/resourcematcher/TestDefaultPolicyResourceMatcherForPolicy.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.*;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
+import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
@@ -82,7 +83,7 @@ public class TestDefaultPolicyResourceMatcherForPolicy {
private void runTestsFromResourceFiles(String[] resourceNames) throws Exception {
for(String resourceName : resourceNames) {
InputStream inStream = this.getClass().getResourceAsStream(resourceName);
- InputStreamReader reader = new InputStreamReader(inStream);
+ InputStreamReader reader = new InputStreamReader(inStream, Charset.defaultCharset());
runTests(reader);
}
@@ -95,7 +96,7 @@ public class TestDefaultPolicyResourceMatcherForPolicy {
runTest(testCase, testCases.serviceDef);
}
}
- private void runTest(DefaultPolicyResourceMatcherTestCases.TestCase testCase, RangerServiceDef serviceDef) throws Exception {
+ private void runTest(DefaultPolicyResourceMatcherTestCases.TestCase testCase, RangerServiceDef serviceDef) throws Exception {
assertTrue("invalid input: " , testCase != null && testCase.tests != null);
@@ -137,12 +138,12 @@ public class TestDefaultPolicyResourceMatcherForPolicy {
List<TestCase> testCases;
- class TestCase {
- public String name;
+ static class TestCase {
+ String name;
Map<String, RangerPolicyResource> policyResources;
- public List<OneTest> tests;
+ List<OneTest> tests;
- class OneTest {
+ static class OneTest {
String name;
String type;
RangerPolicy policy;