bug 2775: Added test to prevent "." in Setting names

This commit is contained in:
Steffen Schaefer committed 2016-03-15 16:46:51 +01:00
1 parent aa98ae70ec
commit 44572505e8
1 file changed
+13
@@ -84,6 +84,11 @@ public abstract class AbstractSettingsSerializationTest<SOT> {
@SuppressWarnings("unused")
private final DecimalSetting bumba = new DecimalSetting("humba", this);
}
private static class DisallowedKeySettings extends AbstractSettings {
@SuppressWarnings("unused")
private final StringSetting disallowedKey= new StringSetting("disallowed.key", this);
}
protected abstract <T extends Settings> SOT serialize(T settings) throws Exception;
@@ -135,6 +140,14 @@ public abstract class AbstractSettingsSerializationTest<SOT> {
public void testDuplicateSetting() {
new DuplicateFieldSettings();
}
/**
* Verifies that it is not possible to have setting names with ".".
*/
@Test(expected = RuntimeException.class)
public void testDisallowedSettingNameSetting() {
new DisallowedKeySettings();
}
/**
* A white-box test that tests property name escaping in case the property name conflicts with how type names (used