Skip to content

Commit 762689f

Browse files
committed
add more tests for type()
1 parent bbdb9a9 commit 762689f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/java/com/redislabs/modules/rejson/ClientTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
import static junit.framework.TestCase.*;
3838

39+
import java.util.List;
40+
3941
public class ClientTest {
4042

4143
/* A simple class that represents an object in real life */
@@ -51,9 +53,17 @@ public IRLObject() {
5153

5254
private static class FooBarObject {
5355
public String foo;
56+
public boolean fooB;
57+
public int fooI;
58+
public float fooF;
59+
public String[] fooArr;
5460

5561
public FooBarObject() {
5662
this.foo = "bar";
63+
this.fooB = true;
64+
this.fooI = 6574;
65+
this.fooF = 435.345f;
66+
this.fooArr = new String[]{"a", "b","c"};
5767
}
5868
}
5969

@@ -165,6 +175,10 @@ public void typeChecksShouldSucceed() throws Exception {
165175
assertSame(Object.class, client.type( "foobar"));
166176
assertSame(Object.class, client.type( "foobar", Path.ROOT_PATH));
167177
assertSame(String.class, client.type( "foobar", new Path(".foo")));
178+
assertSame(int.class, client.type( "foobar", new Path(".fooI")));
179+
assertSame(float.class, client.type( "foobar", new Path(".fooF")));
180+
assertSame(List.class, client.type( "foobar", new Path(".fooArr")));
181+
assertSame(boolean.class, client.type( "foobar", new Path(".fooB")));
168182
}
169183

170184
@Test(expected = Exception.class)

0 commit comments

Comments
 (0)