use of org.apache.solr.request.SolrRequestHandler 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.request.SolrRequestHandler 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"));
}
use of org.apache.solr.request.SolrRequestHandler in project lucene-solr by apache.
the class TestInitParams method testMultiInitParams.
@Test
public void testMultiInitParams() {
SolrRequestHandler handler = h.getCore().getRequestHandler("/dump6");
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("A", def.get("a"));
assertEquals("P", def.get("p"));
def = (NamedList) nl.get(PluginInfo.INVARIANTS);
assertEquals("B", def.get("b"));
def = (NamedList) nl.get(PluginInfo.APPENDS);
assertEquals("C", def.get("c"));
}
use of org.apache.solr.request.SolrRequestHandler in project lucene-solr by apache.
the class TestInitParams method testComponentWithConflictingInitParams.
@Test
public void testComponentWithConflictingInitParams() {
SolrRequestHandler handler = h.getCore().getRequestHandler("/dump2");
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("A1", def.get("a"));
def = (NamedList) nl.get(PluginInfo.INVARIANTS);
assertEquals("B1", def.get("b"));
def = (NamedList) nl.get(PluginInfo.APPENDS);
assertEquals(Arrays.asList("C1", "C"), def.getAll("c"));
}
use of org.apache.solr.request.SolrRequestHandler in project lucene-solr by apache.
the class TolerantUpdateProcessorTest method update.
public String update(String chain, String xml) {
DirectSolrConnection connection = new DirectSolrConnection(h.getCore());
SolrRequestHandler handler = h.getCore().getRequestHandler("/update");
ModifiableSolrParams params = new ModifiableSolrParams();
params.add("update.chain", chain);
try {
return connection.request(handler, params, xml);
} catch (SolrException e) {
throw (SolrException) e;
} catch (Exception e) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
}
}
Aggregations