@Test(expected = HtmlTagIntegrityCheckerException.class) public void testHtmlTagCheckIncorrectTagNameCase() { String source = "<span class=\"asdf\">There are <span class=\"foo\">%1</span> files and %2 folders</option>"; String target = "<Span class=\"asdf\">Il y a <span class=\"foo\">%1</span> fichiers et %2 dossiers</option>"; checker.check(source, target); }
@Override public void check(String sourceContent, String targetContent) throws IntegrityCheckException { logger.debug("Get Html tags of the target"); List<String> targetHtmlTags = getHtmlTags(targetContent); logger.debug("Target Html tags: {}", targetHtmlTags); logger.debug("Get Html tags of the source"); List<String> sourceHtmlTags = getHtmlTags(sourceContent); logger.debug("Source Html tags: {}", sourceHtmlTags); logger.debug("Make sure the target has the same Html tags as the source"); if (!sourceHtmlTags.containsAll(targetHtmlTags) || !targetHtmlTags.containsAll(sourceHtmlTags)) { throw new HtmlTagIntegrityCheckerException("HTML tags in source and target are different"); } }
HtmlTagIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws IntegrityCheckException { logger.debug("Get Html tags of the target"); List<String> targetHtmlTags = getHtmlTags(targetContent); logger.debug("Target Html tags: {}", targetHtmlTags); logger.debug("Get Html tags of the source"); List<String> sourceHtmlTags = getHtmlTags(sourceContent); logger.debug("Source Html tags: {}", sourceHtmlTags); logger.debug("Make sure the target has the same Html tags as the source"); if (!sourceHtmlTags.containsAll(targetHtmlTags) || !targetHtmlTags.containsAll(sourceHtmlTags)) { throw new HtmlTagIntegrityCheckerException("HTML tags in source and target are different"); } } }
HtmlTagIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws IntegrityCheckException { logger.debug("Get Html tags of the target"); List<String> targetHtmlTags = getHtmlTags(targetContent); logger.debug("Target Html tags: {}", targetHtmlTags); logger.debug("Get Html tags of the source"); List<String> sourceHtmlTags = getHtmlTags(sourceContent); logger.debug("Source Html tags: {}", sourceHtmlTags); logger.debug("Make sure the target has the same Html tags as the source"); if (!sourceHtmlTags.containsAll(targetHtmlTags) || !targetHtmlTags.containsAll(sourceHtmlTags)) { throw new HtmlTagIntegrityCheckerException("HTML tags in source and target are different"); } }  }
HtmlTagIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws IntegrityCheckException { logger.debug("Get Html tags of the target"); List<String> targetHtmlTags = getHtmlTags(targetContent); logger.debug("Target Html tags: {}", targetHtmlTags); logger.debug("Get Html tags of the source"); List<String> sourceHtmlTags = getHtmlTags(sourceContent); logger.debug("Source Html tags: {}", sourceHtmlTags); logger.debug("Make sure the target has the same Html tags as the source"); if (!sourceHtmlTags.containsAll(targetHtmlTags) || !targetHtmlTags.containsAll(sourceHtmlTags)) { throw new HtmlTagIntegrityCheckerException("HTML tags in source and target are different"); } }  @Override String getRegex(); @Override void check(String sourceContent, String targetContent); }
HtmlTagIntegrityChecker extends RegexIntegrityChecker { @Override public void check(String sourceContent, String targetContent) throws IntegrityCheckException { logger.debug("Get Html tags of the target"); List<String> targetHtmlTags = getHtmlTags(targetContent); logger.debug("Target Html tags: {}", targetHtmlTags); logger.debug("Get Html tags of the source"); List<String> sourceHtmlTags = getHtmlTags(sourceContent); logger.debug("Source Html tags: {}", sourceHtmlTags); logger.debug("Make sure the target has the same Html tags as the source"); if (!sourceHtmlTags.containsAll(targetHtmlTags) || !targetHtmlTags.containsAll(sourceHtmlTags)) { throw new HtmlTagIntegrityCheckerException("HTML tags in source and target are different"); } }  @Override String getRegex(); @Override void check(String sourceContent, String targetContent);  }