Skip to content

Commit 0a8d144

Browse files
author
Burak Serdar
committed
Add get metadata test
1 parent 282643b commit 0a8d144

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

metadata/src/test/java/com/redhat/lightblue/metadata/AbstractGetMetadataTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,19 @@ public void query_b_in_A() throws Exception {
120120
Assert.assertNull(a.getChildMetadata(new Path("obj1.c")));
121121
}
122122

123+
@Test
124+
public void query_b_project_c() throws Exception {
125+
EntityMetadata md = getMd("composite/A.json");
126+
GMD gmd = new GMD();
127+
gmd.add(query("{'field':'b.*.field1','op':'=','rvalue':'x'}"));
128+
gmd.add(projection("[{'field':'*'},{'field':'obj1.c'}]"));
129+
CompositeMetadata a = CompositeMetadata.buildCompositeMetadata(md, gmd);
130+
131+
System.out.println(a.toTreeString());
132+
Assert.assertNotNull(a.getChildMetadata(new Path("b")));
133+
Assert.assertNotNull(a.getChildMetadata(new Path("obj1.c")));
134+
}
135+
123136
@Test
124137
public void query_b_and_c_in_A() throws Exception {
125138
EntityMetadata md = getMd("composite/A.json");

0 commit comments

Comments
 (0)