use of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList in project webtools.sourceediting by eclipse.
the class ScannerUnitTests method testJSPExpression.
/**
* Check JSP code sections between HTML content
*/
public void testJSPExpression() {
IStructuredDocumentRegionList nodes = setUpJSP("begin <%= \"Hello,World\" %> end");
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 1, 1, 1, 1, 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[] { DOMJSPRegionContexts.JSP_EXPRESSION_OPEN }) && checkSimpleRegionTypes(nodes.item(2).getRegions(), new String[] { DOMJSPRegionContexts.JSP_CONTENT }) && checkSimpleRegionTypes(nodes.item(3).getRegions(), new String[] { DOMJSPRegionContexts.JSP_CLOSE }) && checkSimpleRegionTypes(nodes.item(4).getRegions(), new String[] { DOMRegionContext.XML_CONTENT });
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 testNothinginBlockXML9.
public void testNothinginBlockXML9() {
String text = "<script>";
IStructuredDocumentRegionList nodes = setUpXML(text);
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 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);
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 testCommentEmbeddedCustomTag.
public void testCommentEmbeddedCustomTag() {
IStructuredDocumentRegionList nodes = setUpJSP("<!--<link HREF='<c:out value='localhost/file.css'/>'>--> Some text");
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 3, 1 });
assertTrue("IStructuredDocumentRegion and ITextRegion count", sizeCheck);
boolean typeCheck = checkSimpleRegionTypes(nodes.item(0).getRegions(), new String[] { DOMRegionContext.XML_COMMENT_OPEN, DOMRegionContext.XML_COMMENT_TEXT, DOMRegionContext.XML_COMMENT_CLOSE }) && checkSimpleRegionTypes(nodes.item(1).getRegions(), new String[] { DOMRegionContext.XML_CONTENT });
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_Leading.
public void testDollarsign_Leading() {
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 testVBLtolerance_transparency_Dquote.
public void testVBLtolerance_transparency_Dquote() {
String text = "<a type=\"#{out.foo}\"/>";
IStructuredDocumentRegionList nodes = setUpJSP(text);
boolean sizeCheck = checkSimpleRegionCounts(nodes, new int[] { 6 });
sizeCheck &= checkSimpleRegionCount(((ITextRegionContainer) nodes.item(0).getRegions().get(4)), 5);
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, DOMJSPRegionContexts.JSP_VBL_OPEN, DOMJSPRegionContexts.JSP_VBL_CONTENT, DOMJSPRegionContexts.JSP_VBL_CLOSE, DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE });
assertTrue("region context type check", typeCheck);
verifyLengths(0, nodes.item(0), text);
}
Aggregations