@Test
 public void unknownArgumentTest() throws Exception {
   thrown.expect(ParseException.class);
   thrown.expectMessage("Unrecognized option:");
   String[] args = new String[] {"-source test.pdf", "-x"};
   AppArgumentsParser parser = new AppArgumentsParser();
   parser.parse(args);
 }
 @Test
 public void missingSourceTest() throws Exception {
   thrown.expect(ParseException.class);
   thrown.expectMessage("required option <source> is not set");
   String[] args = new String[] {"-verbose"};
   AppArgumentsParser parser = new AppArgumentsParser();
   parser.parse(args);
 }
 @Test
 public void printVersionTest() {
   try {
     String[] args = new String[] {"-version"};
     AppArgumentsParser parser = new AppArgumentsParser();
     parser.parse(args);
   } catch (ParseException exception) {
     Assert.fail("No exception expected");
   }
 }
 @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");
    }
  }