本文整理汇总了Java中com.sun.tools.doclint.DocLint.BadArgs类的典型用法代码示例。如果您正苦于以下问题:Java BadArgs类的具体用法?Java BadArgs怎么用?Java BadArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BadArgs类属于com.sun.tools.doclint.DocLint包,在下文中一共展示了BadArgs类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testArgsNoFiles
import com.sun.tools.doclint.DocLint.BadArgs; //导入依赖的package包/类
void testArgsNoFiles() throws BadArgs, IOException {
System.err.println("test args, no files");
DocLint dl = new DocLint();
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
dl.run(pw, "-Xmsgs");
pw.close();
String out = sw.toString();
String expect = "No files given";
if (!Objects.equals(out.trim(), expect)) {
error("unexpected output");
System.err.println("EXPECT>>" + expect + "<<");
System.err.println("FOUND>>" + out + "<<");
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:RunTest.java
示例2: test
import com.sun.tools.doclint.DocLint.BadArgs; //导入依赖的package包/类
void test(String file, String pathOpt, String path) throws BadArgs, IOException {
System.err.println("test " + pathOpt);
String out1 = doclint("-Xmsgs", file);
if (!pkgNotFound.matcher(out1).find())
error("message not found: " + pkgNotFound);
String out2;
if (needTarget8(pathOpt)) {
out2 = doclint("-Xmsgs", "-source", "8", "-target", "8", pathOpt, path, file);
} else {
out2 = doclint("-Xmsgs", pathOpt, path, file);
}
if (pkgNotFound.matcher(out2).find())
error("unexpected message found: " + pkgNotFound);
if (!badHtmlEntity.matcher(out1).find())
error("message not found: " + badHtmlEntity);
try {
doclint("-Xmsgs", pathOpt);
error("expected exception not thrown");
} catch (BadArgs e) {
System.err.println(e);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:PathsTest.java
示例3: test
import com.sun.tools.doclint.DocLint.BadArgs; //导入依赖的package包/类
void test(String file, String pathOpt, String path) throws BadArgs, IOException {
System.err.println("test " + pathOpt);
String out1 = doclint("-Xmsgs", file);
if (!pkgNotFound.matcher(out1).find())
error("message not found: " + pkgNotFound);
String out2 = doclint("-Xmsgs", pathOpt, path, file);
if (pkgNotFound.matcher(out2).find())
error("unexpected message found: " + pkgNotFound);
if (!badHtmlEntity.matcher(out1).find())
error("message not found: " + badHtmlEntity);
try {
doclint("-Xmsgs", pathOpt);
error("expected exception not thrown");
} catch (BadArgs e) {
System.err.println(e);
}
}
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:20,代码来源:PathsTest.java
示例4: testRun
import com.sun.tools.doclint.DocLint.BadArgs; //导入依赖的package包/类
void testRun() throws BadArgs, IOException {
System.err.println("test run(String[])");
DocLint dl = new DocLint();
String[] args = { "-help" };
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
PrintStream prev = System.out;
try {
System.setOut(ps);
dl.run(args);
} finally {
System.setOut(prev);
}
ps.close();
String stdout = baos.toString();
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
dl.run(pw, args);
pw.close();
String direct = sw.toString();
if (!stdout.equals(direct)) {
error("unexpected output");
System.err.println("EXPECT>>" + direct + "<<");
System.err.println("FOUND>>" + stdout + "<<");
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:RunTest.java
示例5: doclint
import com.sun.tools.doclint.DocLint.BadArgs; //导入依赖的package包/类
String doclint(String... args) throws BadArgs, IOException {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
DocLint dl = new DocLint();
dl.run(pw, args);
pw.close();
String out = sw.toString();
if (!out.isEmpty())
System.err.println(out);
return out;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:PathsTest.java
示例6: check
import com.sun.tools.doclint.DocLint.BadArgs; //导入依赖的package包/类
void check(List<String> opts, List<File> files, boolean expectBadArgs, File refFile) throws Exception {
List<String> args = new ArrayList<String>();
args.addAll(opts);
for (File file: files)
args.add(file.getPath());
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
try {
new DocLint().run(pw, args.toArray(new String[args.size()]));
if (expectBadArgs)
error("expected exception not thrown");
} catch (BadArgs e) {
if (!expectBadArgs)
error("unexpected exception caught: " + e);
}
pw.flush();
String out = normalizeNewlines(removeFileNames(sw.toString())).trim();
if (out != null)
System.err.println("Output:\n" + out);
if (refFile == null) {
if (!out.isEmpty())
error("unexpected output");
} else {
String expect = readFile(refFile);
if (!expect.equals(out)) {
error("expected output not found");
System.err.println("EXPECT>>" + expect + "<<");
System.err.println(" FOUND>>" + out + "<<");
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:34,代码来源:DocLintTester.java
示例7: testMain
import com.sun.tools.doclint.DocLint.BadArgs; //导入依赖的package包/类
@Test
void testMain(PrintWriter pw) throws BadArgs, IOException {
String[] args = { "-Xmsgs", thisFile.getPath() };
DocLint d = new DocLint();
d.run(pw, args);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:RunTest.java
注:本文中的com.sun.tools.doclint.DocLint.BadArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论