Examples of synchronize()


Examples of net.sf.logsaw.index.IIndexService.synchronize()

    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResource("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.createIndex(getLogResource());
      indexService.synchronize(getLogResource(), null);
      assertTrue(IndexPlugin.getDefault().getIndexFile(getLogResource()).exists());
      assertEquals(5, indexService.count(getLogResource()));
      indexService.deleteIndex(getLogResource());
      assertTrue(!IndexPlugin.getDefault().getIndexFile(getLogResource()).exists());
    } catch (Exception e) {
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService.synchronize()

    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-cp1252.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      try {
        indexService.synchronize(getLogResource(), null);
        fail("Indexing should fail because of encoding");
      } catch (Exception e) {
        // nadda
      }
      createLogResourceWithPK("Cp1252", Locale.getDefault(), getTimeZone());
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService.synchronize()

        fail("Indexing should fail because of encoding");
      } catch (Exception e) {
        // nadda
      }
      createLogResourceWithPK("Cp1252", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      assertEquals(6, indexService.count(getLogResource()));
    } catch (Exception e) {
      getLogger().error(e.getLocalizedMessage(), e);
      fail("Exception should not occur: " + e.getLocalizedMessage());
    }
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService.synchronize()

  public void testTimeZone() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("server.10-11-09.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), TimeZone.getTimeZone("Europe/Berlin"));
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        ResultPage p = indexService.query(ctx, new LinkedList<ARestriction<?>>(), 0, 1000);
        assertEquals("2009-11-10T23:08:46.453", Log4JFieldProvider.FIELD_TIMESTAMP.toInputValue(
            p.getItems().get(0).get(Log4JFieldProvider.FIELD_TIMESTAMP), getLogResource()));
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService.synchronize()

  public void testTruncate() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      assertEquals(5, indexService.count(getLogResource()));
      indexService.truncate(getLogResource());
      assertEquals(0, indexService.count(getLogResource()));
    } catch (Exception e) {
      getLogger().error(e.getLocalizedMessage(), e);
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService.synchronize()

  public void testOverlappingNoContext() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      assertEquals(5, indexService.count(getLogResource()));
      loadLogFile("sample-2.log.xml");
      getLogResource().configure(SimpleLogResourceFactory.OPTION_LOGFILE, getLogFile().getPath());
      indexService.synchronize(getLogResource(), null);
      assertEquals(6, indexService.count(getLogResource()));
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService.synchronize()

      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      assertEquals(5, indexService.count(getLogResource()));
      loadLogFile("sample-2.log.xml");
      getLogResource().configure(SimpleLogResourceFactory.OPTION_LOGFILE, getLogFile().getPath());
      indexService.synchronize(getLogResource(), null);
      assertEquals(6, indexService.count(getLogResource()));
    } catch (Exception e) {
      getLogger().error(e.getLocalizedMessage(), e);
      fail("Exception should not occur: " + e.getLocalizedMessage());
    }
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService.synchronize()

  public void testOverlappingWithContext() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      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());
        loadLogFile("sample-2.log.xml");
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService.synchronize()

      try {
        ResultPage p = indexService.query(ctx, new LinkedList<ARestriction<?>>(), 0, 1000);
        assertEquals(5, p.getItems().size());
        loadLogFile("sample-2.log.xml");
        getLogResource().configure(SimpleLogResourceFactory.OPTION_LOGFILE, getLogFile().getPath());
        indexService.synchronize(getLogResource(), null);
        // additional entry is indexed, but the cached reader cannot see it
        p = indexService.query(ctx, new LinkedList<ARestriction<?>>(), 0, 1000);
        assertEquals(5, p.getItems().size());
      } finally {
        ctx.close();
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService.synchronize()

  public void testStopwords() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-stopwords.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      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"));
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.