use of org.apache.solr.response.SolrQueryResponse in project lucene-solr by apache.
the class TestLazyCores method checkStatus.
// If ok==true, we shouldn't be seeing any failure cases.
// if ok==false, the core being examined should have a failure in the list.
private void checkStatus(CoreContainer cc, Boolean ok, String core) throws Exception {
SolrQueryResponse resp = new SolrQueryResponse();
final CoreAdminHandler admin = new CoreAdminHandler(cc);
admin.handleRequestBody(req(CoreAdminParams.ACTION, CoreAdminParams.CoreAdminAction.STATUS.toString(), CoreAdminParams.CORE, core), resp);
Map<String, Exception> failures = (Map<String, Exception>) resp.getValues().get("initFailures");
if (ok) {
if (failures.size() != 0) {
fail("Should have cleared the error, but there are failues " + failures.toString());
}
} else {
if (failures.size() == 0) {
fail("Should have had errors here but the status return has no failures!");
}
}
}
use of org.apache.solr.response.SolrQueryResponse in project lucene-solr by apache.
the class TestInitParams method testElevateExample.
public void testElevateExample() {
SolrRequestHandler handler = h.getCore().getRequestHandler("/elevate");
SolrQueryResponse rsp = new SolrQueryResponse();
handler.handleRequest(req("initArgs", "true"), rsp);
NamedList nl = (NamedList) rsp.getValues().get("initArgs");
NamedList def = (NamedList) nl.get(PluginInfo.DEFAULTS);
assertEquals("text", def.get("df"));
}
use of org.apache.solr.response.SolrQueryResponse in project lucene-solr by apache.
the class TestLazyCores method unloadViaAdmin.
private void unloadViaAdmin(CoreContainer cc, String name) throws Exception {
final CoreAdminHandler admin = new CoreAdminHandler(cc);
SolrQueryResponse resp = new SolrQueryResponse();
admin.handleRequestBody(req(CoreAdminParams.ACTION, CoreAdminParams.CoreAdminAction.UNLOAD.toString(), CoreAdminParams.CORE, name), resp);
}
use of org.apache.solr.response.SolrQueryResponse in project lucene-solr by apache.
the class TestLazyCores method createViaAdmin.
private void createViaAdmin(CoreContainer cc, String name, boolean isTransient, boolean loadOnStartup) throws Exception {
final CoreAdminHandler admin = new CoreAdminHandler(cc);
SolrQueryResponse resp = new SolrQueryResponse();
admin.handleRequestBody(req(CoreAdminParams.ACTION, CoreAdminParams.CoreAdminAction.CREATE.toString(), CoreAdminParams.NAME, name, CoreAdminParams.TRANSIENT, Boolean.toString(isTransient), CoreAdminParams.LOAD_ON_STARTUP, Boolean.toString(loadOnStartup)), resp);
}
use of org.apache.solr.response.SolrQueryResponse in project lucene-solr by apache.
the class TestInitParams method testArbitraryAttributes.
public void testArbitraryAttributes() {
SolrRequestHandler handler = h.getCore().getRequestHandler("/dump7");
SolrQueryResponse rsp = new SolrQueryResponse();
handler.handleRequest(req("initArgs", "true"), rsp);
NamedList nl = (NamedList) rsp.getValues().get("initArgs");
assertEquals("server-enabled.txt", nl.get("healthcheckFile"));
}
Aggregations