1
1
package com .jayway .jsonpath ;
2
2
3
- import com .jayway .jsonpath .eval .Expression ;
3
+ import com .jayway .jsonpath .eval .ExpressionEvaluator ;
4
4
import org .junit .Test ;
5
5
6
6
import static org .junit .Assert .assertFalse ;
@@ -18,46 +18,46 @@ public class ExpressionEvalTest {
18
18
@ Test
19
19
public void long_eval () throws Exception {
20
20
21
- assertTrue (Expression .eval (1L , "=" , "1" ));
22
- assertTrue (Expression .eval (2L , "!=" , "1" ));
23
- assertTrue (Expression .eval (2L , ">" , "1" ));
24
- assertTrue (Expression .eval (2L , ">=" , "1" ));
25
- assertTrue (Expression .eval (2L , ">=" , "2" ));
26
- assertTrue (Expression .eval (1L , "<" , "2" ));
27
- assertTrue (Expression .eval (2L , "<=" , "2" ));
21
+ assertTrue (ExpressionEvaluator .eval (1L , "=" , "1" ));
22
+ assertTrue (ExpressionEvaluator .eval (2L , "!=" , "1" ));
23
+ assertTrue (ExpressionEvaluator .eval (2L , ">" , "1" ));
24
+ assertTrue (ExpressionEvaluator .eval (2L , ">=" , "1" ));
25
+ assertTrue (ExpressionEvaluator .eval (2L , ">=" , "2" ));
26
+ assertTrue (ExpressionEvaluator .eval (1L , "<" , "2" ));
27
+ assertTrue (ExpressionEvaluator .eval (2L , "<=" , "2" ));
28
28
29
- assertFalse (Expression .eval (1 , ">" , "2" ));
30
- assertFalse (Expression .eval (1 , ">=" , "2" ));
31
- assertFalse (Expression .eval (2 , "<" , "1" ));
32
- assertFalse (Expression .eval (2 , "<=" , "1" ));
33
- assertFalse (Expression .eval (1 , "=" , "2" ));
34
- assertFalse (Expression .eval (1 , "!=" , "1" ));
29
+ assertFalse (ExpressionEvaluator .eval (1 , ">" , "2" ));
30
+ assertFalse (ExpressionEvaluator .eval (1 , ">=" , "2" ));
31
+ assertFalse (ExpressionEvaluator .eval (2 , "<" , "1" ));
32
+ assertFalse (ExpressionEvaluator .eval (2 , "<=" , "1" ));
33
+ assertFalse (ExpressionEvaluator .eval (1 , "=" , "2" ));
34
+ assertFalse (ExpressionEvaluator .eval (1 , "!=" , "1" ));
35
35
}
36
36
37
37
@ Test
38
38
public void double_eval () throws Exception {
39
39
40
- assertTrue (Expression .eval (1D , "=" , "1" ));
41
- assertTrue (Expression .eval (2D , "!=" , "1" ));
42
- assertTrue (Expression .eval (2D , ">" , "1" ));
43
- assertTrue (Expression .eval (2D , ">=" , "1" ));
44
- assertTrue (Expression .eval (2D , ">=" , "2" ));
45
- assertTrue (Expression .eval (1D , "<" , "2" ));
46
- assertTrue (Expression .eval (2D , "<=" , "2" ));
40
+ assertTrue (ExpressionEvaluator .eval (1D , "=" , "1" ));
41
+ assertTrue (ExpressionEvaluator .eval (2D , "!=" , "1" ));
42
+ assertTrue (ExpressionEvaluator .eval (2D , ">" , "1" ));
43
+ assertTrue (ExpressionEvaluator .eval (2D , ">=" , "1" ));
44
+ assertTrue (ExpressionEvaluator .eval (2D , ">=" , "2" ));
45
+ assertTrue (ExpressionEvaluator .eval (1D , "<" , "2" ));
46
+ assertTrue (ExpressionEvaluator .eval (2D , "<=" , "2" ));
47
47
48
- assertFalse (Expression .eval (1D , ">" , "2" ));
49
- assertFalse (Expression .eval (1D , ">=" , "2" ));
50
- assertFalse (Expression .eval (2D , "<" , "1" ));
51
- assertFalse (Expression .eval (2D , "<=" , "1" ));
52
- assertFalse (Expression .eval (1D , "=" , "2" ));
53
- assertFalse (Expression .eval (1D , "!=" , "1" ));
48
+ assertFalse (ExpressionEvaluator .eval (1D , ">" , "2" ));
49
+ assertFalse (ExpressionEvaluator .eval (1D , ">=" , "2" ));
50
+ assertFalse (ExpressionEvaluator .eval (2D , "<" , "1" ));
51
+ assertFalse (ExpressionEvaluator .eval (2D , "<=" , "1" ));
52
+ assertFalse (ExpressionEvaluator .eval (1D , "=" , "2" ));
53
+ assertFalse (ExpressionEvaluator .eval (1D , "!=" , "1" ));
54
54
}
55
55
56
56
@ Test
57
57
public void string_eval () throws Exception {
58
58
59
- assertTrue (Expression .eval ("A" , "=" , "A" ));
60
- assertTrue (Expression .eval ("B" , "!=" , "A" ));
59
+ assertTrue (ExpressionEvaluator .eval ("A" , "=" , "A" ));
60
+ assertTrue (ExpressionEvaluator .eval ("B" , "!=" , "A" ));
61
61
62
62
}
63
63
0 commit comments