@Test public void testPlaceholderCheckFailsIfSamePlaceholdersCountButSomeRepeatedOrMissing() throws SimplePrintfLikeIntegrityCheckerException { String source = "There are %1 files and %2 folders"; String target = "Il y a %1 fichiers et %1 dossiers"; try { checker.check(source, target); fail("SimplePrintfLikeIntegrityCheckerException must be thrown"); } catch (SimplePrintfLikeIntegrityCheckerException 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 SimplePrintfLikeIntegrityCheckerException((rce.getMessage())); } }
SimplePrintfLikeIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws PrintfLikeIntegrityCheckerException { try { super.check(sourceContent, targetContent); } catch (RegexCheckerException rce) { throw new SimplePrintfLikeIntegrityCheckerException((rce.getMessage())); } } }
SimplePrintfLikeIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws PrintfLikeIntegrityCheckerException { try { super.check(sourceContent, targetContent); } catch (RegexCheckerException rce) { throw new SimplePrintfLikeIntegrityCheckerException((rce.getMessage())); } }  }
SimplePrintfLikeIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws PrintfLikeIntegrityCheckerException { try { super.check(sourceContent, targetContent); } catch (RegexCheckerException rce) { throw new SimplePrintfLikeIntegrityCheckerException((rce.getMessage())); } }  @Override String getRegex(); @Override void check(String sourceContent, String targetContent); }
SimplePrintfLikeIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws PrintfLikeIntegrityCheckerException { try { super.check(sourceContent, targetContent); } catch (RegexCheckerException rce) { throw new SimplePrintfLikeIntegrityCheckerException((rce.getMessage())); } }  @Override String getRegex(); @Override void check(String sourceContent, String targetContent);  }