Examples of synchronize()


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

  public void testAfterQuery() {
    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 {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_TIMESTAMP,
            Operators.OPERATOR_AFTER, new Date(1248183796156L)));
View Full Code Here

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

  public void testLessThanQuery() {
    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 {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_LEVEL, Operators.OPERATOR_LESS_THAN,
            Log4JFieldProvider.FIELD_LEVEL.getLevelProvider().findLevel("warn")));
View Full Code Here

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

  public void testGreaterThanQuery() {
    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 {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_LEVEL, Operators.OPERATOR_GREATER_THAN,
            Log4JFieldProvider.FIELD_LEVEL.getLevelProvider().findLevel("info")));
View Full Code Here

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

  public void testEqualsQueryWithLevel() {
    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 {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_LEVEL, Operators.OPERATOR_EQUALS,
            Log4JFieldProvider.FIELD_LEVEL.getLevelProvider().findLevel("warn")));
View Full Code Here

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

  public void testNotEqualsQueryWithLevel() {
    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 {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_LEVEL, Operators.OPERATOR_NOT_EQUALS,
            Log4JFieldProvider.FIELD_LEVEL.getLevelProvider().findLevel("info")));
View Full Code Here

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

  public void testComplexQuery() {
    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 {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_TIMESTAMP,
            Operators.OPERATOR_AFTER, new Date(1248183795312L)));
View Full Code Here

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

  public void testCaseInsensitive() {
    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 {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_MESSAGE,
            Operators.OPERATOR_CONTAINS, "Recovery"));
View Full Code Here

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

      loadLogFile("no-timestamp.log.txt");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      APatternDialect dialect = (APatternDialect) getLogResource().getDialect();
      dialect.configure(APatternDialect.OPTION_PATTERN, "%p %t %c - %m%n");
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      SynchronizationResult result = indexService.synchronize(getLogResource(), null);
      assertEquals(15, result.getNumberOfEntriesAdded());
      assertEquals(15, indexService.count(getLogResource()));
      result = indexService.synchronize(getLogResource(), null);
      assertEquals(15, result.getNumberOfEntriesAdded());
      assertEquals(15, indexService.count(getLogResource()));
View Full Code Here

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

      dialect.configure(APatternDialect.OPTION_PATTERN, "%p %t %c - %m%n");
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      SynchronizationResult result = indexService.synchronize(getLogResource(), null);
      assertEquals(15, result.getNumberOfEntriesAdded());
      assertEquals(15, indexService.count(getLogResource()));
      result = indexService.synchronize(getLogResource(), null);
      assertEquals(15, result.getNumberOfEntriesAdded());
      assertEquals(15, 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 testPhrase() {
    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 {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_MESSAGE,
            Operators.OPERATOR_CONTAINS, "recovery manager"));
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.