Map<String,String> m = new HashMap<String,String>();
m.put("f.field1.i", "1000");
m.put("s", "BBB");
m.put("ss", "SSS");
LocalSolrQueryRequest req = new LocalSolrQueryRequest(null,nl);
SolrParams p = req.getParams();
assertEquals(p.get("i"), "555");
assertEquals(p.getInt("i").intValue(), 555);
assertEquals(p.getInt("i",5), 555);
assertEquals(p.getInt("iii",5), 5);
assertEquals(p.getFieldParam("field1","i"), "555");
req.setParams(new DefaultSolrParams(p, new MapSolrParams(m)));
p = req.getParams();
assertEquals(req.getOriginalParams().get("s"), "bbb");
assertEquals(p.get("i"), "555");
assertEquals(p.getInt("i").intValue(), 555);
assertEquals(p.getInt("i",5), 555);
assertEquals(p.getInt("iii",5), 5);
assertEquals(p.getFieldParam("field1","i"), "1000");
assertEquals(p.get("s"), "bbb");
assertEquals(p.get("ss"), "SSS");
assertEquals(!!p.getBool("bt"), !p.getBool("bf"));
assertEquals(p.getBool("foo",true), true);
assertEquals(p.getBool("foo",false), false);
assertEquals(!!p.getBool("bt"), !p.getBool("bf"));
NamedList more = new NamedList();
more.add("s", "aaa");
more.add("s", "ccc");
more.add("ss","YYY");
more.add("xx","XXX");
p = new AppendedSolrParams(p, SolrParams.toSolrParams(more));
assertEquals(3, p.getParams("s").length);
assertEquals("bbb", p.getParams("s")[0]);
assertEquals("aaa", p.getParams("s")[1]);
assertEquals("ccc", p.getParams("s")[2]);
assertEquals(3, p.getParams("s").length);
assertEquals("SSS", p.get("ss"));
assertEquals("XXX", p.get("xx"));
req.close();
}