use of com.intellij.xml.impl.dtd.XmlNSDescriptorImpl in project intellij-community by JetBrains.
the class XmlDtdTest method createDescriptor.
private static XmlNSDescriptor createDescriptor(String dtdText) {
PsiFile dtdFile = createLightFile("test.dtd", dtdText);
XmlNSDescriptorImpl descriptor = new XmlNSDescriptorImpl();
descriptor.init(dtdFile);
return descriptor;
}
use of com.intellij.xml.impl.dtd.XmlNSDescriptorImpl in project intellij-community by JetBrains.
the class DomPerformanceTest method testVisitorPerformance.
public void testVisitorPerformance() throws Throwable {
final MyElement element = createElement("<root xmlns=\"adsf\" targetNamespace=\"adsf\"/>", MyElement.class);
MetaRegistry.bindDataToElement(DomUtil.getFile(element).getDocument(), new XmlNSDescriptorImpl());
final MyElement child = element.addChildElement();
child.getAttr().setValue("239");
child.getChild239().getAttr().setValue("42");
child.getChild().getAttr().setValue("42xx");
child.getChild2().getAttr().setValue("42yy");
child.addChildElement().getChild().addFooChild().getAttr().setValue("xxx");
child.addChildElement().addFooChild().getAttr().setValue("yyy");
child.addChildElement().addFooChild().addBarChild().addBarChild().addChildElement().getChild().getAttr().setValue("xxx");
child.addChildElement().addBarComposite().setValue("ssss");
child.addBarChild().getChild2().getAttr().setValue("234178956023");
PlatformTestUtil.startPerformanceTest(getTestName(false), 80000, () -> ApplicationManager.getApplication().runWriteAction(() -> {
for (int i = 0; i < 239; i++) {
element.addChildElement().copyFrom(child);
}
})).cpuBound().attempts(1).useLegacyScaling().assertTiming();
final MyElement newElement = createElement(DomUtil.getFile(element).getText(), MyElement.class);
PlatformTestUtil.startPerformanceTest(getTestName(false), 300, new ThrowableRunnable() {
@Override
public void run() throws Exception {
newElement.acceptChildren(new DomElementVisitor() {
@Override
public void visitDomElement(DomElement element) {
element.acceptChildren(this);
}
});
}
}).cpuBound().useLegacyScaling().assertTiming();
}
use of com.intellij.xml.impl.dtd.XmlNSDescriptorImpl in project intellij-plugins by JetBrains.
the class FlexHighlightingTest method testAfterRename.
@JSTestOptions({ JSTestOption.WithFlexFacet, JSTestOption.WithGumboSdk })
@SuppressWarnings({ "ConstantConditions" })
public void testAfterRename() throws Exception {
configureByFile(getBasePath() + "/afterRename.xml");
XmlNSDescriptor nsDescriptor = ((XmlFile) getFile()).getDocument().getRootTagNSDescriptor();
assertTrue(nsDescriptor.toString(), nsDescriptor instanceof XmlNSDescriptorImpl);
doDoTest(true, true);
new RenameProcessor(getProject(), getFile(), "afterRename.mxml", false, false).run();
assertEquals("afterRename.mxml", getFile().getName());
assertFalse(myFile.isValid());
myFile = myPsiManager.findFile(getFile().getVirtualFile().getParent().findChild("afterRename.mxml"));
assertTrue(myFile.isValid());
nsDescriptor = ((XmlFile) getFile()).getDocument().getRootTagNSDescriptor();
assertTrue(nsDescriptor.toString(), nsDescriptor instanceof FlexMxmlNSDescriptor);
doDoTest(true, true);
}
Aggregations