Ejemplo n.º 1
0
 /** Evaluate the function math:tan() with the argument math:pi() div 4. */
 @org.junit.Test
 public void mathTan006() {
   final XQuery query = new XQuery("math:tan(math:pi() div 4)", ctx);
   try {
     query.namespace("math", "http://www.w3.org/2005/xpath-functions/math");
     result = new QT3Result(query.value());
   } catch (final Throwable trw) {
     result = new QT3Result(trw);
   } finally {
     query.close();
   }
   test(assertEq("0.9999999999999999"));
 }
Ejemplo n.º 2
0
 /** Evaluate the function math:tan() with the argument xs:double('-INF'). */
 @org.junit.Test
 public void mathTan011() {
   final XQuery query = new XQuery("math:tan(xs:double('-INF'))", ctx);
   try {
     query.namespace("math", "http://www.w3.org/2005/xpath-functions/math");
     result = new QT3Result(query.value());
   } catch (final Throwable trw) {
     result = new QT3Result(trw);
   } finally {
     query.close();
   }
   test(assertStringValue(false, "NaN"));
 }
Ejemplo n.º 3
0
 /** Evaluate the function log() with the argument set to 1.0e-3. */
 @org.junit.Test
 public void mathLog004() {
   final XQuery query = new XQuery("math:log(1.0e-3)", ctx);
   try {
     query.namespace("math", "http://www.w3.org/2005/xpath-functions/math");
     result = new QT3Result(query.value());
   } catch (final Throwable trw) {
     result = new QT3Result(trw);
   } finally {
     query.close();
   }
   test(assertEq("-6.907755278982137e0"));
 }
Ejemplo n.º 4
0
 /** Evaluate the function log() with the argument set to 2. */
 @org.junit.Test
 public void mathLog005() {
   final XQuery query = new XQuery("math:log(2)", ctx);
   try {
     query.namespace("math", "http://www.w3.org/2005/xpath-functions/math");
     result = new QT3Result(query.value());
   } catch (final Throwable trw) {
     result = new QT3Result(trw);
   } finally {
     query.close();
   }
   test(assertEq("0.6931471805599453e0"));
 }
Ejemplo n.º 5
0
 /**
  * Evaluates the "function-arity" function with the argument refereing to a partial function
  * application..
  */
 @org.junit.Test
 public void fnFunctionArity021() {
   final XQuery query = new XQuery("fn:function-arity( math:pow(?, 10) )", ctx);
   try {
     query.namespace("math", "http://www.w3.org/2005/xpath-functions/math");
     result = new QT3Result(query.value());
   } catch (final Throwable trw) {
     result = new QT3Result(trw);
   } finally {
     query.close();
   }
   test(assertStringValue(false, "1"));
 }