Package ch.entwine.weblounge.common.content

Examples of ch.entwine.weblounge.common.content.SearchQuery


   */
  @Test
  public void testGetWithCreationDate() throws Exception {
    populateIndex();
    Date date = WebloungeDateFormat.parseStatic("2009-01-07T20:05:41Z");
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE).withCreationDate(date);
    SearchResult result = idx.getByQuery(q);
    assertEquals(1, result.getDocumentCount());
    assertEquals(1, result.getDocumentCount());
  }
View Full Code Here


   */
  @Test
  public void testGetWithModifier() throws Exception {
    populateIndex();
    User amelie = new UserImpl("amelie");
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE).withModifier(amelie);
    SearchResult result = idx.getByQuery(q);
    assertEquals(pages.length, result.getDocumentCount());
    assertEquals(pages.length, result.getDocumentCount());
  }
View Full Code Here

   */
  @Test
  public void testGetWithModificationDate() throws Exception {
    populateIndex();
    Date date = WebloungeDateFormat.parseStatic("2009-02-18T22:06:40Z");
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE).withModificationDate(date);
    SearchResult result = idx.getByQuery(q);
    assertEquals(1, result.getDocumentCount());
    assertEquals(1, result.getDocumentCount());
  }
View Full Code Here

   * .
   */
  @Test
  public void testGetSortedByPublicationDate() throws Exception {
    populateIndex();
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE).sortByPublishingDate(Order.Descending);
    SearchResult result = idx.getByQuery(q);
    assertEquals(pages.length, result.getDocumentCount());
    assertEquals(pages.length, result.getDocumentCount());
  }
View Full Code Here

   */
  @Test
  public void testGetWithPublisher() throws Exception {
    populateIndex();
    User amelie = new UserImpl("amelie");
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE).withPublisher(amelie);
    SearchResult result = idx.getByQuery(q);
    assertEquals(1, result.getDocumentCount());
    assertEquals(1, result.getDocumentCount());
  }
View Full Code Here

   */
  @Test
  public void testGetWithPublishingDate() throws Exception {
    populateIndex();
    Date date = WebloungeDateFormat.parseStatic("2006-05-05T17:58:21Z");
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE).withPublishingDate(date);
    SearchResult result = idx.getByQuery(q);
    assertEquals(1, result.getDocumentCount());
    assertEquals(1, result.getDocumentCount());
  }
View Full Code Here

   * .
   */
  @Test
  public void testGetWithSubjects() throws Exception {
    populateIndex();
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE);
    String[] subjects = new String[] { "Other topic", "Topic a" };
    for (String subject : subjects)
      q.withSubject(subject);
    assertEquals(2, idx.getByQuery(q).getDocumentCount());
  }
View Full Code Here

   * .
   */
  @Test
  public void testGetWithAllSubjects() throws Exception {
    populateIndex();
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE);
    q.withSubjects(Quantifier.All, "Topic a", "This subject");
    assertEquals(1, idx.getByQuery(q).getDocumentCount());
  }
View Full Code Here

   * .
   */
  @Test
  public void testGetWithContent() throws Exception {
    populateIndex();
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE);
    q.withElement(elementId, elementValue);
    assertEquals(2, idx.getByQuery(q).getDocumentCount());
  }
View Full Code Here

   * .
   */
  @Test
  public void testGetWithProperty() throws Exception {
    populateIndex();
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE);
    q.withProperty("resourceid", imageid);
    assertEquals(1, idx.getByQuery(q).getDocumentCount());
  }
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.content.SearchQuery

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.