mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-02 17:19:37 +00:00
bug 2775: Added test to prevent "." in Setting names
This commit is contained in:
1 parent
aa98ae70ec
commit
44572505e8
1 file changed
+13
+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
|
||||
|
||||
Reference in new issue
Block a user