use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList in project webtools.sourceediting by eclipse.
the class ScannerUnitTests method testEmbeddedJSPDeclarationInCDATA.
public void testEmbeddedJSPDeclarationInCDATA() {
IStructuredDocumentRegionList nodes = setUpJSP("<![CDATA[<%!%>]]>");
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 3 });
assertTrue("IStructuredDocumentRegion and ITextRegion count", sizeCheck);
boolean typeCheck = checkComplexRegionTypes(nodes.item(0).getRegions(), new String[] { DOMRegionContext.XML_CDATA_OPEN, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_CDATA_CLOSE }, new String[][] { { DOMJSPRegionContexts.JSP_DECLARATION_OPEN, DOMJSPRegionContexts.JSP_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 testDollarsign_SingleWithSpaces.
public void testDollarsign_SingleWithSpaces() {
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 testXML_DHTMLimport.
public void testXML_DHTMLimport() {
String text = "<a> <?import type=\"foo\">";
IStructuredDocumentRegionList nodes = setUpXML(text);
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 3, 1, 3 });
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_CLOSE });
assertTrue("region context type check", typeCheck);
typeCheck = checkSimpleRegionTypes(nodes.item(1).getRegions(), new String[] { DOMRegionContext.XML_CONTENT });
assertTrue("region context type check", typeCheck);
typeCheck = checkSimpleRegionTypes(nodes.item(2).getRegions(), new String[] { DOMRegionContext.XML_PI_OPEN, DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_PI_CONTENT });
assertTrue("region context type check", 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 testELtolerance_transparency_DquoteWithSpaces.
public void testELtolerance_transparency_DquoteWithSpaces() {
// note: whitespace on either side returns a WHITE_SPACE context
IStructuredDocumentRegionList nodes = setUpJSP("<a type=\"_${out.foo}_\"/>");
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 6 });
sizeCheck &= checkSimpleRegionCount(((ITextRegionContainer) nodes.item(0).getRegions().get(4)), 7);
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 });
typeCheck &= checkSimpleRegionTypes(((ITextRegionContainer) nodes.item(0).getRegions().get(4)).getRegions(), new String[] { DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, DOMJSPRegionContexts.JSP_EL_OPEN, DOMJSPRegionContexts.JSP_EL_CONTENT, DOMJSPRegionContexts.JSP_EL_CLOSE, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE });
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 testComments_JSP.
/**
* Check comments between XML content
*/
public void testComments_JSP() {
String text = "a <!-- --><!----><%-- --%> b";
IStructuredDocumentRegionList nodes = setUpJSP(text);
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 1, 3, 2, 3, 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_COMMENT_OPEN, DOMRegionContext.XML_COMMENT_TEXT, DOMRegionContext.XML_COMMENT_CLOSE }) && checkSimpleRegionTypes(nodes.item(2).getRegions(), new String[] { DOMRegionContext.XML_COMMENT_OPEN, DOMRegionContext.XML_COMMENT_CLOSE }) && checkSimpleRegionTypes(nodes.item(3).getRegions(), new String[] { DOMJSPRegionContexts.JSP_COMMENT_OPEN, DOMJSPRegionContexts.JSP_COMMENT_TEXT, DOMJSPRegionContexts.JSP_COMMENT_CLOSE }) && checkSimpleRegionTypes(nodes.item(4).getRegions(), new String[] { DOMRegionContext.XML_CONTENT });
assertTrue("region context type check", typeCheck);
verifyLengths(0, nodes.item(0), text);
}
Aggregations