Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
300,800
void () { String lorem = new LoremGenerator().generate(10, false).toLowerCase(); List<String> wordsIn = StringUtil.getWordsIn(lorem); Sets.SetView<String> difference = Sets.difference(Sets.newHashSet(LoremGenerator.COMMON_P), Sets.newHashSet(wordsIn)); assertFalse(difference.isEmpty()); }
testCommonStart2
300,801
void (Editor editor, int... offsets) { final List<Caret> carets = editor.getCaretModel().getAllCarets(); assertEquals("Carets count mismatch", offsets.length, carets.size()); for (int i = 0; i < offsets.length; i++) { assertEquals("Position mismatch for caret " + i, offsets[i], carets.get(i).getOffset()); } }
assertCarets
300,802
void (Editor editor, int... expected) { EditorTestUtil.executeAction(editor, "EmmetPreviousEditPoint"); assertCarets(editor, expected); }
moveBackward
300,803
void (Editor editor, int... expected) { EditorTestUtil.executeAction(editor, "EmmetNextEditPoint"); assertCarets(editor, expected); }
moveForward
300,804
void () { myFixture.configureByText(HtmlFileType.INSTANCE, "<caret><a href=\"\">\n\t<b></b>\n\t\n</a>"); final Editor editor = myFixture.getEditor(); assertCarets(editor, 0); moveForward(editor, 9); // Moved caret into empty attribute moveForward(editor, 16); // Moved caret into <b> tag moveForward(editor, 22); // Moved caret into empty attribute moveForward(editor, 22); // No movement }
testForward
300,805
void () { myFixture.configureByText(HtmlFileType.INSTANCE, "<a href=\"\">\n\t<b></b>\n\t\n</a><caret>"); final Editor editor = myFixture.getEditor(); assertCarets(editor, editor.getDocument().getTextLength()); moveBackward(editor, 22); // Moved caret into empty line moveBackward(editor, 16); // Moved caret into <b> tag moveBackward(editor, 9); // Moved caret into empty attribute moveBackward(editor, 9); // No movement }
testBackward
300,806
void () { myFixture.configureByText(HtmlFileType.INSTANCE, "<caret><a>\n\t\n\t\n</a>"); final Editor editor = myFixture.getEditor(); assertCarets(editor, 0); moveForward(editor, 5); moveForward(editor, 7); }
testWhitespaceForward
300,807
void () { myFixture.configureByText(HtmlFileType.INSTANCE, "<a>\n\t\n\t\n</a><caret>"); final Editor editor = myFixture.getEditor(); assertCarets(editor, editor.getDocument().getTextLength()); moveBackward(editor, 7); moveBackward(editor, 5); }
testWhitespaceBackward
300,808
void () { myFixture.configureByText(HtmlFileType.INSTANCE, """ <ul> <li><caret><a href=""></a></li> <li><caret><a href=""></a></li> </ul> """); final Editor editor = myFixture.getEditor(); assertCarets(editor, 13, 42); moveForward(editor, 22, 51); moveForward(editor, 24, 53); moveForward(editor, 28, 57); moveForward(editor, 42, 57); moveForward(editor, 51, 57); moveForward(editor, 53, 57); moveForward(editor, 57); }
testMultiCursorForward
300,809
void () { myFixture.configureByText(HtmlFileType.INSTANCE, """ <ul> <li><a href=""></a><caret></li> <li><a href=""></a><caret></li> </ul> """); final Editor editor = myFixture.getEditor(); assertCarets(editor, 28, 57); moveBackward(editor, 24, 53); moveBackward(editor, 22, 51); moveBackward(editor, 13, 42); moveBackward(editor, 13, 28); moveBackward(editor, 13, 24); moveBackward(editor, 13, 22); moveBackward(editor, 13); }
testMultiCursorBackward
300,810
void () { String text = "<div id=\"idName\"></div>"; doFilterText(text, text + "\n<!-- /#idName -->"); }
testCommentTagWithId
300,811
void () { String text = "<div class=\"clName\"></div>"; doFilterText(text, text + "\n<!-- /.clName -->"); }
testCommentTagWithClass
300,812
void () { String text = "<div id=\"idName\" class=\"clName\"></div>"; doFilterText(text, text + "\n<!-- /#idName.clName -->"); }
testCommentTagWithIdAndClass
300,813
void () { String text = "<div></div>"; doFilterText(text, text); }
testDoNotCommentTagWithoutClassAndId
300,814
void () { expand("div.className|c"); checkResultByText("<div class=\"className\"></div>\n<!-- /.className -->"); }
testInvokeByPrefix
300,815
ZenCodingFilter () { return myFilter; }
getFilter
300,816
String () { return "html"; }
getExtension
300,817
Test () { return new BemEmmetFilterTest(); }
suite
300,818
void () { addTest(".b_m|bem", "<div class=\"b b_m\"></div>"); addTest(".b_m1._m2|bem", "<div class=\"b b_m1 b_m2\"></div>"); addTest(".b>._m|bem", "<div class=\"b\">\n\t<div class=\"b b_m\"></div>\n</div>"); addTest(".b>._m1>._m2|bem", "<div class=\"b\">\n\t<div class=\"b b_m1\">\n\t\t<div class=\"b b_m2\"></div>\n\t</div>\n</div>"); addTest(".b>.__e|bem", "<div class=\"b\">\n\t<div class=\"b__e\"></div>\n</div>"); addTest(".b>.-e|bem", "<div class=\"b\">\n\t<div class=\"b__e\"></div>\n</div>"); addTest(".b>.__e>.__e|bem", "<div class=\"b\">\n\t<div class=\"b__e\">\n\t\t<div class=\"b__e\"></div>\n\t</div>\n</div>"); addTest(".b>.__e1>.____e2|bem", "<div class=\"b\">\n\t<div class=\"b__e1\">\n\t\t<div class=\"b__e2\"></div>\n\t</div>\n</div>"); addTest(".b>.-e1>.-e2|bem", "<div class=\"b\">\n\t<div class=\"b__e1\">\n\t\t<div class=\"b__e2\"></div>\n\t</div>\n</div>"); addTest(".b1>.b2_m1>.__e1+.____e2_m2|bem", "<div class=\"b1\">\n\t<div class=\"b2 b2_m1\">\n\t\t<div class=\"b2__e1\"></div>\n\t\t<div class=\"b1__e2 b1__e2_m2\"></div>\n\t</div>\n</div>"); addTest(".b>.__e1>.__e2|bem", "<div class=\"b\">\n\t<div class=\"b__e1\">\n\t\t<div class=\"b__e2\"></div>\n\t</div>\n</div>"); addTest(".b>.__e1>.____e2|bem", "<div class=\"b\">\n\t<div class=\"b__e1\">\n\t\t<div class=\"b__e2\"></div>\n\t</div>\n</div>"); addTest(".b._mod|bem", "<div class=\"b b_mod\"></div>"); addTest("form.search-form._wide>input.-query-string+input:s.-btn_large|bem", "<form action=\"\" class=\"search-form search-form_wide\"><input type=\"text\" class=\"search-form__query-string\"><input\n" + " type=\"submit\" value=\"\" class=\"search-form__btn search-form__btn_large\"></form>"); addTest(".b1-div>.b2_m1>.-e1+.--e2_m2|bem", """ <div class="b1-div"> <div class="b2 b2_m1"> <div class="b2__e1"></div> <div class="b1-div__e2 b1-div__e2_m2"></div> </div> </div>"""); }
addBemTests
300,819
void () { addTest(".b_m1._m2|bem", "<div class=\"b b_m1 b_m2\"></div>"); addTest(".b._mod|bem", "<div class=\"b b_mod\"></div>"); }
addBem2Tests
300,820
void () { addTest(".name__name2__name3__name4|bem", "<div class=\"name__name2__name3__name4\"></div>"); addTest(".name__name2__name3|bem", "<div class=\"name__name2__name3\"></div>"); addTest(".news(.title.-title(.-text))|bem", """ <div class="news"> <div class="title news__title"> <div class="title__text"></div> </div> </div>"""); }
addRegressionTests
300,821
void () { addTest(".b9m|bem", "<div class=\"b b9m\"></div>", createBemTestInitializer("__", "9", "-"), "html"); addTest(".b9m|bem", "<div class=\"b9mb9m\"></div>", createBemTestInitializer("", "", ""), "html"); addTest(".b>.Ыe|bem", """ <div class="b"> <div class="bЫe"></div> </div>""", createBemTestInitializer("Ы", "_", "-"), "html"); }
addConfigurableTests
300,822
TestInitializer (String elementSeparator, String modifierSeparator, String shortPrefix) { return (fixture, testRootDisposable) -> { EmmetOptions options = EmmetOptions.getInstance(); String oldElementSeparator = options.getBemElementSeparator(); String oldModifierSeparator = options.getBemModifierSeparator(); String oldShortPrefix = options.getBemShortElementPrefix(); options.setBemElementSeparator(elementSeparator); options.setBemModifierSeparator(modifierSeparator); options.setBemShortElementPrefix(shortPrefix); Disposer.register(testRootDisposable, () -> { options.setBemElementSeparator(oldElementSeparator); options.setBemModifierSeparator(oldModifierSeparator); options.setBemShortElementPrefix(oldShortPrefix); }); }; }
createBemTestInitializer
300,823
void (String sourceData, String expectedData) { addTest(sourceData, expectedData, "html"); }
addTest
300,824
void () { expandAndCheck("div>p|s", "<div><p></p></div>"); }
testSingleLineFilter
300,825
void () { expandAndCheck("ul>li*4|s", "<ul><li></li><li></li><li></li><li></li></ul>"); }
testSingleLineFilter2
300,826
void () { expandAndCheck(".g>.gg>.ggg^^.gggg|s", "<div class=\"g\"><div class=\"gg\"><div class=\"ggg\"></div></div></div><div class=\"gggg\"></div>"); }
testSingleLineFilterWithClimbUpOperation
300,827
ZenCodingFilter () { return myFilter; }
getFilter
300,828
String () { return "html"; }
getExtension
300,829
void () { expandAndCheck("{1. test}|t", "test"); }
testTrimFilter1
300,830
void () { expandAndCheck("{ 1 test}|t", "test"); }
testTrimFilter2
300,831
void () { expandAndCheck("{ * test}|t", "test"); }
testTrimFilter3
300,832
void () { emmetWrap(""" 1. list item one 2. list item two 3. list item three""", "div*", """ <div>1. list item one</div> <div>2. list item two</div> <div>3. list item three</div>"""); emmetWrap(""" 1. list item one 2. list item two 3. list item three""", "div*|t", """ <div>list item one</div> <div>list item two</div> <div>list item three</div>"""); }
testTrimFilterWithWrapping
300,833
ZenCodingFilter () { return myFilter; }
getFilter
300,834
String () { return "html"; }
getExtension
300,835
void (String sourceData, String expectedData) { configureFromFileText("test." + getExtension(), sourceData); HashMap<String, String> attribute2value = new HashMap<>(); TemplateToken templateToken = new TemplateToken("div", attribute2value); templateToken.setTemplateText(sourceData, getFile()); XmlTag tag = templateToken.getXmlTag(); if (tag != null) { for (XmlAttribute attribute : tag.getAttributes()) { attribute2value.put(attribute.getName(), attribute.getValue()); } } String filteredData = getFilter().filterText(sourceData, templateToken); assertEquals(expectedData, filteredData); }
doFilterText
300,836
void () { String text = "<div id=\"&idName\"></div>"; doFilterText(text, "&lt;div id=\"&amp;idName\"&gt;&lt;/div&gt;"); }
testEscape
300,837
void () { String text = "<div id=\"&idName\"></div>"; String expectedText1 = "&lt;div id=\"&amp;idName\"&gt;&lt;/div&gt;"; doFilterText(text, expectedText1); doFilterText(expectedText1, "&amp;lt;div id=\"&amp;amp;idName\"&amp;gt;&amp;lt;/div&amp;gt;"); }
testDoubleEscape
300,838
void () { expandAndCheck("a>b|e", "&lt;a href=\"\"&gt;&lt;b&gt;&lt;/b&gt;&lt;/a&gt;"); }
testInvokeByPrefix
300,839
void () { expandAndCheck("a>b|e|e", "&amp;lt;a href=\"\"&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/a&amp;gt;"); }
testInvokeByDoublePrefix
300,840
ZenCodingFilter () { return myFilter; }
getFilter
300,841
String () { return "html"; }
getExtension
300,842
void () { expand("vare|xsl"); checkResultByText("<xsl:variable name=\"\" select=\"\"/>"); }
testXsl1
300,843
void () { expand("vare>p|xsl"); checkResultByText("<xsl:variable name=\"\">\n <p></p>\n</xsl:variable>"); }
testXsl2
300,844
ZenCodingFilter () { return myFilter; }
getFilter
300,845
String () { return "xsl"; //todo make xsl template available in xml with |xsl filter }
getExtension
300,846
void () { doTest("<<<", "html", "&lt;&lt;&lt;"); }
testSimpleHtml
300,847
void () { doTest(">>>", "xml", "&gt;&gt;&gt;"); }
testSimpleXml
300,848
void () { doTest(N_DASH, "html", "&ndash;"); }
testVeryWide
300,849
void () { doTest(COPY, "html", "&reg;"); }
testWide
300,850
void () { doTest("<a alt='" + N_DASH + "'></a>", "html", "<a alt='&ndash;'></a>"); }
testAttributeValue
300,851
void () { doTest("<a><</a>", "html", "<a>&lt;</a>"); }
testTag
300,852
void () { doTest("<<<", "xml", "&lt;&lt;&lt;"); }
testXmlStart
300,853
void () { doTest(""" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">""", "html", """ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"""); }
testDoctypeSystemPublic
300,854
void () { doTest(""" <component> amp & U+0026 (38) XML 1.0 ampersand </component>""", "xml", """ <component> amp &amp; U+0026 (38) XML 1.0 ampersand </component>"""); }
testXmlAmp
300,855
void () { doTest(""" <component> lt < U+003C (60) XML 1.0 less-than sign </component>""", "xml", """ <component> lt &lt; U+003C (60) XML 1.0 less-than sign </component>"""); }
testXmlLt
300,856
void () { doTest(""" <a><selection><</selection></a> <a><selection><</selection></a> <a><selection><</selection></a> """, "html", """ <a>&lt;</a> <a>&lt;</a> <a>&lt;</a> """); }
testMultiCaret
300,857
void (String text, final String extension, final String expected) { String finalText = !text.contains("<selection>") ? "<selection>" + text + "</selection>" : text; PlatformTestUtil.withEncoding("UTF-8", () -> { myFixture.configureByText(getTestName(true) + "." + extension, finalText); myFixture.performEditorAction("EscapeEntities"); myFixture.checkResult(expected); }); }
doTest
300,858
void () { WebEditorOptions.getInstance().setSelectWholeCssIdentifierOnDoubleClick(true); doTest(); }
testSelectClassNames
300,859
void () { WebEditorOptions.getInstance().setSelectWholeCssIdentifierOnDoubleClick(false); doTest(); }
testSelectClassNamesWithDisabledSelectSelectorOption
300,860
void () { doTest(); }
testSelectTag
300,861
void () { CodeInsightTestUtil.doWordSelectionTestOnDirectory(myFixture, getTestName(true), "html"); }
doTest
300,862
String () { return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/selectWord"; }
getTestDataPath
300,863
void (String contents) { init(contents, XmlFileType.INSTANCE); }
configureEditor
300,864
void () { handler.execute(getEditor(), null, null); }
run
300,865
String () { return "/mover"; }
getBasePath
300,866
String () { return PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData"; }
getTestDataPath
300,867
String () { return getFullRelativeTestName(".xml"); }
getFullRelativeTestName
300,868
String (String ext) { return BASE_PATH + getTestName(false) + ext; }
getFullRelativeTestName
300,869
boolean () { return myTestJustJaxpValidation; }
forceExternalValidation
300,870
void () { configureByFiles(null, BASE_PATH + getTestName(false) + ".xml", BASE_PATH + getTestName(false) + ".xsd"); final String url = "http://www.foo.org/schema"; ExternalResourceManagerExImpl.registerResourceTemporarily(url, getTestName(false) + ".xsd", getTestRootDisposable()); final String url2 = "http://www.bar.org/foo"; ExternalResourceManagerExImpl.registerResourceTemporarily(url2, getTestName(false) + ".xsd", getTestRootDisposable()); final Collection<HighlightInfo> infoCollection = doDoTest(true, false, true); final TextRange startTagNameRange = XmlTagUtil.getStartTagNameElement(((XmlFile)myFile).getDocument().getRootTag()).getTextRange(); HighlightInfo infoAtTagName = null; for(HighlightInfo info:infoCollection) { if (info.startOffset == startTagNameRange.getStartOffset() && info.endOffset == startTagNameRange.getEndOffset()) { if (info.getDescription() .equals("Attribute \"foo\" bound to namespace \"http://www.w3.org/2000/xmlns/\" was already specified for element \"root\".")) { infoAtTagName = info; break; } } } assertNotNull( infoAtTagName ); }
testduplicateAttribute2
300,871
void (@NotNull XmlAttributeValue value) { final PsiElement[] children = value.getChildren(); for (PsiElement child : children) { if (child instanceof XmlEntityRef) { PsiElement psiElement = child.getReferences()[0].resolve(); assertNotNull(psiElement); assertEquals(getTestName(false) + ".ent", psiElement.getContainingFile().getVirtualFile().getName()); assertTrue(((Navigatable)psiElement).canNavigate()); } } }
visitXmlAttributeValue
300,872
void (final @NotNull XmlAttribute attribute) { refs.add(attribute.getReference()); }
visitXmlAttribute
300,873
void (final @NotNull XmlTag tag) { refs.add(tag.getReference()); super.visitXmlTag(tag); }
visitXmlTag
300,874
void (final XmlTag tag, final String name, final List<? super PsiReference> refs) { if (tag.getAttributeValue(name) != null) { ContainerUtil.addAll(refs, tag.getAttribute(name, null).getValueElement().getReferences()); } }
addRefsInPresent
300,875
void () { final String testName = getTestName(false); doTestWithLocations( new String[][] { {"http://www.springframework.org/schema/beans",testName + ".xsd"}, {"http://www.springframework.org/schema/util",testName + "_2.xsd"} }, "xml" ); }
testComplexSchemaValidation11
300,876
void (String[] @Nullable [] resources, String ext) { doConfigureWithLocations(resources, ext); doDoTest(true,false); }
doTestWithLocations
300,877
void (final String[][] resources, final String ext) { String[] testNames = new String[(resources != null? resources.length:0) + 1]; testNames[0] = BASE_PATH + getTestName(false) + "." + ext; if (resources != null) { int curResource = 0; for(String[] resource:resources) { ExternalResourceManagerExImpl .registerResourceTemporarily(resource[0], getTestDataPath() + BASE_PATH + resource[1], getTestRootDisposable()); testNames[++curResource] = BASE_PATH + resource[1]; } } configureByFiles( null, testNames ); }
doConfigureWithLocations
300,878
void () { final String[][] resources = {{"http://www.test.com/test", getTestName(false) + ".dtd"}}; doConfigureWithLocations(resources, "xml"); doDoTest(true,true); WriteCommandAction.runWriteCommandAction(null, () -> myEditor.getDocument().insertString(myEditor.getDocument().getCharsSequence().toString().indexOf("?>") + 2, "\n")); doDoTest(true,true); }
testXercesCachingProblem
300,879
void () { doTestWithLocations(new String[][] { {"urn:test", getTestName(false) + "_2.xsd"} }, "xsd"); }
testComplexSchemaValidation13
300,880
void () { doTestWithLocations(new String[][]{{"parent", getTestName(false) + ".xsd"}}, "xml"); }
testComplexSchemaValidation14
300,881
void () { doTestWithLocations( new String[][] { {"http://www.linkedin.com/lispring", getTestName(false) + ".xsd"}, {"http://www.springframework.org/schema/beans", getTestName(false) + "_2.xsd"} }, "xml" ); }
testComplexSchemaValidation15
300,882
void () { doTestWithLocations( new String[][] { {"http://www.inversoft.com/schemas/savant-2.0/project", getTestName(false) + ".xsd"}, {"http://www.inversoft.com/schemas/savant-2.0/base", getTestName(false) + "_2.xsd"} }, "xml" ); }
testComplexSchemaValidation16
300,883
void () { doTestWithLocations( new String[][]{ {"urn:test", getTestName(false) + ".xsd"} }, "xml" ); }
testComplexSchemaValidation17
300,884
void () { String url = "antlib:org.apache.maven.artifact.ant"; enableInspectionTool(new AntResolveInspection()); doTestWithLocations(new String[][]{{url, getTestName(false) + ".xsd"}}, "xml"); }
testXercesMessagesBinding4
300,885
void (final @NotNull XmlAttribute attribute) { if (attribute.getDescriptor() != null) attrs.add(attribute); }
visitXmlAttribute
300,886
boolean () { return !methodOfTestHasAnnotation(getClass(), getTestName(false), HighlightingFlag.SkipExternalValidation) && super.doExternalValidation(); }
doExternalValidation
300,887
void (XmlTag tag,String schemaAttrName, String resolveFileName) { String attributeValue = tag.getAttributeValue(schemaAttrName); if (attributeValue != null) { XmlAttribute attribute = tag.getAttribute(schemaAttrName, null); PsiReference[] references = attribute.getValueElement().getReferences(); assertTrue( "There should resolvable reference to " + schemaAttrName, references.length > 0 ); for (PsiReference reference : references) { PsiElement element = reference.resolve(); if (element != null && element.getContainingFile().getName().equals(resolveFileName)) { return; } } assertTrue("There should resolvable reference to "+ schemaAttrName + ", 2", true); } }
checkOneTagForSchemaAttribute
300,888
void () { ExternalResourceManagerExImpl.registerResourceTemporarily("sample.dtd", getTestDataPath() + BASE_PATH + "sample.dtd", getTestRootDisposable()); configureByFiles(null, BASE_PATH + "sample.xml", BASE_PATH + "sample.dtd"); doDoTest(true, false); }
testDoctypeSystemConfigured
300,889
void () { configureByText(XmlFileType.INSTANCE, "<!DOCTYPE rules [\n" + IntStream.range(0, 10000).mapToObj(i -> "<!ENTITY pnct" + i + " \"x\">\n").collect(Collectors.joining()) + "]>\n" + "<rules/>"); PlatformTestUtil .startPerformanceTest("highlighting", 4_500, () -> doHighlighting()) .setup(() -> getPsiManager().dropPsiCaches()) .usesAllCPUCores() .assertTiming(); }
testBigPrologHighlightingPerformance
300,890
boolean (final Class testClass, final String testName, final HighlightingFlag flag) { Method method; try { method = testClass.getMethod("test" + testName); } catch (Exception e) { throw new RuntimeException(e); } final HighlightingFlags annotation = method.getAnnotation(HighlightingFlags.class); if (annotation != null) { final HighlightingFlag[] testOptions = annotation.value(); if (testOptions != null) { Arrays.sort(testOptions); return Arrays.binarySearch(testOptions, flag) >= 0; } } return false; }
methodOfTestHasAnnotation
300,891
void () { // 10 // 0123456789012 String text = "<html></html>"; EditorHighlighter xhtmlHighlighter = HighlighterFactory .createHighlighter(XHtmlFileType.INSTANCE, EditorColorsManager.getInstance().getGlobalScheme(), myProject); xhtmlHighlighter.setText(text); HighlighterIterator iterator = xhtmlHighlighter.createIterator(1); assertSame("Xml tag name", XmlTokenType.XML_TAG_NAME, iterator.getTokenType()); iterator = xhtmlHighlighter.createIterator(8); assertSame("Xml tag name at end of tag", XmlTokenType.XML_TAG_NAME, iterator.getTokenType()); }
testXHtmlEditorHighlighting
300,892
void () { // 10 20 // 012345678901234567890 123456 789 String text = "<!ENTITY % Charsets \"CDATA\">"; EditorHighlighter dtdHighlighter = HighlighterFactory.createHighlighter(DTDFileType.INSTANCE, EditorColorsManager.getInstance().getGlobalScheme(), myProject); dtdHighlighter.setText(text); HighlighterIterator iterator = dtdHighlighter.createIterator(3); assertSame("Xml entity name", XmlTokenType.XML_ENTITY_DECL_START, iterator.getTokenType()); iterator = dtdHighlighter.createIterator(13); assertSame("Xml name in dtd", XmlTokenType.XML_NAME, iterator.getTokenType()); iterator = dtdHighlighter.createIterator(23); assertSame("Xml attribute value in dtd", XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN, iterator.getTokenType()); // 10 20 30 40 // 0123456789012345678901 2345678901234567890123456789 text = "<!ELEMENT base EMPTY>\n<!ATTLIST base id ID #IMPLIED>"; dtdHighlighter.setText(text); iterator = dtdHighlighter.createIterator(3); assertSame("Xml element name", XmlTokenType.XML_ELEMENT_DECL_START, iterator.getTokenType()); iterator = dtdHighlighter.createIterator(25); assertSame("Xml attr list", XmlTokenType.XML_ATTLIST_DECL_START, iterator.getTokenType()); iterator = dtdHighlighter.createIterator(14); assertSame("Xml attr list", TokenType.WHITE_SPACE, iterator.getTokenType()); iterator = dtdHighlighter.createIterator(21); assertSame("Xml attr list", TokenType.WHITE_SPACE, iterator.getTokenType()); // 10 20 30 40 50 60 // 0123456789012345678901234567890123456789012345678901234567890123456789 text = "<![%sgml;[<![IGNORE[<![ INCLUDE [<!ENTITY % aaa SYSTEM 'zzz'>]]>]]>]]>"; dtdHighlighter.setText(text); iterator = dtdHighlighter.createIterator(2); assertEquals("Xml conditional section start",XmlTokenType.XML_CONDITIONAL_SECTION_START,iterator.getTokenType()); iterator = dtdHighlighter.createIterator(67); assertEquals("Xml conditional section end",XmlTokenType.XML_CONDITIONAL_SECTION_END,iterator.getTokenType()); iterator = dtdHighlighter.createIterator(5); assertEquals("entity ref in conditional section",XmlTokenType.XML_ENTITY_REF_TOKEN,iterator.getTokenType()); iterator = dtdHighlighter.createIterator(15); assertEquals("ignore in conditional section",XmlTokenType.XML_CONDITIONAL_IGNORE,iterator.getTokenType()); iterator = dtdHighlighter.createIterator(27); assertEquals("include in conditional section",XmlTokenType.XML_CONDITIONAL_INCLUDE,iterator.getTokenType()); iterator = dtdHighlighter.createIterator(9); assertEquals("markup start in conditional section",XmlTokenType.XML_MARKUP_START,iterator.getTokenType()); iterator = dtdHighlighter.createIterator(33); assertEquals("entity decl start in conditional section",XmlTokenType.XML_ENTITY_DECL_START,iterator.getTokenType()); // 10 20 30 40 50 60 70 // 012345678901234567890123 456789 0 123456789012345678901234567890123456 7890123456789 text = "<!ENTITY % ContentType \"CDATA\"\n -- media type, as per [RFC2045]\n -- --xxx-->"; dtdHighlighter.setText(text); iterator = dtdHighlighter.createIterator(35); assertEquals("Dtd comment start",XmlTokenType.XML_COMMENT_START,iterator.getTokenType()); iterator = dtdHighlighter.createIterator(40); assertEquals("Dtd comment content",XmlTokenType.XML_COMMENT_CHARACTERS,iterator.getTokenType()); iterator = dtdHighlighter.createIterator(71); assertEquals("Dtd comment end",XmlTokenType.XML_COMMENT_END,iterator.getTokenType()); iterator = dtdHighlighter.createIterator(78); assertEquals("Dtd comment content",XmlTokenType.XML_COMMENT_CHARACTERS,iterator.getTokenType()); }
testDTDEditorHighlighting
300,893
void () { final String testName = getTestName(false); configureByFiles( null, BASE_PATH + testName +".xsd", BASE_PATH +testName +"2.xsd" ); doDoTest(true, false, true); }
testImportProblems
300,894
void () { doTestWithLocations(new String[][]{{"http://www.springframework.org/schema/beans", "ComplexSchemaValidation11.xsd"}}, "xsd"); }
testSchemaImportHighlightingAndResolve
300,895
void () { doTestWithLocations( new String[][] { {"http://docbook.org/ns/docbook", "DocBookV5.xsd"}, {"http://www.w3.org/1999/xlink", "xlink.xsd"}, {"http://www.w3.org/XML/1998/namespace", "xml.xsd"} }, "xml" ); doTestWithLocations( new String[][] { {"http://www.w3.org/1999/xlink", "xlink.xsd"}, {"http://www.w3.org/XML/1998/namespace", "xml.xsd"} }, "xsd" ); }
testDocBookV5
300,896
void () { doTestWithLocations( new String[][] { {"http://docbook.org/ns/docbook", "DocBookV5.xsd"}, {"http://www.w3.org/1999/xlink", "xlink.xsd"}, {"http://www.w3.org/XML/1998/namespace", "xml.xsd"} }, "xml" ); }
testDocBook5
300,897
void () { doTestWithLocations( new String[][] { {"http://docbook.org/ns/docbook", "DocBookV5.xsd"}, {"http://www.w3.org/1999/xlink", "xlink.xsd"}, {"http://www.w3.org/XML/1998/namespace", "xml.xsd"} }, "xml" ); }
testDocBookRole
300,898
Collection<HighlightInfo> (final Collection<HighlightInfo> highlightInfos) { highlightInfos.removeIf(highlightInfo -> highlightInfo.getSeverity() == HighlightSeverity.INFORMATION); return highlightInfos; }
filterInfos
300,899
void () { doTestWithLocations(null, "xsd"); }
testUsingSchemaDtd