Package org.hibernate.search.test.util.progessmonitor

Examples of org.hibernate.search.test.util.progessmonitor.AssertingMassIndexerProgressMonitor


  }

  @Test
  public void testAllRelevantProgressMonitoringOperationsCalled() throws InterruptedException {
    // let mass indexer re-index the data in the db (created in initializeData())
    AssertingMassIndexerProgressMonitor monitor = new AssertingMassIndexerProgressMonitor( 10, 10 );
    fullTextSession.createIndexer( LegacyCar.class )
        .progressMonitor( monitor )
        .startAndWait();
    fullTextSession.createFullTextQuery( new MatchAllDocsQuery(), LegacyCar.class )
        .getResultSize();
    monitor.assertExpectedProgressMade();
  }
View Full Code Here


      targetMethod = "index",
      action = "throw new RuntimeException(\"Byteman said: Error in document creation!\")",
      name = "testErrorInBuildingLuceneDocumentGetsCaughtByErrorHandler")
  public void testErrorInBuildingLuceneDocumentGetsCaughtByErrorHandler() throws Exception {
    MockErrorHandler mockErrorHandler = getErrorHandlerAndAssertCorrectTypeIsUsed();
    AssertingMassIndexerProgressMonitor progressMonitor = new AssertingMassIndexerProgressMonitor( 0, 1 );

    indexSingleFooInstance();
    massIndexFooInstances( progressMonitor );

    String errorMessage = mockErrorHandler.getErrorMessage();
    Assert.assertTrue( "Wrong error code: " + errorMessage, errorMessage.startsWith( "HSEARCH000183" ) );
    Throwable exception = mockErrorHandler.getLastException();
    Assert.assertTrue( exception instanceof RuntimeException );
    Assert.assertEquals( "Byteman said: Error in document creation!", exception.getMessage() );
    progressMonitor.assertExpectedProgressMade();
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.test.util.progessmonitor.AssertingMassIndexerProgressMonitor

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.