Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
303,000
void () { myElement.setFileDescription(new DomFileDescription<>(DomElement.class, "a")); assertInstanceOf(myAnnotationsManager.getMockInspection(myElement), MockAnnotatingDomInspection.class); }
testMockAnnotatingDomInspection
303,001
void () { myElement.setFileDescription(new MyNonHighlightingDomFileDescription()); myInspectionProfile.setInspectionTools(Collections.singletonList(new LocalInspectionToolWrapper(new MyDomElementsInspection()))); assertNull(myAnnotationsManager.getMockInspection(myElement)); }
testNoMockInspection
303,002
void () { final DefaultDomAnnotator annotator = new DefaultDomAnnotator() { @Override protected @NotNull DomElementAnnotationsManagerImpl getAnnotationsManager(final @NotNull Project project) { return myAnnotationsManager; } }; final StringBuilder s = new StringBuilder(); AnnotationSessionImpl.computeWithSession(myElement.getFile(), false, toFill -> { final MyDomElementsInspection inspection = new MyDomElementsInspection() { @Override public void checkFileElement(final @NotNull DomFileElement fileElement, final @NotNull DomElementAnnotationHolder holder) { s.append("visited"); } }; annotator.runInspection(inspection, myElement, toFill); assertEquals("visited", s.toString()); final DomElementsProblemsHolderImpl holder = assertNotEmptyHolder(myAnnotationsManager.getProblemHolder(myElement)); assertEmpty(toFill); annotator.runInspection(inspection, myElement, toFill); assertEquals("visited", s.toString()); assertSame(holder, assertNotEmptyHolder(myAnnotationsManager.getProblemHolder(myElement))); assertEmpty(toFill); return null; }); }
testDefaultAnnotator
303,003
DomElementAnnotationsManagerImpl (final @NotNull Project project) { return myAnnotationsManager; }
getAnnotationsManager
303,004
void (final @NotNull DomFileElement fileElement, final @NotNull DomElementAnnotationHolder holder) { s.append("visited"); }
checkFileElement
303,005
void () { myElement.setFileDescription(new MyNonHighlightingDomFileDescription()); assertEquals(DomHighlightStatus.NONE, myAnnotationsManager.getHighlightStatus(myElement)); myAnnotationsManager.appendProblems(myElement, createHolder(), MockDomInspection.getInspection()); assertEquals(DomHighlightStatus.INSPECTIONS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement)); }
testHighlightStatus_MockDomInspection
303,006
void () { myElement.setFileDescription(new DomFileDescription<>(DomElement.class, "a")); myAnnotationsManager.appendProblems(myElement, createHolder(), MockAnnotatingDomInspection.getInspection()); assertEquals(DomHighlightStatus.INSPECTIONS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement)); }
testHighlightStatus_MockAnnotatingDomInspection
303,007
void () { myElement.setFileDescription(new DomFileDescription<>(DomElement.class, "a")); final MyDomElementsInspection inspection = new MyDomElementsInspection() { @Override public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) { myAnnotationsManager.appendProblems(myElement, createHolder(), this.getClass()); return ProblemDescriptor.EMPTY_ARRAY; } @Override public void checkFileElement(final @NotNull DomFileElement fileElement, final @NotNull DomElementAnnotationHolder holder) { } }; registerInspectionKey(inspection); myInspectionProfile.setInspectionTools(Collections.singletonList(new LocalInspectionToolWrapper(inspection))); myAnnotationsManager.appendProblems(myElement, createHolder(), MockAnnotatingDomInspection.getInspection()); assertEquals(DomHighlightStatus.ANNOTATORS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement)); myAnnotationsManager.appendProblems(myElement, createHolder(), inspection.getClass()); assertEquals(DomHighlightStatus.INSPECTIONS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement)); }
testHighlightStatus_OtherInspections
303,008
ProblemDescriptor[] (@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) { myAnnotationsManager.appendProblems(myElement, createHolder(), this.getClass()); return ProblemDescriptor.EMPTY_ARRAY; }
checkFile
303,009
void (final @NotNull DomFileElement fileElement, final @NotNull DomElementAnnotationHolder holder) { }
checkFileElement
303,010
void (MyDomElementsInspection inspection) { final String shortName = inspection.getShortName(); HighlightDisplayKey.findOrRegister(shortName, shortName, inspection.getID()); }
registerInspectionKey
303,011
void () { myElement.setFileDescription(new DomFileDescription<>(DomElement.class, "a")); MyDomElementsInspection inspection = new MyDomElementsInspection() { @Override public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) { myAnnotationsManager.appendProblems(myElement, createHolder(), this.getClass()); return ProblemDescriptor.EMPTY_ARRAY; } @Override public void checkFileElement(final @NotNull DomFileElement fileElement, final @NotNull DomElementAnnotationHolder holder) { } }; registerInspectionKey(inspection); LocalInspectionToolWrapper toolWrapper = new LocalInspectionToolWrapper(inspection); myInspectionProfile.setInspectionTools(Collections.singletonList(toolWrapper)); myInspectionProfile.setEnabled(toolWrapper, false); myAnnotationsManager.appendProblems(myElement, createHolder(), MockAnnotatingDomInspection.getInspection()); assertEquals(DomHighlightStatus.INSPECTIONS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement)); }
testHighlightStatus_OtherInspections2
303,012
ProblemDescriptor[] (@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) { myAnnotationsManager.appendProblems(myElement, createHolder(), this.getClass()); return ProblemDescriptor.EMPTY_ARRAY; }
checkFile
303,013
void (final @NotNull DomFileElement fileElement, final @NotNull DomElementAnnotationHolder holder) { }
checkFileElement
303,014
void () { myElement.setFileDescription(new DomFileDescription<>(DomElement.class, "a")); final MyElement element = createElement("<a id />", MyElement.class); new MyBasicDomElementsInspection().checkDomElement(element.getId(), createHolder(), DomHighlightingHelperImpl.INSTANCE); }
testRequiredAttributeWithoutAttributeValue
303,015
String () { throw new UnsupportedOperationException("Method getGroupDisplayName is not yet implemented in " + getClass().getName()); }
getGroupDisplayName
303,016
String () { throw new UnsupportedOperationException("Method getDisplayName is not yet implemented in " + getClass().getName()); }
getDisplayName
303,017
String () { return "xxx"; }
getShortName
303,018
String () { throw new UnsupportedOperationException("Method getGroupDisplayName is not yet implemented in " + getClass().getName()); }
getGroupDisplayName
303,019
String () { throw new UnsupportedOperationException("Method getDisplayName is not yet implemented in " + getClass().getName()); }
getDisplayName
303,020
void (final @NotNull DomElement element, final @NotNull DomElementAnnotationHolder holder, final @NotNull DomHighlightingHelper helper) { super.checkDomElement(element, holder, helper); }
checkDomElement
303,021
String () { return "xxx"; }
getShortName
303,022
boolean () { return false; }
isAutomaticHighlightingEnabled
303,023
void () { assertEquals("aaa-bbb-ccc", DomNameStrategy.HYPHEN_STRATEGY.convertName("aaaBbbCcc")); assertEquals("aaa-bbb-ccc", DomNameStrategy.HYPHEN_STRATEGY.convertName("AaaBbbCcc")); assertEquals("aaa", DomNameStrategy.HYPHEN_STRATEGY.convertName("Aaa")); assertEquals("aaa", DomNameStrategy.HYPHEN_STRATEGY.convertName("aaa")); assertEquals("AAA-bbb", DomNameStrategy.HYPHEN_STRATEGY.convertName("AAABbb")); assertEquals("aaa-BBB", DomNameStrategy.HYPHEN_STRATEGY.convertName("AaaBBB")); }
testHyphenStrategy
303,024
void () { assertEquals("aaa bbb ccc", DomNameStrategy.HYPHEN_STRATEGY.splitIntoWords("aaa-bbb-ccc")); assertEquals("Aaa", DomNameStrategy.HYPHEN_STRATEGY.splitIntoWords("Aaa")); assertEquals("aaa", DomNameStrategy.HYPHEN_STRATEGY.splitIntoWords("aaa")); assertEquals("AAA bbb", DomNameStrategy.HYPHEN_STRATEGY.splitIntoWords("AAA-bbb")); assertEquals("aaa BBB", DomNameStrategy.HYPHEN_STRATEGY.splitIntoWords("aaa-BBB")); }
testHyphenStrategySplit
303,025
void () { assertEquals("aaaBbbCcc", DomNameStrategy.JAVA_STRATEGY.convertName("aaaBbbCcc")); assertEquals("aaaBbbCcc", DomNameStrategy.JAVA_STRATEGY.convertName("AaaBbbCcc")); assertEquals("aaa", DomNameStrategy.JAVA_STRATEGY.convertName("Aaa")); assertEquals("aaa", DomNameStrategy.JAVA_STRATEGY.convertName("aaa")); assertEquals("AAABbb", DomNameStrategy.JAVA_STRATEGY.convertName("AAABbb")); assertEquals("aaaBBB", DomNameStrategy.JAVA_STRATEGY.convertName("AaaBBB")); }
testJavaStrategy
303,026
void () { assertEquals("aaa bbb ccc", DomNameStrategy.JAVA_STRATEGY.splitIntoWords("aaaBbbCcc")); assertEquals("aaa", DomNameStrategy.JAVA_STRATEGY.splitIntoWords("Aaa")); assertEquals("aaa", DomNameStrategy.JAVA_STRATEGY.splitIntoWords("aaa")); assertEquals("AAA bbb", DomNameStrategy.JAVA_STRATEGY.splitIntoWords("AAABbb")); assertEquals("aaa BBB", DomNameStrategy.JAVA_STRATEGY.splitIntoWords("aaaBBB")); }
testJavaStrategySplit
303,027
DomManagerImpl () { return DomManagerImpl.getDomManager(getProject()); }
getDomManager
303,028
void () { final MyElement element = createElement("<a/>"); element.getXmlTag().setAttribute("attr", "foo"); putExpected(new DomEvent(element, false)); assertResultsAndClear(); assertTrue(element.getAttr().isValid()); element.getXmlTag().setAttribute("bttr", "foo"); element.getXmlTag().setAttribute("attr", "bar"); putExpected(new DomEvent(element, false)); putExpected(new DomEvent(element, false)); assertResultsAndClear(); assertTrue(element.getAttr().isValid()); element.getXmlTag().setAttribute("attr", null); putExpected(new DomEvent(element, false)); assertResultsAndClear(); assertTrue(element.getAttr().isValid()); }
testAttributeChange
303,029
void () { final MyElement element = createElement("<a attr=\"foo\"/>"); final GenericAttributeValue<String> attr = element.getAttr(); attr.getXmlAttributeValue().getFirstChild().replace(createTag("<a attr=\"bar\"/>").getAttribute("attr", null).getValueElement().getFirstChild()); putExpected(new DomEvent(element, false)); assertResultsAndClear(); assertTrue(attr.isValid()); }
testAttributeValueChangeAsXmlElementChange
303,030
void () { final MyElement element = createElement("<a><child> </child></a>").getChild(); element.getXmlTag().getValue().setText("abc"); putExpected(new DomEvent(element, false)); assertResultsAndClear(); element.getXmlTag().getValue().setText(null); putExpected(new DomEvent(element, false)); assertResultsAndClear(); }
testTagValueChange
303,031
void () { final MyElement element = createElement("<a xmlns=\"foo\"><ns-child attr=\"239\"/></a>" , MyElement.class); getDomManager().getDomFileDescription(element.getXmlElement()).registerNamespacePolicy("foo", "foo"); final GenericAttributeValue<String> attr = element.getNsChild().getAttr(); attr.getXmlTag().setAttribute("attr", "42"); putExpected(new DomEvent(element.getNsChild(), false)); assertResultsAndClear(); }
testAttrXmlEmptyUri
303,032
void () { MyElement element = createElement("<a><value>abc${prop}def</value></a>", MyElement.class); assertEquals("abc${prop}def", element.getValue().getStringValue()); assertEquals("abc${prop}def", element.getValue().getValue()); }
testBasic
303,033
void () { MyElement element = createElement("<a><value>abc${prop}def</value></a>", MyElement.class); registerInjectorFor(element, null); assertEquals("abcFOOdef", element.getValue().getStringValue()); assertEquals("abcFOOdef", element.getValue().getValue()); }
testWithInjector
303,034
void () { MyElement element = createElement("<a><value> abc${prop}def </value></a>", MyElement.class); registerInjectorFor(element, null); assertEquals("abcFOOdef", element.getValue().getStringValue()); assertEquals("abcFOOdef", element.getValue().getValue()); }
testCorrectlyCalculateOffsetWithInjector
303,035
void () { MyElement element = createElement("<a><converted-value>abc${prop}def</converted-value></a>", MyElement.class); registerInjectorFor(element, null); assertEquals("abcFOOdef", element.getConvertedValue().getStringValue()); assertEquals("abcBARdef", element.getConvertedValue().getValue()); }
testWithInjectorAndConverter
303,036
void () { String text = "<a><value>abc${prop}def</value></a>"; MyElement element = createElement(text, MyElement.class); MyPsiElement targetElement = new MyPsiElement(); registerInjectorFor(element, targetElement); assertEquals("abcFOOdef", element.getValue().getStringValue()); assertEquals("abcFOOdef", element.getValue().getValue()); assertReference(element.getValue(), targetElement, text.indexOf("${prop}") + 1); }
testReference
303,037
void () { String text = "<a attr=\"abc${prop}def\"/>"; MyElement element = createElement(text, MyElement.class); MyPsiElement targetElement = new MyPsiElement(); registerInjectorFor(element, targetElement); assertEquals("abcFOOdef", element.getAttr().getStringValue()); assertEquals("abcFOOdef", element.getAttr().getValue()); assertReference(element.getAttr(), targetElement, text.indexOf("${prop}") + 1); }
testAttribute
303,038
void (DomElement element, PsiElement targetElement) { DomUtil.getFileElement(element).getFileDescription().registerReferenceInjector(new MyInjector(targetElement)); }
registerInjectorFor
303,039
String (@Nullable @NonNls String s, ConvertContext context) { return s == null ? null : s.replaceAll("FOO", "BAR"); }
fromString
303,040
String (@Nullable String s, ConvertContext context) { return s; }
toString
303,041
Language () { throw new UnsupportedOperationException(); }
getLanguage
303,042
PsiManager () { throw new UnsupportedOperationException(); }
getManager
303,043
PsiElement () { throw new UnsupportedOperationException(); }
getParent
303,044
PsiElement () { throw new UnsupportedOperationException(); }
getFirstChild
303,045
PsiElement () { throw new UnsupportedOperationException(); }
getLastChild
303,046
PsiElement () { throw new UnsupportedOperationException(); }
getNextSibling
303,047
PsiElement () { throw new UnsupportedOperationException(); }
getPrevSibling
303,048
TextRange () { throw new UnsupportedOperationException(); }
getTextRange
303,049
int () { throw new UnsupportedOperationException(); }
getStartOffsetInParent
303,050
int () { throw new UnsupportedOperationException(); }
getTextLength
303,051
PsiElement (int offset) { throw new UnsupportedOperationException(); }
findElementAt
303,052
PsiReference (int offset) { throw new UnsupportedOperationException(); }
findReferenceAt
303,053
int () { throw new UnsupportedOperationException(); }
getTextOffset
303,054
String () { throw new UnsupportedOperationException(); }
getText
303,055
PsiElement () { throw new UnsupportedOperationException(); }
getNavigationElement
303,056
PsiElement () { throw new UnsupportedOperationException(); }
getOriginalElement
303,057
boolean (@NotNull @NonNls CharSequence text) { throw new UnsupportedOperationException(); }
textMatches
303,058
boolean (@NotNull PsiElement element) { throw new UnsupportedOperationException(); }
textMatches
303,059
boolean (char c) { throw new UnsupportedOperationException(); }
textContains
303,060
void (@NotNull PsiElementVisitor visitor) { throw new UnsupportedOperationException(); }
accept
303,061
void (@NotNull PsiElementVisitor visitor) { throw new UnsupportedOperationException(); }
acceptChildren
303,062
PsiElement () { throw new UnsupportedOperationException(); }
copy
303,063
boolean () { throw new UnsupportedOperationException(); }
isValid
303,064
boolean () { throw new UnsupportedOperationException(); }
isWritable
303,065
PsiReference () { throw new UnsupportedOperationException(); }
getReference
303,066
boolean (@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, @Nullable PsiElement lastParent, @NotNull PsiElement place) { throw new UnsupportedOperationException(); }
processDeclarations
303,067
PsiElement () { throw new UnsupportedOperationException(); }
getContext
303,068
boolean () { throw new UnsupportedOperationException(); }
isPhysical
303,069
GlobalSearchScope () { throw new UnsupportedOperationException(); }
getResolveScope
303,070
SearchScope () { throw new UnsupportedOperationException(); }
getUseScope
303,071
ASTNode () { throw new UnsupportedOperationException(); }
getNode
303,072
boolean (PsiElement another) { throw new UnsupportedOperationException(); }
isEquivalentTo
303,073
Icon (int flags) { throw new UnsupportedOperationException(); }
getIcon
303,074
PsiElement () { return element; }
getElement
303,075
TextRange () { return refRange; }
getRangeInElement
303,076
PsiElement () { return myMyTargetElement; }
resolve
303,077
String () { return prop; }
getCanonicalText
303,078
boolean (@NotNull PsiElement element) { return false; }
isReferenceTo
303,079
boolean () { return true; }
isSoft
303,080
String () { return myField; }
getField
303,081
void (final String field) { myField = field; }
setField
303,082
void () { getFoo(); }
method
303,083
String () { return myField; }
toString
303,084
void () { final BaseImpl proxy = AdvancedProxy.createProxy(BaseImpl.class, BaseIEx.class); assertEquals("a", proxy.sayA()); assertEquals("a", ((BaseI)proxy).sayA()); assertEquals("a", ((BaseIEx)proxy).sayA()); }
testAddInterfaces
303,085
String () { return "a"; }
sayA
303,086
void () { final AbstractBase.AbstractBaseImpl proxy = AdvancedProxy.createProxy(AbstractBase.AbstractBaseImpl.class, ArrayUtil.EMPTY_CLASS_ARRAY, new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object[] args) { return "a"; } }, false, ArrayUtilRt.EMPTY_OBJECT_ARRAY); assertEquals("a", proxy.sayA()); assertEquals("a", proxy.sayA()); assertEquals("a", ((BaseI)proxy).sayA()); }
testCovariantFromInterface
303,087
Object (Object proxy, Method method, Object[] args) { return "a"; }
invoke
303,088
Object () { return "beeee"; }
sayA
303,089
void () { final CovariantFromBaseClassTest.Impl proxy = AdvancedProxy.createProxy(CovariantFromBaseClassTest.Impl.class, ArrayUtil.EMPTY_CLASS_ARRAY, new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object[] args) { return "a"; } }, false, ArrayUtilRt.EMPTY_OBJECT_ARRAY); assertEquals("a", proxy.sayA()); assertEquals("a", ((CovariantFromBaseClassTest.Base)proxy).sayA()); assertEquals("a", ((CovariantFromBaseClassTest.Intf)proxy).sayA()); }
testCovariantFromBaseClass
303,090
Object (Object proxy, Method method, Object[] args) { return "a"; }
invoke
303,091
Object (Object proxy, Method method, Object[] args) { return 42; }
invoke
303,092
void () { DomFileElement<Foo> fileElement = prepare("foo.xml", Foo.class); PsiFile file = fileElement.getFile(); assertFalse(file.getNode().isParsed()); Foo foo = fileElement.getRootElement(); assertEquals("foo", foo.getId().getValue()); assertFalse(file.getNode().isParsed()); List<Bar> bars = foo.getBars(); assertFalse(file.getNode().isParsed()); final List<GenericDomValue<String>> listElements = foo.getLists(); final GenericDomValue<String> listElement0 = listElements.get(0); assertEquals("list0", listElement0.getValue()); final GenericDomValue<String> listElement1 = listElements.get(1); assertEquals("list1", listElement1.getValue()); assertFalse(file.getNode().isParsed()); assertEquals(2, bars.size()); Bar bar = bars.get(0); String value = bar.getString().getStringValue(); assertEquals("xxx", value); Object o = bar.getString().getValue(); assertEquals("xxx", o); Integer integer = bar.getInt().getValue(); assertEquals(666, integer.intValue()); assertFalse(file.getNode().isParsed()); Bar emptyBar = bars.get(1); GenericAttributeValue<String> string = emptyBar.getString(); assertNull(string.getXmlElement()); assertFalse(file.getNode().isParsed()); }
testFoo
303,093
void () { 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); }
testAccessingPsi
303,094
void () { 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()); }
testConverters
303,095
void () { DomFileElement<Foo> element = prepare("parent.xml", Foo.class); Bar bar = element.getRootElement().getBars().get(0); GenericAttributeValue<Integer> notStubbed = bar.getNotStubbed(); DomElement parent = notStubbed.getParent(); assertEquals(bar, parent); NotStubbed child = bar.getNotStubbeds().get(0); parent = child.getParent(); assertEquals(bar, parent); }
testParent
303,096
void () { DomFileElement<Foo> element = prepare("foo.xml", Foo.class); Foo foo = element.getRootElement(); List<Bar> bars = DomUtil.getChildrenOf(foo, Bar.class); assertEquals(2, bars.size()); }
testChildrenOfType
303,097
void () { XmlFile file = prepareFile("foo.xml"); ((PsiManagerEx)getPsiManager()).setAssertOnFileLoadingFilter(VirtualFileFilter.ALL, myFixture.getTestRootDisposable()); DomFileElement<Foo> element = DomManager.getDomManager(getProject()).getFileElement(file, Foo.class); assertNotNull(element); GenericDomValue<String> id = element.getRootElement().getId(); assertEquals("foo", id.getValue()); }
testFileLoading
303,098
void () { final DomFileElement<Foo> fileElement = prepare("foo.xml", Foo.class); final Bar bar = fileElement.getRootElement().getBars().get(0); assertUndefine(bar); }
testStubbedElementUndefineNotExisting
303,099
void () { final DomFileElement<Foo> fileElement = prepare("foo.xml", Foo.class); final DomElement rootElement = fileElement.getRootElement(); assertUndefine(rootElement); }
testRootElementUndefineNotExisting