use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList in project webtools.sourceediting by eclipse.
the class ScannerUnitTests method testXMLDollarsign_Trailing.
public void testXMLDollarsign_Trailing() {
String text = "<a type=\" $\"/>";
IStructuredDocumentRegionList nodes = setUpXML(text);
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 6 });
assertTrue("IStructuredDocumentRegion and ITextRegion count", sizeCheck);
boolean typeCheck = checkSimpleRegionTypes(nodes.item(0).getRegions(), new String[] { DOMRegionContext.XML_TAG_OPEN, DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, DOMRegionContext.XML_EMPTY_TAG_CLOSE });
assertTrue("region context type check", typeCheck);
verifyLengths(0, nodes.item(0), text);
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList in project webtools.sourceediting by eclipse.
the class ScannerUnitTests method testJSPAmpersandInTagNameInAttValue.
public void testJSPAmpersandInTagNameInAttValue() {
String text = "<a href=\"<a&b>\"/>";
IStructuredDocumentRegionList nodes = setUpJSP(text);
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 7, 1 });
assertTrue("IStructuredDocumentRegion and ITextRegion count (tag)", sizeCheck);
// sizeCheck = checkSimpleRegionCount(((ITextRegionContainer) nodes.item(0).getRegions().get(4)), 4);
// assertTrue("IStructuredDocumentRegion and ITextRegion count (broken embedded tag)", sizeCheck);
boolean typeCheck = checkSimpleRegionTypes(nodes.item(0).getRegions(), new String[] { DOMRegionContext.XML_TAG_OPEN, DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_CLOSE });
assertTrue("region context type check (tag)", typeCheck);
// typeCheck = checkSimpleRegionTypes(((ITextRegionContainer) nodes.item(0).getRegions().get(4)).getRegions(), new String[]{DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE, DOMRegionContext.XML_TAG_OPEN, DOMRegionContext.XML_TAG_NAME, DOMRegionContext.UNDEFINED});
// assertTrue("region context type check (broken embedded tag)", typeCheck);
typeCheck = checkSimpleRegionTypes(nodes.item(1).getRegions(), new String[] { DOMRegionContext.XML_CONTENT });
assertTrue("region context type check (content)", typeCheck);
verifyLengths(0, nodes, text);
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList in project webtools.sourceediting by eclipse.
the class ScannerUnitTests method testDollarsign_Single.
public void testDollarsign_Single() {
IStructuredDocumentRegionList nodes = setUpJSP("<a type=\"$\"/>");
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 6 });
assertTrue("IStructuredDocumentRegion and ITextRegion count", sizeCheck);
boolean typeCheck = checkSimpleRegionTypes(nodes.item(0).getRegions(), new String[] { DOMRegionContext.XML_TAG_OPEN, DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, DOMRegionContext.XML_EMPTY_TAG_CLOSE });
assertTrue("region context type check", typeCheck);
verifyModelLength();
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList in project webtools.sourceediting by eclipse.
the class ScannerUnitTests method testJSP_PI.
public void testJSP_PI() {
String text = "begin <?php asda;lsgjalg;lasjlajglajslkajlgajsljgaljglaj?>end";
IStructuredDocumentRegionList nodes = setUpJSP(text);
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 1, 4, 1 });
assertTrue("IStructuredDocumentRegion and ITextRegion count", sizeCheck);
boolean typeCheck = checkSimpleRegionTypes(nodes.item(0).getRegions(), new String[] { DOMRegionContext.XML_CONTENT }) && checkSimpleRegionTypes(nodes.item(1).getRegions(), new String[] { DOMRegionContext.XML_PI_OPEN, DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_PI_CONTENT, DOMRegionContext.XML_PI_CLOSE }) && checkSimpleRegionTypes(nodes.item(2).getRegions(), new String[] { DOMRegionContext.XML_CONTENT });
assertTrue("region context type check", typeCheck);
verifyLengths(0, nodes.item(0), text);
}
use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList in project webtools.sourceediting by eclipse.
the class ScannerUnitTests method testELinTag.
public void testELinTag() {
String text = "<input type=\"button\" ${disabled? 'disabled=\"disabled\"':''}/>";
IStructuredDocumentRegionList nodes = setUpJSP(text);
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 7 });
assertTrue("IStructuredDocumentRegion and ITextRegion count", sizeCheck);
sizeCheck = checkSimpleRegionCount(((ITextRegionContainer) nodes.item(0).getRegions().get(5)), 9);
assertTrue("IStructuredDocumentRegion and ITextRegion count", sizeCheck);
boolean typeCheck = checkSimpleRegionTypes(nodes.item(0).getRegions(), new String[] { DOMRegionContext.XML_TAG_OPEN, DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_EMPTY_TAG_CLOSE });
assertTrue("region context type check", typeCheck);
typeCheck = checkSimpleRegionTypes(((ITextRegionContainer) nodes.item(0).getRegions().get(5)).getRegions(), new String[] { DOMJSPRegionContexts.JSP_EL_OPEN, DOMJSPRegionContexts.JSP_EL_CONTENT, DOMJSPRegionContexts.JSP_EL_SQUOTE, DOMJSPRegionContexts.JSP_EL_QUOTED_CONTENT, DOMJSPRegionContexts.JSP_EL_SQUOTE, DOMJSPRegionContexts.JSP_EL_CONTENT, DOMJSPRegionContexts.JSP_EL_SQUOTE, DOMJSPRegionContexts.JSP_EL_SQUOTE, DOMJSPRegionContexts.JSP_EL_CLOSE });
assertTrue("region context type check", typeCheck);
verifyLengths(0, nodes.item(0), text);
}
Aggregations