@Test public void testBooleanSwitchUsingShortName() throws InterpreterPropertyException { String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus", "-d" }; ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches); c.readConfiguration(); assertTrue(c.isTrue(TestConfigProperty.DRY_RUN)); assertTrue(c.isSet(TestConfigProperty.DRY_RUN)); }
@Test public void testBooleanSwitchWithValue() throws InterpreterPropertyException { String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus", "-dryrun", "true" }; ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches); c.readConfiguration(); assertTrue(c.isTrue(TestConfigProperty.DRY_RUN)); assertTrue(c.isSet(TestConfigProperty.DRY_RUN)); }
@Test public void testDefaultValueGetsSetIfAvailable() throws InterpreterPropertyException { String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus" }; ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches); c.readConfiguration(); assertTrue(! c.isTrue(TestConfigProperty.DRY_RUN)); assertTrue(c.isSet(TestConfigProperty.DRY_RUN)); }
@Test public void testBooleanSwitchCanBeSetFalse() throws InterpreterPropertyException { String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus", "-dryrun", "false" }; ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches); c.readConfiguration(); assertTrue(! c.isTrue(TestConfigProperty.DRY_RUN)); assertTrue(c.isSet(TestConfigProperty.DRY_RUN)); }
@Test public void testBooleanSwitchWithoutValue() throws InterpreterPropertyException { String[] switches = new String[] { "-f", "./features", "-h", "org.chorusbdd.chorus", "-dryrun" }; ConfigReader c = new ConfigReader(TestConfigProperty.getAll(), switches); c.readConfiguration(); assertTrue(c.isTrue(TestConfigProperty.DRY_RUN)); assertTrue(c.isSet(TestConfigProperty.DRY_RUN)); }