You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2020/02/03 14:16:09 UTC
[flink] 04/10: [hotfix][docs] Clean up deprecation/unused warnings
in tests for ConfigOptionsDocGenerator
This is an automated email from the ASF dual-hosted git repository.
sewen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 2ce040976810d9bf766dd49f20d5ade66078f00f
Author: Stephan Ewen <se...@apache.org>
AuthorDate: Fri Jan 31 09:33:37 2020 +0100
[hotfix][docs] Clean up deprecation/unused warnings in tests for ConfigOptionsDocGenerator
---
.../configuration/ConfigOptionsDocGeneratorTest.java | 19 ++++++++++++++++++-
.../docs/configuration/data/TestCommonOptions.java | 4 ++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java b/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java
index 38bd96b..1e9731c 100644
--- a/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java
+++ b/flink-docs/src/test/java/org/apache/flink/docs/configuration/ConfigOptionsDocGeneratorTest.java
@@ -51,6 +51,7 @@ import static org.junit.Assert.assertEquals;
/**
* Tests for the {@link ConfigOptionsDocGenerator}.
*/
+@SuppressWarnings("unused")
public class ConfigOptionsDocGeneratorTest {
@ClassRule
@@ -59,11 +60,13 @@ public class ConfigOptionsDocGeneratorTest {
static class TestConfigGroup {
public static ConfigOption<Integer> firstOption = ConfigOptions
.key("first.option.a")
+ .intType()
.defaultValue(2)
.withDescription("This is example description for the first option.");
public static ConfigOption<String> secondOption = ConfigOptions
.key("second.option.a")
+ .stringType()
.noDefaultValue()
.withDescription("This is long example description for the second option.");
}
@@ -71,7 +74,7 @@ public class ConfigOptionsDocGeneratorTest {
private enum TestEnum {
VALUE_1,
VALUE_2,
- VALUE_3;
+ VALUE_3
}
static class TypeTestConfigGroup {
@@ -209,34 +212,40 @@ public class ConfigOptionsDocGeneratorTest {
// should end up in the default group
public static ConfigOption<Integer> option1 = ConfigOptions
.key("a.option")
+ .intType()
.defaultValue(2);
// should end up in group1, perfect key-prefix match
public static ConfigOption<String> option2 = ConfigOptions
.key("a.b.option")
+ .stringType()
.noDefaultValue();
// should end up in group1, full key-prefix match
public static ConfigOption<Integer> option3 = ConfigOptions
.key("a.b.c.option")
+ .intType()
.defaultValue(2);
// should end up in group1, full key-prefix match for group 1, partial match for group 2
// checks that the generator remembers the last encountered root node
public static ConfigOption<Integer> option4 = ConfigOptions
.key("a.b.c.e.option")
+ .intType()
.defaultValue(2);
// should end up in the default group, since no group exists with prefix "a.c"
// checks that the generator does not ignore components (like ignoring "c" to find a match "a.b")
public static ConfigOption<String> option5 = ConfigOptions
.key("a.c.b.option")
+ .stringType()
.noDefaultValue();
// should end up in group2, full key-prefix match for group 2
// checks that the longest matching group is assigned
public static ConfigOption<Integer> option6 = ConfigOptions
.key("a.b.c.d.option")
+ .intType()
.defaultValue(2);
}
@@ -266,21 +275,25 @@ public class ConfigOptionsDocGeneratorTest {
static class TestConfigMultipleSubGroup {
public static ConfigOption<Integer> firstOption = ConfigOptions
.key("first.option.a")
+ .intType()
.defaultValue(2)
.withDescription("This is example description for the first option.");
public static ConfigOption<String> secondOption = ConfigOptions
.key("second.option.a")
+ .stringType()
.noDefaultValue()
.withDescription("This is long example description for the second option.");
public static ConfigOption<Integer> thirdOption = ConfigOptions
.key("third.option.a")
+ .intType()
.defaultValue(2)
.withDescription("This is example description for the third option.");
public static ConfigOption<String> fourthOption = ConfigOptions
.key("fourth.option.a")
+ .stringType()
.noDefaultValue()
.withDescription("This is long example description for the fourth option.");
}
@@ -365,12 +378,14 @@ public class ConfigOptionsDocGeneratorTest {
@Documentation.OverrideDefault("default_1")
public static ConfigOption<Integer> firstOption = ConfigOptions
.key("first.option.a")
+ .intType()
.defaultValue(2)
.withDescription("This is example description for the first option.");
@Documentation.OverrideDefault("default_2")
public static ConfigOption<String> secondOption = ConfigOptions
.key("second.option.a")
+ .stringType()
.noDefaultValue()
.withDescription("This is long example description for the second option.");
}
@@ -453,12 +468,14 @@ public class ConfigOptionsDocGeneratorTest {
static class TestConfigGroupWithExclusion {
public static ConfigOption<Integer> firstOption = ConfigOptions
.key("first.option.a")
+ .intType()
.defaultValue(2)
.withDescription("This is example description for the first option.");
@Documentation.ExcludeFromDocumentation
public static ConfigOption<String> excludedOption = ConfigOptions
.key("excluded.option.a")
+ .stringType()
.noDefaultValue()
.withDescription("This should not be documented.");
}
diff --git a/flink-docs/src/test/java/org/apache/flink/docs/configuration/data/TestCommonOptions.java b/flink-docs/src/test/java/org/apache/flink/docs/configuration/data/TestCommonOptions.java
index 865d9ec..200b84d 100644
--- a/flink-docs/src/test/java/org/apache/flink/docs/configuration/data/TestCommonOptions.java
+++ b/flink-docs/src/test/java/org/apache/flink/docs/configuration/data/TestCommonOptions.java
@@ -25,16 +25,19 @@ import org.apache.flink.configuration.ConfigOptions;
/**
* Collection of test {@link ConfigOptions ConfigOptions}.
*/
+@SuppressWarnings("unused") // this class is only accessed reflectively
public class TestCommonOptions {
@Documentation.SectionOption(sections = {Documentation.SectionOption.SECTION_COMMON})
public static final ConfigOption<Integer> COMMON_OPTION = ConfigOptions
.key("first.option.a")
+ .intType()
.defaultValue(2)
.withDescription("This is the description for the common option.");
public static final ConfigOption<String> GENERIC_OPTION = ConfigOptions
.key("second.option.a")
+ .stringType()
.noDefaultValue()
.withDescription("This is the description for the generic option.");
@@ -43,6 +46,7 @@ public class TestCommonOptions {
position = 2)
public static final ConfigOption<Integer> COMMON_POSITIONED_OPTION = ConfigOptions
.key("third.option.a")
+ .intType()
.defaultValue(3)
.withDescription("This is the description for the positioned common option.");
}