Github user d2r commented on a diff in the pull request:
https://github.com/apache/storm/pull/921#discussion_r47988210
--- Diff: storm-core/test/jvm/backtype/storm/TestConfigValidate.java ---
@@ -628,9 +628,89 @@ public void TestImpersonationAclUserEntryValidator()
throws InvocationTargetExce
} catch (IllegalArgumentException Ex) {
}
}
+ }
+
+ @Test
+ public void TestResourceAwareSchedulerUserPool() {
+ TestConfig config = new TestConfig();
+ Collection<Object> passCases = new LinkedList<Object>();
+ Collection<Object> failCases = new LinkedList<Object>();
+
+ Map<String, Map<String, Integer>> passCase1 = new HashMap<String,
Map<String, Integer>>();
+ passCase1.put("jerry", new HashMap<String, Integer>());
+ passCase1.put("bobby", new HashMap<String, Integer>());
+ passCase1.put("derek", new HashMap<String, Integer>());
+
+ passCase1.get("jerry").put("cpu", 10000);
+ passCase1.get("jerry").put("memory", 20148);
+ passCase1.get("bobby").put("cpu", 20000);
+ passCase1.get("bobby").put("memory", 40148);
+ passCase1.get("derek").put("cpu", 30000);
+ passCase1.get("derek").put("memory", 60148);
+
+ passCases.add(passCase1);
+
+ for (Object value : passCases) {
+ config.put(TestConfig.TEST_MAP_CONFIG_7, value);
+ ConfigValidation.validateFields(config, TestConfig.class);
+ }
+
+ Map<String, Map<String, Integer>> failCase1 = new HashMap<String,
Map<String, Integer>>();
+ failCase1.put("jerry", new HashMap<String, Integer>());
+ failCase1.put("bobby", new HashMap<String, Integer>());
+ failCase1.put("derek", new HashMap<String, Integer>());
+
+ failCase1.get("jerry").put("cpu", 10000);
+ failCase1.get("jerry").put("memory", 20148);
+ failCase1.get("bobby").put("cpu", 20000);
+ failCase1.get("bobby").put("memory", 40148);
+ failCase1.get("derek").put("cpu", 30000);
--- End diff --
Let's add a comment that shows why we expect this test case to fail. Here
it is because the `"memory"` entry is missing.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---