本文整理汇总了Java中com.intellij.testFramework.ParsingTestCase类的典型用法代码示例。如果您正苦于以下问题:Java ParsingTestCase类的具体用法?Java ParsingTestCase怎么用?Java ParsingTestCase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParsingTestCase类属于com.intellij.testFramework包,在下文中一共展示了ParsingTestCase类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doParseAllInPackageTest
import com.intellij.testFramework.ParsingTestCase; //导入依赖的package包/类
protected void doParseAllInPackageTest() {
LOG.info("Parsing files in the package: " + getMyTargetDirectoryPath());
System.out.println("Parsing files in the package: " + getMyTargetDirectoryPath());
for (PsiFile psiFile : myPsiFiles) {
LOG.info("File: " + psiFile.getName());
System.out.print("File: " + psiFile.getName());
try {
ParsingTestCase.doCheckResult(myTargetTestDataDir, psiFile, checkAllPsiRoots(),
psiFile.getVirtualFile().getNameWithoutExtension(), skipSpaces(), printRanges());
System.out.println(": Ok");
} catch (IOException e) {
System.out.println(": Parsing failed" + psiFile.getName());
e.printStackTrace();
}
}
}
示例2: testXmlDeclDtd
import com.intellij.testFramework.ParsingTestCase; //导入依赖的package包/类
public void testXmlDeclDtd() throws Exception {
PsiFile file = createFile("x.xml", "<!DOCTYPE name [\n" +
" <!ELEMENT name (" + marker+ "a b c d" + marker+ ")>\n" +
" <!ELEMENT name2 (" + marker+ "%entity;" + marker+ ")>\n" +
"]>\n" +
"<name></name>");
PsiDocumentManager documentManager = PsiDocumentManager.getInstance(getProject());
Document document = documentManager.getDocument(file);
removeGarbage(document);
documentManager.commitAllDocuments();
String myFullDataPath = getTestDataPath() + "psi/";
ParsingTestCase.doCheckResult(myFullDataPath, file, true, "testXmlDeclDtd", false, false);
}
示例3: doParseScriptInPackageTest
import com.intellij.testFramework.ParsingTestCase; //导入依赖的package包/类
protected void doParseScriptInPackageTest(String fileNameWithoutExtension) {
for (PsiFile psiFile : myPsiFiles) {
String dataName = psiFile.getVirtualFile().getNameWithoutExtension();
if (dataName.equals(fileNameWithoutExtension)) {
try {
ParsingTestCase.doCheckResult(myTargetTestDataDir, psiFile, checkAllPsiRoots(), dataName, skipSpaces(),
printRanges());
} catch (IOException e) {
System.out.println(": Parsing failed" + psiFile.getName());
e.printStackTrace();
}
}
}
}