예제 #1
0
  @Test
  public void testSingleCircular() throws DITAOTException {
    final File filename = new File(srcDir, "circularSingle.ditamap");

    final KeyrefReader keyrefreader = new KeyrefReader();
    final CachingLogger logger = new CachingLogger();
    keyrefreader.setLogger(logger);

    keyrefreader.read(filename.toURI(), readMap(filename));

    assertEquals(1, logger.getMessages().size());
    assertEquals(
        "[DOTJ069E][ERROR] Circular key definition same -> same.",
        logger.getMessages().get(0).message);
  }
예제 #2
0
  @Test
  public void testCircular() throws DITAOTException {
    final File filename = new File(srcDir, "circular.ditamap");

    final KeyrefReader keyrefreader = new KeyrefReader();
    final CachingLogger logger = new CachingLogger();
    keyrefreader.setLogger(logger);

    keyrefreader.read(filename.toURI(), readMap(filename));

    assertEquals(3, logger.getMessages().size());
    final Set<String> act = new HashSet<>(3);
    for (final Message msg : logger.getMessages()) {
      act.add(msg.message);
    }
    assertEquals(
        new HashSet<>(
            Arrays.asList(
                "[DOTJ069E][ERROR] Circular key definition first -> second -> third -> first.",
                "[DOTJ069E][ERROR] Circular key definition second -> third -> first -> second.",
                "[DOTJ069E][ERROR] Circular key definition third -> first -> second -> third.")),
        act);
  }