/** * Fluent setter for the format associated with this handle. * * This handle only supports XML. * * @param format The format, which must be Format.XML or an exception will be raised. * @return The QueryOptionsListHandle instance on which this method was called. */ public QueryOptionsListHandle withFormat(Format format) { setFormat(format); return this; }
@Test public void testInitialization() { new QueryOptionsListHandle().getValuesMap(); } }
validateClosingHandleClosesUnderlyingStream(new JDOMHandle(), "<xml/>"); validateClosingHandleClosesUnderlyingStream( new QueryOptionsListHandle(), "<query-options xmlns='http://marklogic.com/rest-api'/>"); validateClosingHandleClosesUnderlyingStream(new ReaderHandle(), "testing"); validateClosingHandleClosesUnderlyingStream(
QueryOptionsListHandle handle = stagingOptionsManager.optionsList(new QueryOptionsListHandle()); Map<String, String> optionsMap = handle.getValuesMap(); optionsMap.keySet().forEach( optionsName -> { QueryOptionsListHandle finalHandle = finalOptionsManager.optionsList(new QueryOptionsListHandle()); Map<String, String> finalOptionsMap = finalHandle.getValuesMap(); finalOptionsMap.keySet().forEach( optionsName -> {
@Test public void testNPE() throws KeyManagementException, NoSuchAlgorithmException, IOException, SAXException, ParserConfigurationException { System.out.println("Running testNPE"); // connect the client DatabaseClient client = getDatabaseClient("rest-admin", "x", getConnType()); QueryOptionsListHandle handle = new QueryOptionsListHandle(); Map map = handle.getValuesMap(); // release client client.release(); }
/** * Fluent setter for the format associated with this handle. * * This handle only supports XML. * * @param format The format, which must be Format.XML or an exception will be raised. * @return The QueryOptionsListHandle instance on which this method was called. */ public QueryOptionsListHandle withFormat(Format format) { setFormat(format); return this; }
public void serverOptionsList() throws IOException, ParserConfigurationException, SAXException { QueryManager queryMgr = Common.client.newQueryManager(); QueryOptionsListHandle results = queryMgr.optionsList(new QueryOptionsListHandle()); assertNotNull(results); Map<String,String> map = results.getValuesMap(); assertEquals("Map should contain two keys", map.size(), 2); assertEquals("photos should have this uri", map.get("photos"), "/v1/config/query/photos"); }