use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testSchemaAwarenessForAttributes.
public void testSchemaAwarenessForAttributes() throws Exception {
// Bug 276134
URL fileURL = bundle.getEntry("/bugTestFiles/bug276134.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/bug276134.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
String xpath = "person/@dob eq xs:date('2006-12-10')";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testTypedValueEnhancement_primitiveTypes.
public void testTypedValueEnhancement_primitiveTypes() throws Exception {
// Bug 318313
URL fileURL = bundle.getEntry("/bugTestFiles/bug318313.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/bug318313.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
String xpath = "X gt 99";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testTypedValueEnhancement_BugUsingSeqIntoVariable_2.
public void testTypedValueEnhancement_BugUsingSeqIntoVariable_2() throws Exception {
// Bug 325262
setupDynamicContext(null);
ResultSequence rs = ResultSequenceFactory.create_new();
rs.add(new XSInteger(BigInteger.valueOf(2)));
rs.add(new XSInteger(BigInteger.valueOf(4)));
rs.add(new XSInteger(BigInteger.valueOf(6)));
setVariable("value", rs);
// test a
String xpath = "$value instance of xs:integer+";
compileXPath(xpath);
ResultSequence rsRes = evaluate(domDoc);
XSBoolean result = (XSBoolean) rsRes.get(0);
assertEquals("true", result.getStringValue());
// test b
xpath = "deep-equal($value, (2, 4, 6))";
compileXPath(xpath);
rsRes = evaluate(domDoc);
result = (XSBoolean) rsRes.get(0);
assertEquals("true", result.getStringValue());
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testAttrNode_Test1.
public void testAttrNode_Test1() throws Exception {
// Bug 298535
URL fileURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
String xpath = "Example/x[1]/@mesg instance of attribute()";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testAttrNode_Test2.
public void testAttrNode_Test2() throws Exception {
// Bug 298535
URL fileURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
String xpath = "Example/x[1]/@mesg instance of attribute(xx)";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("false", actual);
}
Aggregations