Package br.com.caelum.restfulie.opensearch

Examples of br.com.caelum.restfulie.opensearch.SearchDescription


    }
  }

  private Response search(String term, int page) {
    Response response = restfulie.at("http://localhost:3000/products/opensearch.xml").accept("application/opensearchdescription+xml").get();
    SearchDescription desc = response.getResource();
    response = desc.use("application/xml").with(queryFor(term)).and(page(page)).get();
    return response;
  }
View Full Code Here


    String xml = "<OpenSearchDescription>" +
            "<Tags></Tags>" +
             "</OpenSearchDescription>";
   
    //When
    SearchDescription desc = (SearchDescription) stream.fromXML(new StringReader(xml));
   
    //Then
    assertThat(desc.getTags().size(), is(equalTo(0)));
  }
View Full Code Here

    String xml = "<OpenSearchDescription>" +
            "<Tags>restfulie rest</Tags>" +
           "</OpenSearchDescription>";

    //When
    SearchDescription desc = (SearchDescription) stream.fromXML(new StringReader(xml));
   
    //Then
    assertThat(desc.getTags().size(), is(equalTo(2)));
    assertThat(desc.getTags().get(0), is(equalTo("restfulie")));
    assertThat(desc.getTags().get(1), is(equalTo("rest")));
  }
View Full Code Here

    String xml = "<OpenSearchDescription>" +
    "<Tags>restfulie      rest      http</Tags>" +
    "</OpenSearchDescription>";
   
    //When
    SearchDescription desc = (SearchDescription) stream.fromXML(new StringReader(xml));
   
    //Then
    assertThat(desc.getTags().size(), is(equalTo(3)));
    assertThat(desc.getTags().get(0), is(equalTo("restfulie")));
    assertThat(desc.getTags().get(1), is(equalTo("rest")));
    assertThat(desc.getTags().get(2), is(equalTo("http")));
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.restfulie.opensearch.SearchDescription

Copyright © 2018 www.massapicom. 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.