< prev index next >

test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTagInModule.java

Print this page




  51         tester.runTests(m -> new Object[]{Paths.get(m.getName())});
  52     }
  53 
  54     TestValueTagInModule() {
  55         tb = new ToolBox();
  56     }
  57 
  58     @Test
  59     public void test(Path base) throws Exception {
  60         Path srcDir = base.resolve("src");
  61         createTestClass(srcDir);
  62 
  63         Path outDir = base.resolve("out");
  64         javadoc("-d", outDir.toString(),
  65                 "--module-source-path", srcDir.toString(),
  66                 "--module", "m1");
  67 
  68         checkExit(Exit.OK);
  69 
  70         checkOutput("m1/module-summary.html", true,
  71                 "<a id=\"module.description\">\n"
  72                 + "<!--   -->\n"
  73                 + "</a>\n"
  74                 + "<div class=\"block\">value of field CONS : <a href=\"pkg/A.html#CONS\">100</a></div>");
  75     }
  76 
  77     void createTestClass(Path srcDir) throws Exception {
  78         new ModuleBuilder(tb, "m1")
  79                 .comment("value of field CONS : {@value pkg.A#CONS}")
  80                 .exports("pkg")
  81                 .classes("package pkg; public class A{ public static final int CONS = 100;}")
  82                 .write(srcDir);
  83     }
  84 }


  51         tester.runTests(m -> new Object[]{Paths.get(m.getName())});
  52     }
  53 
  54     TestValueTagInModule() {
  55         tb = new ToolBox();
  56     }
  57 
  58     @Test
  59     public void test(Path base) throws Exception {
  60         Path srcDir = base.resolve("src");
  61         createTestClass(srcDir);
  62 
  63         Path outDir = base.resolve("out");
  64         javadoc("-d", outDir.toString(),
  65                 "--module-source-path", srcDir.toString(),
  66                 "--module", "m1");
  67 
  68         checkExit(Exit.OK);
  69 
  70         checkOutput("m1/module-summary.html", true,
  71                 "<section class=\"moduleDescription\" id=\"module.description\">\n"
  72                 + "<!-- ============ MODULE DESCRIPTION =========== -->\n"

  73                 + "<div class=\"block\">value of field CONS : <a href=\"pkg/A.html#CONS\">100</a></div>");
  74     }
  75 
  76     void createTestClass(Path srcDir) throws Exception {
  77         new ModuleBuilder(tb, "m1")
  78                 .comment("value of field CONS : {@value pkg.A#CONS}")
  79                 .exports("pkg")
  80                 .classes("package pkg; public class A{ public static final int CONS = 100;}")
  81                 .write(srcDir);
  82     }
  83 }
< prev index next >