Package org.hibernate.search.testsupport.setup

Examples of org.hibernate.search.testsupport.setup.TransactionContextForTest.end()


    TransactionContextForTest tc = new TransactionContextForTest();

    doIndexWork( new A( 1, "Emmanuel" ), 1, sf, tc );

    tc.end();

    QueryParser parser = new QueryParser(
        TestConstants.getTargetLuceneVersion(),
        "name",
        TestConstants.standardAnalyzer
View Full Code Here


    tc = new TransactionContextForTest();

    doIndexWork( new B( 1, "Noel" ), 1, sf, tc );
    doIndexWork( new C( 1, "Vincent" ), 1, sf, tc );

    tc.end();

    luceneQuery = parser.parse( "Noel" );

    indexReader = sf.getIndexReaderAccessor().open( B.class );
    searcher = new IndexSearcher( indexReader );
View Full Code Here

          searchFactoryImplementor.addClasses( aClass );
          Object entity = aClass.getConstructor( Integer.class, String.class )
              .newInstance( i, "Emmanuel" + i );
          TransactionContextForTest context = new TransactionContextForTest();
          MutableFactoryTest.doIndexWork( entity, i, searchFactoryImplementor, context );
          context.end();

          EntityIndexBinding indexBindingForEntity = searchFactoryImplementor.getIndexBinding( aClass );
          assertNotNull( indexBindingForEntity );
          IndexManager[] indexManagers = indexBindingForEntity.getIndexManagers();
          assertEquals( 1, indexManagers.length );
View Full Code Here

    SearchFactoryImplementor searchFactory = sfHolder.getSearchFactory();
    Work work = new Work( log, log.timestamp, WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }

  private void deleteLog(long timestamp) {
    LogMessage log = new LogMessage();
    log.timestamp = timestamp;
View Full Code Here

    SearchFactoryImplementor searchFactory = sfHolder.getSearchFactory();
    Work work = new Work( LogMessage.class, log.timestamp, WorkType.DELETE );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }

  /**
   * A ShardIdentifierProvider suitable for the rotating - logs design
   * as described in this test.
View Full Code Here

        .property( "race", "dwarf" );

      Work work = new Work( holder, holder.id, WorkType.ADD, false );
      TransactionContextForTest tc = new TransactionContextForTest();
      searchFactory.getWorker().performWork( work, tc );
      tc.end();
    }

    QueryBuilder guestQueryBuilder = searchFactory.buildQueryBuilder().forEntity( DynamicIndexedValueHolder.class ).get();

    Query queryAllGuests = guestQueryBuilder.all().createQuery();
View Full Code Here

  private void storeObject(Object entity, Serializable id) {
    Work work = new Work( entity, id, WorkType.UPDATE, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }

  protected SearchFactoryImplementor initializeSearchFactory() {
    SearchConfigurationForTest cfg = new SearchConfigurationForTest()
      .addProperty( "hibernate.search.default.directory_provider", FileMonitoringDirectoryProvider.class.getName() )
View Full Code Here

    Foo foo = new Foo( 0l );

    Work work = new Work( foo, foo.getId(), WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }

  @Test
  public void testTypeIsSetForGetter() {
    SearchFactoryImplementor searchFactory = createSearchFactory( Bar.class );
View Full Code Here

    Bar bar = new Bar( 0l );

    Work work = new Work( bar, bar.getId(), WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }

  @Test
  public void testTypeIsSetForClass() {
    SearchFactoryImplementor searchFactory = createSearchFactory( Snafu.class );
View Full Code Here

    Snafu snafu = new Snafu( 0l );

    Work work = new Work( snafu, snafu.getId(), WorkType.ADD, false );
    TransactionContextForTest tc = new TransactionContextForTest();
    searchFactory.getWorker().performWork( work, tc );
    tc.end();
  }


  private SearchFactoryImplementor createSearchFactory(Class<?> clazz) {
    SearchConfigurationForTest configuration = new SearchConfigurationForTest()
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.