@Test public void testAndroidPlaceholderCheckFailsIfDifferentPlaceholdersCount() throws PrintfLikeIntegrityCheckerException { PrintfLikeIntegrityChecker checker = new PrintfLikeIntegrityChecker(); String source = "There are %1$d files and %2$d folders"; String target = "Il y a %1$d fichiers"; try { checker.check(source, target); fail("PrintfLikeIntegrityCheckerException must be thrown"); } catch (PrintfLikeIntegrityCheckerException e) { assertEquals(e.getMessage(), "Placeholders in source and target are different"); } }
@Override public void check(String sourceContent, String targetContent) throws PrintfLikeIntegrityCheckerException { try { super.check(sourceContent, targetContent); } catch (RegexCheckerException rce) { throw new PrintfLikeIntegrityCheckerException((rce.getMessage())); } }
PrintfLikeIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws PrintfLikeIntegrityCheckerException { try { super.check(sourceContent, targetContent); } catch (RegexCheckerException rce) { throw new PrintfLikeIntegrityCheckerException((rce.getMessage())); } } }
PrintfLikeIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws PrintfLikeIntegrityCheckerException { try { super.check(sourceContent, targetContent); } catch (RegexCheckerException rce) { throw new PrintfLikeIntegrityCheckerException((rce.getMessage())); } }  }
PrintfLikeIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws PrintfLikeIntegrityCheckerException { try { super.check(sourceContent, targetContent); } catch (RegexCheckerException rce) { throw new PrintfLikeIntegrityCheckerException((rce.getMessage())); } }  @Override String getRegex(); @Override void check(String sourceContent, String targetContent); }
PrintfLikeIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws PrintfLikeIntegrityCheckerException { try { super.check(sourceContent, targetContent); } catch (RegexCheckerException rce) { throw new PrintfLikeIntegrityCheckerException((rce.getMessage())); } }  @Override String getRegex(); @Override void check(String sourceContent, String targetContent);  }