コード例 #1
0
 protected void checkUrlContent(
     SimulatedArchivalUnit sau,
     String path,
     int fileNum,
     int depth,
     int branchNum,
     boolean isAbnormal,
     boolean isDamaged)
     throws IOException {
   String file = sau.getUrlRoot() + path;
   CachedUrl url = sau.makeCachedUrl(file);
   String content = getUrlContent(url);
   String expectedContent;
   if (path.endsWith(".html")) {
     String fn = path.substring(path.lastIndexOf("/") + 1);
     expectedContent = scgen.getHtmlFileContent(fn, fileNum, depth, branchNum, isAbnormal);
   } else {
     expectedContent = scgen.getTxtContent(fileNum, depth, branchNum, isAbnormal);
   }
   if (isDamaged) {
     assertNotEquals(expectedContent, content);
   } else {
     assertEquals(expectedContent, content);
   }
 }
コード例 #2
0
  protected void createContent(SimulatedArchivalUnit sau) {
    log.debug("createContent()");
    scgen = sau.getContentGenerator();
    scgen.setFileTypes(
        SimulatedContentGenerator.FILE_TYPE_HTML + SimulatedContentGenerator.FILE_TYPE_TXT);
    scgen.setAbnormalFile("1,1", 1);
    scgen.setOddBranchesHaveContent(true);

    sau.deleteContentTree();
    sau.generateContentTree();
    assertTrue(scgen.isContentTree());
  }