[ https://issues.apache.org/jira/browse/FLINK-6357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16080484#comment-16080484 ]
ASF GitHub Bot commented on FLINK-6357: --------------------------------------- Github user greghogan commented on a diff in the pull request: https://github.com/apache/flink/pull/4169#discussion_r126452583 --- Diff: flink-java/src/test/java/org/apache/flink/api/java/utils/ParameterToolTest.java --- @@ -278,6 +518,26 @@ public void testUnrequestedRequired() { // test repeated access Assert.assertEquals("∞", parameter.getRequired("required")); + Assert.assertEquals(Collections.emptySet(), parameter.getUnrequestedParameters()); + } + + @Test + public void testUnrequestedMultiple() { + ParameterTool parameter = ParameterTool.fromArgs(new String[]{"-boolean", "true", "-byte", "1", + "-short", "2", "-int", "4", "-long", "8", "-float", "4.0", "-double", "8.0", "-string", "∞"}); + Assert.assertEquals(Sets.newHashSet("boolean", "byte", "short", "int", "long", "float", "double", "string"), + parameter.getUnrequestedParameters()); + + Assert.assertTrue(parameter.getBoolean("boolean")); --- End diff -- Done. > ParameterTool get unrequested parameters > ---------------------------------------- > > Key: FLINK-6357 > URL: https://issues.apache.org/jira/browse/FLINK-6357 > Project: Flink > Issue Type: Improvement > Components: Java API > Affects Versions: 1.3.0 > Reporter: Greg Hogan > Assignee: Greg Hogan > Priority: Minor > > The Gelly examples use {{ParameterTool}} to parse required and optional > parameters. In the latter case we should detect if a user mistypes a > parameter name. I would like to add a {{Set<String> > getUnrequestedParameters()}} method returning parameter names not requested > by {{has}} or any of the {{get}} methods. -- This message was sent by Atlassian JIRA (v6.4.14#64029)