3939import javax .xml .transform .stream .StreamResult ;
4040import javax .xml .xpath .XPathExpressionException ;
4141
42+ import com .marklogic .client .row .*;
4243import com .marklogic .client .type .*;
4344import org .junit .AfterClass ;
4445import org .junit .BeforeClass ;
5859import com .marklogic .client .io .JacksonHandle ;
5960import com .marklogic .client .io .ReaderHandle ;
6061import com .marklogic .client .io .StringHandle ;
61- import com .marklogic .client .row .RawPlanDefinition ;
62- import com .marklogic .client .row .RowManager ;
6362import com .marklogic .client .row .RowManager .RowSetPart ;
6463import com .marklogic .client .row .RowManager .RowStructure ;
65- import com .marklogic .client .row .RowRecord ;
6664import com .marklogic .client .row .RowRecord .ColumnKind ;
67- import com .marklogic .client .row .RowSet ;
6865import com .marklogic .client .util .EditableNamespaceContext ;
6966
7067public class RowManagerTest {
@@ -1212,9 +1209,11 @@ public void testRawSQL() throws IOException {
12121209
12131210 RowManager rowMgr = Common .client .newRowManager ();
12141211
1215- testViewRows (rowMgr .resultRows (rowMgr .newRawSQLPlan (new StringHandle (plan ))));
1212+ RawPlan builtPlan = rowMgr .newRawSQLPlan (new StringHandle (plan ));
1213+ testViewRows (rowMgr .resultRows (builtPlan ));
12161214
1217- // TODO: test explain
1215+ String stringRoot = rowMgr .explain (builtPlan , new StringHandle ()).get ();
1216+ assertNotNull (new ObjectMapper ().readTree (stringRoot ));
12181217 }
12191218 @ Test
12201219 public void testRawSPARQLSelect () throws IOException {
@@ -1229,7 +1228,8 @@ public void testRawSPARQLSelect() throws IOException {
12291228
12301229 RowManager rowMgr = Common .client .newRowManager ();
12311230
1232- RowSet <RowRecord > rows = rowMgr .resultRows (rowMgr .newRawSPARQLSelectPlan (new StringHandle (plan )));
1231+ RawPlan builtPlan = rowMgr .newRawSPARQLSelectPlan (new StringHandle (plan ));
1232+ RowSet <RowRecord > rows = rowMgr .resultRows (builtPlan );
12331233
12341234 int rowNum = 0 ;
12351235 for (RowRecord row : rows ) {
@@ -1240,7 +1240,8 @@ public void testRawSPARQLSelect() throws IOException {
12401240 }
12411241 assertEquals ("unexpected count of result records" , 2 , rowNum );
12421242
1243- // TODO: test explain
1243+ String stringRoot = rowMgr .explain (builtPlan , new StringHandle ()).get ();
1244+ assertNotNull (new ObjectMapper ().readTree (stringRoot ));
12441245 }
12451246 @ Test
12461247 public void testRawQueryDSL () throws IOException {
@@ -1255,9 +1256,11 @@ public void testRawQueryDSL() throws IOException {
12551256
12561257 RowManager rowMgr = Common .client .newRowManager ();
12571258
1258- testViewRows (rowMgr .resultRows (rowMgr .newRawQueryDSLPlan (new StringHandle (plan ))));
1259+ RawPlan builtPlan = rowMgr .newRawQueryDSLPlan (new StringHandle (plan ));
1260+ testViewRows (rowMgr .resultRows (builtPlan ));
12591261
1260- // TODO: test explain
1262+ String stringRoot = rowMgr .explain (builtPlan , new StringHandle ()).get ();
1263+ assertNotNull (new ObjectMapper ().readTree (stringRoot ));
12611264 }
12621265 private void checkSingleRow (NodeList row , RowSetPart datatypeStyle ) {
12631266 assertEquals ("unexpected column count in XML" , 2 , row .getLength ());
0 commit comments