Package net.sf.logsaw.index

Examples of net.sf.logsaw.index.ResultPage


      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_MESSAGE,
            Operators.OPERATOR_CONTAINS, "owner document not found"));
        ResultPage p = indexService.query(ctx, ops, 0, 1000);
        assertEquals(2, p.getItems().size());
        assertEquals(2, p.getTotalHits());
      } finally {
        ctx.close();
      }
    } catch (Exception e) {
      getLogger().error(e.getLocalizedMessage(), e);
View Full Code Here


      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        ResultPage p = indexService.query(ctx, new LinkedList<ARestriction<?>>(), 0, 1000);
        assertEquals(5, p.getItems().size());
        assertEquals(5, p.getTotalHits());
        assertEquals("Context.PROVIDER_URL in server jndi.properties, url=localhost:1099", p.getItems().get(0).get(Log4JFieldProvider.FIELD_MESSAGE));
        assertEquals("JBossTS Transaction Service (JTA version) - JBoss Inc.", p.getItems().get(1).get(Log4JFieldProvider.FIELD_MESSAGE));
        assertEquals("Setting up property manager MBean and JMX layer", p.getItems().get(2).get(Log4JFieldProvider.FIELD_MESSAGE));
        assertEquals("Starting recovery manager", p.getItems().get(3).get(Log4JFieldProvider.FIELD_MESSAGE));
        assertEquals("Recovery manager started", p.getItems().get(4).get(Log4JFieldProvider.FIELD_MESSAGE));
      } finally {
        ctx.close();
      }
    } catch (Exception e) {
      getLogger().error(e.getLocalizedMessage(), e);
View Full Code Here

TOP

Related Classes of net.sf.logsaw.index.ResultPage

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.