FilterFunction_ceil ceil = (FilterFunction_ceil) ff.function("ceil",
org.opengis.filter.expression.Expression.NIL);
assertEquals("Name is, ", "ceil", ceil.getName());
assertEquals("Number of arguments, ", 1, ceil.getFunctionName().getArgumentCount());
Function ceilFunction = ff.function("ceil", literal_1);
double good0 = Math.ceil(1.0);
if (Double.isNaN(good0)) {
assertTrue("ceil of (1.0):", Double.isNaN(((Double) ceilFunction
.evaluate(null)).doubleValue()));
} else {
assertEquals("ceil of (1.0):", (double) Math.ceil(1.0),
((Double) ceilFunction.evaluate(null)).doubleValue(),
0.00001);
}
ceilFunction = ff.function("ceil", literal_m1);
double good1 = Math.ceil(-1.0);
if (Double.isNaN(good1)) {
assertTrue("ceil of (-1.0):", Double.isNaN(((Double) ceilFunction
.evaluate(null)).doubleValue()));
} else {
assertEquals("ceil of (-1.0):", (double) Math.ceil(-1.0),
((Double) ceilFunction.evaluate(null)).doubleValue(),
0.00001);
}
ceilFunction = ff.function("ceil", literal_2);
double good2 = Math.ceil(2.0);
if (Double.isNaN(good2)) {
assertTrue("ceil of (2.0):", Double.isNaN(((Double) ceilFunction
.evaluate(null)).doubleValue()));
} else {
assertEquals("ceil of (2.0):", (double) Math.ceil(2.0),
((Double) ceilFunction.evaluate(null)).doubleValue(),
0.00001);
}
ceilFunction = ff.function("ceil", literal_m2);
double good3 = Math.ceil(-2.0);
if (Double.isNaN(good3)) {
assertTrue("ceil of (-2.0):", Double.isNaN(((Double) ceilFunction
.evaluate(null)).doubleValue()));
} else {
assertEquals("ceil of (-2.0):", (double) Math.ceil(-2.0),
((Double) ceilFunction.evaluate(null)).doubleValue(),
0.00001);
}
ceilFunction = ff.function("ceil", literal_pi);
double good4 = Math.ceil(Math.PI);
if (Double.isNaN(good4)) {
assertTrue("ceil of (3.141592653589793):", Double
.isNaN(((Double) ceilFunction.evaluate(null))
.doubleValue()));
} else {
assertEquals("ceil of (3.141592653589793):", (double) Math
.ceil(3.141592653589793), ((Double) ceilFunction
.evaluate(null)).doubleValue(), 0.00001);
}
ceilFunction = ff.function("ceil", literal_05pi);
double good5 = Math.ceil(1.5707963267948966);
if (Double.isNaN(good5)) {
assertTrue("ceil of (1.5707963267948966):", Double
.isNaN(((Double) ceilFunction.evaluate(null))
.doubleValue()));
} else {
assertEquals("ceil of (1.5707963267948966):", (double) Math
.ceil(1.5707963267948966), ((Double) ceilFunction
.evaluate(null)).doubleValue(), 0.00001);
}
} catch (FactoryRegistryException e) {
e.printStackTrace();
fail("Unexpected exception: " + e.getMessage());