use of org.apache.solr.client.solrj.io.eval.StreamEvaluator in project lucene-solr by apache.
the class GreaterThanEvaluatorTest method gtDifferentTypes4.
@Test(expected = IOException.class)
public void gtDifferentTypes4() throws Exception {
StreamEvaluator evaluator = factory.constructEvaluator("gt(a,b)");
values.clear();
values.put("a", "true");
values.put("b", true);
evaluator.evaluate(new Tuple(values));
}
use of org.apache.solr.client.solrj.io.eval.StreamEvaluator in project lucene-solr by apache.
the class GreaterThanEvaluatorTest method gtDifferentTypes2.
@Test(expected = IOException.class)
public void gtDifferentTypes2() throws Exception {
StreamEvaluator evaluator = factory.constructEvaluator("gt(a,b)");
values.clear();
values.put("a", 1);
values.put("b", false);
evaluator.evaluate(new Tuple(values));
}
use of org.apache.solr.client.solrj.io.eval.StreamEvaluator in project lucene-solr by apache.
the class GreaterThanEvaluatorTest method gtDifferentTypes3.
@Test(expected = IOException.class)
public void gtDifferentTypes3() throws Exception {
StreamEvaluator evaluator = factory.constructEvaluator("gt(a,b)");
values.clear();
values.put("a", "1");
values.put("b", 1);
evaluator.evaluate(new Tuple(values));
}
use of org.apache.solr.client.solrj.io.eval.StreamEvaluator in project lucene-solr by apache.
the class HyperbolicCosineEvaluatorTest method test.
private void test(Double value) throws IOException {
StreamEvaluator evaluator = factory.constructEvaluator("cosh(a)");
values.clear();
values.put("a", value);
Object result = evaluator.evaluate(new Tuple(values));
if (null == value) {
Assert.assertNull(result);
} else {
Assert.assertTrue(result instanceof Double);
Assert.assertEquals(Math.cosh(value), result);
}
}
use of org.apache.solr.client.solrj.io.eval.StreamEvaluator in project lucene-solr by apache.
the class HyperbolicSineEvaluatorTest method test.
private void test(Double value) throws IOException {
StreamEvaluator evaluator = factory.constructEvaluator("sinh(a)");
values.clear();
values.put("a", value);
Object result = evaluator.evaluate(new Tuple(values));
if (null == value) {
Assert.assertNull(result);
} else {
Assert.assertTrue(result instanceof Double);
Assert.assertEquals(Math.sinh(value), result);
}
}
Aggregations