Search in sources :

Example 1 with MockInspectionProfile

use of com.intellij.mock.MockInspectionProfile in project intellij-community by JetBrains.

the class DomHighlightingLiteTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myInspectionProfile = new MockInspectionProfile();
    myAnnotationsManager = new DomElementAnnotationsManagerImpl(getProject()) {

        @Override
        protected InspectionProfile getInspectionProfile(final DomFileElement fileElement) {
            return myInspectionProfile;
        }
    };
    final XmlFile file = createXmlFile("<a/>");
    final MockDomElement rootElement = new MockDomElement() {

        @Override
        @Nullable
        public XmlElement getXmlElement() {
            return getXmlTag();
        }

        @Override
        public XmlTag getXmlTag() {
            return file.getRootTag();
        }

        @NotNull
        @Override
        public Type getDomElementType() {
            return DomElement.class;
        }
    };
    myElement = new MockDomFileElement() {

        @Override
        @Nullable
        public XmlElement getXmlElement() {
            return file;
        }

        @Override
        @NotNull
        public XmlFile getFile() {
            return file;
        }

        @Override
        public DomElement getParent() {
            return null;
        }

        @Override
        @NotNull
        public DomElement getRootElement() {
            return rootElement;
        }

        @NotNull
        @Override
        public Class getRootElementClass() {
            return DomElement.class;
        }

        @Override
        public boolean isValid() {
            return true;
        }
    };
}
Also used : XmlFile(com.intellij.psi.xml.XmlFile) MockInspectionProfile(com.intellij.mock.MockInspectionProfile) InspectionProfile(com.intellij.codeInspection.InspectionProfile) NotNull(org.jetbrains.annotations.NotNull) MockInspectionProfile(com.intellij.mock.MockInspectionProfile) XmlElement(com.intellij.psi.xml.XmlElement) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

InspectionProfile (com.intellij.codeInspection.InspectionProfile)1 MockInspectionProfile (com.intellij.mock.MockInspectionProfile)1 XmlElement (com.intellij.psi.xml.XmlElement)1 XmlFile (com.intellij.psi.xml.XmlFile)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1