@Test public void defaultLogLevelTest() { try { String[] args = new String[] {"-source test.pdf"}; AppArgumentsParser parser = new AppArgumentsParser(); AppProperties properties = parser.parse(args); Assert.assertFalse(properties.isDebug()); Assert.assertTrue(properties.isVerbose()); Assert.assertFalse(properties.isQuiet()); } catch (ParseException exception) { Assert.fail("No exception expected"); } }
@Test public void definedSourceTest() { try { String[] args = new String[] {"-source test.pdf "}; AppArgumentsParser parser = new AppArgumentsParser(); AppProperties properties = parser.parse(args); Assert.assertEquals("test.pdf", properties.getSource()); args = new String[] {"-source=test.pdf"}; properties = parser.parse(args); Assert.assertEquals("test.pdf", properties.getSource()); } catch (ParseException exception) { Assert.fail("No exception expected"); } }