Examples of XmlResponseParser


Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

  }

  public void testDynamicFieldBinding(){
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertArrayEquals(new String[]{"Mobile Store","iPod Store","CCTV Store"}, l.get(3).getAllSuppliers());
    Assert.assertTrue(l.get(3).supplier.containsKey("supplier_1"));
    Assert.assertTrue(l.get(3).supplier.containsKey("supplier_2"));
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

    start = System.currentTimeMillis();
    writerName = writerName.intern();
    for (int i=0; i<decIter; i++) {
      ResponseParser rp = null;
      if (writerName == "xml") {
        rp = new XMLResponseParser();
      } else if (writerName == "javabin") {
        rp = new BinaryResponseParser();
      } else {
        break;
      }
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

public class TestDocumentObjectBinder extends TestCase
{
  public void testSimple() throws Exception {
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = null;
    nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    SolrDocumentList solDocList = res.getResults();
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertEquals(solDocList.size(), l.size());
    Assert.assertEquals(solDocList.get(0).getFieldValue("features"), l.get(0).features);
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

  }

  public void testDynamicFieldBinding(){
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertArrayEquals(new String[]{"Mobile Store","iPod Store","CCTV Store"}, l.get(3).getAllSuppliers());
    Assert.assertTrue(l.get(3).supplier.containsKey("supplier_1"));
    Assert.assertTrue(l.get(3).supplier.containsKey("supplier_2"));
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

public class TestDocumentObjectBinder extends TestCase
{
  public void testSimple() throws Exception {
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = null;
    nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    SolrDocumentList solDocList = res.getResults();
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertEquals(solDocList.size(), l.size());
    Assert.assertEquals(solDocList.get(0).getFieldValue("features"), l.get(0).features);
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

* @since solr 1.3
*/
public class QueryResponseTest {
  @Test
  public void testDateFacets() throws Exception   {
    XMLResponseParser parser = new XMLResponseParser();
    FileReader in = new FileReader("sampleDateFacetResponse.xml");
    assertTrue("in is null and it shouldn't be", in != null);
    NamedList<Object> response = parser.processResponse(in);
    in.close();
   
    QueryResponse qr = new QueryResponse(response, null);
    Assert.assertNotNull(qr);
   
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new HttpSolrServer(httpSolrServerUrl, localClient);
    // For portability with older versions of Solr
    httpSolrServer.setParser(new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

      else
        localClient.getCredentialsProvider().setCredentials(AuthScope.ANY, credentials);
    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new ModifiedHttpSolrServer(httpSolrServerUrl, localClient, new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

    HttpClient localClient = clientBuilder.build();


    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    solrServer = new ModifiedHttpSolrServer(httpSolrServerUrl, localClient, new XMLResponseParser());
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

    start = System.currentTimeMillis();
    writerName = writerName.intern();
    for (int i=0; i<decIter; i++) {
      ResponseParser rp = null;
      if (writerName == "xml") {
        rp = new XMLResponseParser();
      } else if (writerName == "javabin") {
        rp = new BinaryResponseParser();
      } else {
        break;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.