use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean in project webtools.sourceediting by eclipse.
the class TestBugs method testDateConstructorBug.
public void testDateConstructorBug() throws Exception {
// Bug 274792
URL fileURL = bundle.getEntry("/bugTestFiles/bug274792.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = "xs:date(x) eq xs:date('2009-01-01')";
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 testElementTypedValue.
public void testElementTypedValue() throws Exception {
// test for fix in ElementType.java, involving incorrectly computing
// typed value of element node, in case of validating element node,
// with a user defined simple XSD type.
URL fileURL = bundle.getEntry("/bugTestFiles/elementTypedValueBug.xml");
URL schemaURL = bundle.getEntry("/bugTestFiles/elementTypedValueBug.xsd");
loadDOMDocument(fileURL, schemaURL);
// Get XSModel object for the Schema
XSModel schema = getGrammar(schemaURL);
setupDynamicContext(schema);
String xpath = "Example/Transportation/mode eq 'air'";
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 testIntegerDataTypeBug.
public void testIntegerDataTypeBug() throws Exception {
// Bug 274805
URL fileURL = bundle.getEntry("/bugTestFiles/bug274805.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = "xs:integer(x) gt 100";
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 testBug273795Arity3.
public void testBug273795Arity3() throws Exception {
// Bug 273795
URL fileURL = bundle.getEntry("/bugTestFiles/bug273795.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
// test with arity 3
String xpath = "substring(x, 3, 4) = 'happ'";
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 testStringLengthWithElementArg.
public void testStringLengthWithElementArg() throws Exception {
// Bug 273719
URL fileURL = bundle.getEntry("/bugTestFiles/bug273719.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
setupDynamicContext(schema);
String xpath = "string-length(x) > 2";
compileXPath(xpath);
ResultSequence rs = evaluate(domDoc);
XSBoolean result = (XSBoolean) rs.first();
String actual = result.getStringValue();
assertEquals("true", actual);
}
Aggregations