use of org.apache.solr.client.solrj.io.Tuple in project lucene-solr by apache.
the class FloorEvaluatorTest method floorNoValue.
@Test
public void floorNoValue() throws Exception {
StreamEvaluator evaluator = factory.constructEvaluator("floor(a)");
values.clear();
Object result = evaluator.evaluate(new Tuple(values));
assertNull(result);
}
use of org.apache.solr.client.solrj.io.Tuple in project lucene-solr by apache.
the class HyperbolicTangentEvaluatorTest method noValue.
@Test
public void noValue() throws Exception {
StreamEvaluator evaluator = factory.constructEvaluator("tanh(a)");
values.clear();
Object result = evaluator.evaluate(new Tuple(values));
assertNull(result);
}
use of org.apache.solr.client.solrj.io.Tuple in project lucene-solr by apache.
the class CubedRootEvaluatorTest method noValue.
@Test
public void noValue() throws Exception {
StreamEvaluator evaluator = factory.constructEvaluator("cbrt(a)");
values.clear();
Object result = evaluator.evaluate(new Tuple(values));
assertNull(result);
}
use of org.apache.solr.client.solrj.io.Tuple in project lucene-solr by apache.
the class DivideEvaluatorTest method divTwoFieldsWithValues.
@Test
public void divTwoFieldsWithValues() throws Exception {
StreamEvaluator evaluator = factory.constructEvaluator("div(a,b)");
Object result;
values.clear();
values.put("a", 1);
values.put("b", 2);
result = evaluator.evaluate(new Tuple(values));
Assert.assertTrue(result instanceof Double);
Assert.assertEquals(1.0 / 2, result);
values.clear();
values.put("a", 1.1);
values.put("b", 2);
result = evaluator.evaluate(new Tuple(values));
Assert.assertTrue(result instanceof Double);
Assert.assertEquals(1.1 / 2, result);
values.clear();
values.put("a", 1.1);
values.put("b", 2.1);
result = evaluator.evaluate(new Tuple(values));
Assert.assertTrue(result instanceof Double);
Assert.assertEquals(1.1 / 2.1, result);
}
use of org.apache.solr.client.solrj.io.Tuple in project lucene-solr by apache.
the class DivideEvaluatorTest method divTwoFieldsWithMissingNumerator.
@Test(expected = IOException.class)
public void divTwoFieldsWithMissingNumerator() throws Exception {
StreamEvaluator evaluator = factory.constructEvaluator("div(a,b)");
values.clear();
values.put("b", 1);
evaluator.evaluate(new Tuple(values));
}
Aggregations