Search in sources :

Example 6 with Foo

use of com.intellij.util.xml.stubs.model.Foo in project intellij-community by JetBrains.

the class DomStubUsingTest method testAccessingPsi.

public void testAccessingPsi() {
    DomFileElement<Foo> element = prepare("foo.xml", Foo.class);
    assertNotNull(element.getXmlElement());
    XmlTag tag = element.getRootTag();
    assertNotNull(tag);
    Foo foo = element.getRootElement();
    assertNotNull(foo.getXmlTag());
    Bar bar = foo.getBars().get(0);
    assertNotNull(bar.getXmlElement());
    XmlAttribute attribute = bar.getString().getXmlAttribute();
    assertNotNull(attribute);
}
Also used : Bar(com.intellij.util.xml.stubs.model.Bar) XmlAttribute(com.intellij.psi.xml.XmlAttribute) Foo(com.intellij.util.xml.stubs.model.Foo) XmlTag(com.intellij.psi.xml.XmlTag)

Example 7 with Foo

use of com.intellij.util.xml.stubs.model.Foo in project intellij-community by JetBrains.

the class DomStubUsingTest method testStubbedElementUndefineNotExisting.

public void testStubbedElementUndefineNotExisting() {
    final DomFileElement<Foo> fileElement = prepare("foo.xml", Foo.class);
    final Bar bar = fileElement.getRootElement().getBars().get(0);
    assertUndefine(bar);
}
Also used : Bar(com.intellij.util.xml.stubs.model.Bar) Foo(com.intellij.util.xml.stubs.model.Foo)

Example 8 with Foo

use of com.intellij.util.xml.stubs.model.Foo in project intellij-community by JetBrains.

the class DomStubUsingTest method testConverters.

public void testConverters() {
    DomFileElement<Foo> element = prepare("converters.xml", Foo.class);
    Bar bar = element.getRootElement().getBars().get(0);
    PsiClass value = bar.getClazz().getValue();
    assertNotNull(value);
    assertEquals("java.lang.String", value.getQualifiedName());
    assertFalse(element.getFile().getNode().isParsed());
}
Also used : Bar(com.intellij.util.xml.stubs.model.Bar) Foo(com.intellij.util.xml.stubs.model.Foo) PsiClass(com.intellij.psi.PsiClass)

Aggregations

Foo (com.intellij.util.xml.stubs.model.Foo)8 Bar (com.intellij.util.xml.stubs.model.Bar)6 PsiFile (com.intellij.psi.PsiFile)2 PsiClass (com.intellij.psi.PsiClass)1 PsiManagerEx (com.intellij.psi.impl.PsiManagerEx)1 XmlAttribute (com.intellij.psi.xml.XmlAttribute)1 XmlFile (com.intellij.psi.xml.XmlFile)1 XmlTag (com.intellij.psi.xml.XmlTag)1 NotStubbed (com.intellij.util.xml.stubs.model.NotStubbed)1