Skip to content
Snippets Groups Projects
Commit 700810f0 authored by Andrey Ruzhanskiy's avatar Andrey Ruzhanskiy
Browse files

Removed unused Code and test.

parent 9fb3951c
No related branches found
No related tags found
1 merge request!14Feat/braille print back end 4
...@@ -14,6 +14,4 @@ task integrationTest(type: Test) { ...@@ -14,6 +14,4 @@ task integrationTest(type: Test) {
classpath = sourceSets.integrationTest.runtimeClasspath classpath = sourceSets.integrationTest.runtimeClasspath
mustRunAfter test mustRunAfter test
checkstyleIntegrationTest.enabled = false checkstyleIntegrationTest.enabled = false
} }
\ No newline at end of file
check.dependsOn integrationTest
\ No newline at end of file
...@@ -190,16 +190,11 @@ class JavaPropertiesConfigurationValidator implements ConfigurationValidator { ...@@ -190,16 +190,11 @@ class JavaPropertiesConfigurationValidator implements ConfigurationValidator {
throw new ConfigurationValidationException("Invalid property name: " + propertyName); throw new ConfigurationValidationException("Invalid property name: " + propertyName);
} }
// Check against its type requirement predicate // Check against its type requirement predicate
try { if (!validation.get(propertyName).test(value)) {
if (!validation.get(propertyName).test(value)) { throw new ConfigurationValidationException(
throw new ConfigurationValidationException( "Invalid value '" + value + "' for property '" + propertyName + "'"
"Invalid value '" + value + "' for property '" + propertyName + "'" );
);
}
} catch (RuntimeException e) {
throw new ConfigurationValidationException(e.getMessage(), e);
} }
} }
// Validation Predicates // Validation Predicates
......
...@@ -129,12 +129,4 @@ public class JavaPropertiesConfigurationParserTest { ...@@ -129,12 +129,4 @@ public class JavaPropertiesConfigurationParserTest {
Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("raster.cellDistance.horizontal").toInt()); Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("raster.cellDistance.horizontal").toInt());
Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("name").toDouble()); Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("name").toDouble());
} }
@Test
public void testWrongCapability() {
Assertions.assertThrows(ConfigurationValidationException.class, () -> {
String configPath = getResource("config/wrongPrinterModeExample.properties").getAbsolutePath();
ConfigurationParser configParser = new JavaPropertiesConfigurationParser(configPath, mDefaultConfigPath);
});
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment