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

Added tests.

parent 84e7d6a5
No related branches found
No related tags found
1 merge request!14Feat/braille print back end 4
...@@ -28,12 +28,12 @@ public class JavaPropertiesConfigurationParserTest { ...@@ -28,12 +28,12 @@ public class JavaPropertiesConfigurationParserTest {
@Test @BeforeAll @Test @BeforeAll
public static void testSuccessfulParsing() { public static void testSuccessfulParsing() {
Assertions.assertDoesNotThrow(() -> { Assertions.assertDoesNotThrow(() -> {
// Parse concrete properties and defaults // Parse concrete properties and defaults
ConfigurationParser parser = new JavaPropertiesConfigurationParser(mConcreteConfigPath, mDefaultConfigPath); ConfigurationParser parser = new JavaPropertiesConfigurationParser(mConcreteConfigPath, mDefaultConfigPath);
mPrinterConfig = parser.getPrinter(); mPrinterConfig = parser.getPrinter();
Set<String> properties = mPrinterConfig.getPropertyNames(); Set<String> properties = mPrinterConfig.getPropertyNames();
Set<String> formats = parser.getFormatNames(); Set<String> formats = parser.getFormatNames();
mFormatConfig = parser.getFormat("A4"); mFormatConfig = parser.getFormat("A4");
}); });
} }
@Test @Test
...@@ -129,5 +129,12 @@ public class JavaPropertiesConfigurationParserTest { ...@@ -129,5 +129,12 @@ 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("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