mirror of https://github.com/apache/lucene.git
SOLR-11485: Fix broken tests
This commit is contained in:
parent
f8c69270a1
commit
862f48761c
|
@ -107,7 +107,7 @@ public class AbsoluteValueEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("abs(a,b)");
|
factory.constructEvaluator("abs(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void absNoValue() throws Exception{
|
public void absNoValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("abs(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("abs(a)");
|
||||||
|
|
||||||
|
@ -115,7 +115,8 @@ public class AbsoluteValueEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void absNullValue() throws Exception{
|
public void absNullValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("abs(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("abs(a)");
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.solr.client.solrj.io.stream.eval;
|
package org.apache.solr.client.solrj.io.stream.eval;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -68,7 +69,7 @@ public class AddEvaluatorTest extends LuceneTestCase {
|
||||||
Assert.assertEquals(3.2D, result);
|
Assert.assertEquals(3.2D, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void addTwoFieldWithNulls() throws Exception{
|
public void addTwoFieldWithNulls() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("add(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("add(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
@ -78,7 +79,7 @@ public class AddEvaluatorTest extends LuceneTestCase {
|
||||||
Assert.assertNull(result);
|
Assert.assertNull(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void addTwoFieldsWithNull() throws Exception{
|
public void addTwoFieldsWithNull() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("add(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("add(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
@ -102,7 +103,7 @@ public class AddEvaluatorTest extends LuceneTestCase {
|
||||||
Assert.assertNull(result);
|
Assert.assertNull(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void addTwoFieldsWithMissingField() throws Exception{
|
public void addTwoFieldsWithMissingField() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("add(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("add(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
|
|
@ -76,15 +76,15 @@ public class ArcCosineEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("acos(a,b)");
|
factory.constructEvaluator("acos(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("acos(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("acos(a)");
|
||||||
|
|
||||||
values.clear();
|
values.clear();
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class ArcSineEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("asin(a,b)");
|
factory.constructEvaluator("asin(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("asin(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("asin(a)");
|
||||||
|
|
||||||
|
@ -84,7 +84,8 @@ public class ArcSineEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,15 +76,15 @@ public class ArcTangentEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("atan(a,b)");
|
factory.constructEvaluator("atan(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("atan(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("atan(a)");
|
||||||
|
|
||||||
values.clear();
|
values.clear();
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class CeilingEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("ceil(a,b)");
|
factory.constructEvaluator("ceil(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void ceilNoValue() throws Exception{
|
public void ceilNoValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("ceil(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("ceil(a)");
|
||||||
|
|
||||||
|
@ -84,7 +84,8 @@ public class CeilingEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void ceilNullValue() throws Exception{
|
public void ceilNullValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("ceil(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("ceil(a)");
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.solr.client.solrj.io.stream.eval;
|
package org.apache.solr.client.solrj.io.stream.eval;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -40,9 +41,9 @@ public class CoalesceEvaluatorTest extends LuceneTestCase {
|
||||||
.withFunctionName("coalesce", CoalesceEvaluator.class);
|
.withFunctionName("coalesce", CoalesceEvaluator.class);
|
||||||
values = new HashMap<String,Object>();
|
values = new HashMap<String,Object>();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void twoFieldsWithValues() throws Exception{
|
public void twoFieldsWithMissingField() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("coalesce(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("coalesce(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
|
||||||
|
@ -85,16 +86,16 @@ public class CoalesceEvaluatorTest extends LuceneTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void twoFieldsWithMissingField() throws Exception{
|
public void twoFieldsWithValues() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("coalesce(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("coalesce(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
|
||||||
values.clear();
|
values.clear();
|
||||||
result = evaluator.evaluate(new Tuple(values));
|
result = evaluator.evaluate(new Tuple(values));
|
||||||
Assert.assertNull(result);
|
Assert.assertNull(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void manyFieldsWithSubcoalesces() throws Exception{
|
public void manyFieldsWithSubcoalesces() throws Exception{
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class CosineEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("cos(a,b)");
|
factory.constructEvaluator("cos(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("cos(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("cos(a)");
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ public class CosineEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,15 +76,15 @@ public class CubedRootEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("cbrt(a,b)");
|
factory.constructEvaluator("cbrt(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("cbrt(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("cbrt(a)");
|
||||||
|
|
||||||
values.clear();
|
values.clear();
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,21 +76,19 @@ public class FloorEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("floor(a,b)");
|
factory.constructEvaluator("floor(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void floorNoValue() throws Exception{
|
public void floorNoValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("floor(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("floor(a)");
|
||||||
|
|
||||||
values.clear();
|
values.clear();
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
|
||||||
}
|
}
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void floorNullValue() throws Exception{
|
public void floorNullValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("floor(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("floor(a)");
|
||||||
|
|
||||||
values.clear();
|
values.clear();
|
||||||
values.put("a", null);
|
values.put("a", null);
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class HyperbolicCosineEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("cosh(a,b)");
|
factory.constructEvaluator("cosh(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("cosh(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("cosh(a)");
|
||||||
|
|
||||||
|
@ -84,7 +84,8 @@ public class HyperbolicCosineEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class HyperbolicSineEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("sinh(a,b)");
|
factory.constructEvaluator("sinh(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("sinh(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("sinh(a)");
|
||||||
|
|
||||||
|
@ -84,7 +84,8 @@ public class HyperbolicSineEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class HyperbolicTangentEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("tanh(a,b)");
|
factory.constructEvaluator("tanh(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("tanh(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("tanh(a)");
|
||||||
|
|
||||||
|
@ -84,7 +84,8 @@ public class HyperbolicTangentEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.solr.client.solrj.io.stream.eval;
|
package org.apache.solr.client.solrj.io.stream.eval;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -86,7 +87,7 @@ public class MultiplyEvaluatorTest extends LuceneTestCase {
|
||||||
Assert.assertEquals(6.5D, result);
|
Assert.assertEquals(6.5D, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void multTwoFieldWithNulls() throws Exception{
|
public void multTwoFieldWithNulls() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("mult(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("mult(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
@ -96,7 +97,7 @@ public class MultiplyEvaluatorTest extends LuceneTestCase {
|
||||||
Assert.assertNull(result);
|
Assert.assertNull(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void multTwoFieldsWithNull() throws Exception{
|
public void multTwoFieldsWithNull() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("mult(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("mult(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
@ -120,7 +121,7 @@ public class MultiplyEvaluatorTest extends LuceneTestCase {
|
||||||
Assert.assertNull(result);
|
Assert.assertNull(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void multTwoFieldsWithMissingField() throws Exception{
|
public void multTwoFieldsWithMissingField() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("mult(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("mult(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class NaturalLogEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("log(a,b)");
|
factory.constructEvaluator("log(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void logNoValue() throws Exception{
|
public void logNoValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("log(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("log(a)");
|
||||||
|
|
||||||
|
@ -86,7 +86,8 @@ public class NaturalLogEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void logNullValue() throws Exception{
|
public void logNullValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("log(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("log(a)");
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class PowerEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("pow(a)");
|
factory.constructEvaluator("pow(a)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void powTwoFieldWithNulls() throws Exception{
|
public void powTwoFieldWithNulls() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("pow(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("pow(a,b)");
|
||||||
|
|
||||||
|
|
|
@ -80,15 +80,15 @@ public class RoundEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("round(a,b)");
|
factory.constructEvaluator("round(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("round(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("round(a)");
|
||||||
|
|
||||||
values.clear();
|
values.clear();
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class SineEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("sin(a,b)");
|
factory.constructEvaluator("sin(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("sin(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("sin(a)");
|
||||||
|
|
||||||
|
@ -84,7 +84,8 @@ public class SineEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class SquareRootEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("sqrt(a,b)");
|
factory.constructEvaluator("sqrt(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("sqrt(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("sqrt(a)");
|
||||||
|
|
||||||
|
@ -84,7 +84,8 @@ public class SquareRootEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class SubtractEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("sub(a)");
|
factory.constructEvaluator("sub(a)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void subTwoFieldWithNulls() throws Exception{
|
public void subTwoFieldWithNulls() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("sub(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("sub(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
@ -84,7 +84,7 @@ public class SubtractEvaluatorTest extends LuceneTestCase {
|
||||||
Assert.assertNull(result);
|
Assert.assertNull(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void subTwoFieldsWithNull() throws Exception{
|
public void subTwoFieldsWithNull() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("sub(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("sub(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
@ -108,7 +108,7 @@ public class SubtractEvaluatorTest extends LuceneTestCase {
|
||||||
Assert.assertNull(result);
|
Assert.assertNull(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void subTwoFieldsWithMissingField() throws Exception{
|
public void subTwoFieldsWithMissingField() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("sub(a,b)");
|
StreamEvaluator evaluator = factory.constructEvaluator("sub(a,b)");
|
||||||
Object result;
|
Object result;
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class TangentEvaluatorTest extends LuceneTestCase {
|
||||||
factory.constructEvaluator("tan(a,b)");
|
factory.constructEvaluator("tan(a,b)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = IOException.class)
|
||||||
public void noValue() throws Exception{
|
public void noValue() throws Exception{
|
||||||
StreamEvaluator evaluator = factory.constructEvaluator("tan(a)");
|
StreamEvaluator evaluator = factory.constructEvaluator("tan(a)");
|
||||||
|
|
||||||
|
@ -84,7 +84,8 @@ public class TangentEvaluatorTest extends LuceneTestCase {
|
||||||
Object result = evaluator.evaluate(new Tuple(values));
|
Object result = evaluator.evaluate(new Tuple(values));
|
||||||
assertNull(result);
|
assertNull(result);
|
||||||
}
|
}
|
||||||
@Test
|
|
||||||
|
@Test(expected = IOException.class)
|
||||||
public void nullValue() throws Exception{
|
public void nullValue() throws Exception{
|
||||||
test(null);
|
test(null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,8 +157,6 @@ public class TemporalEvaluatorsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
values.clear();
|
values.clear();
|
||||||
values.put("a", null);
|
|
||||||
assertNull(evaluator.evaluate(new Tuple(values)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue