Package org.hibernate.search.test.util

Examples of org.hibernate.search.test.util.FullTextSessionBuilder.build()


        .setProperty( "hibernate.search.default.optimizer.implementation", LeakingOptimizer.class.getCanonicalName() )
        .addAnnotatedClass( Document.class );
    if ( !indexMetadataIsComplete ) {
      builder.setProperty( "hibernate.search.default.index_metadata_complete", "false" );
    }
    return builder.build();
  }

}
View Full Code Here


        .setProperty( "hibernate.search.default.worker.backend",
            LeakingLuceneBackend.class.getName() )
        .addAnnotatedClass( LocationGroup.class )
        .addAnnotatedClass( Location.class )
        .addLoadEventListener( loadCountListener );
    return builder.build();
  }

  /**
   * Initialize the test data.
   *
 
View Full Code Here

        .indexed();
    if ( withClassBridgeOnItem ) {
      itemMapping.classBridge( NoopClassBridge.class );
    }
    itemMapping.property( "catalogItems", ElementType.FIELD ).indexEmbedded().depth( depth );
    return builder.build();
  }

  private void initializeData(FullTextSessionBuilder fulltextSessionBuilder) {
    FullTextSession fullTextSession = fulltextSessionBuilder.openFullTextSession();
    try {
View Full Code Here

      fullTextSessionBuilder.setProperty( "hibernate.search.query.object_lookup_method", objectLookUpMethod );
    }
    if ( databaseRetrievalMethod != null ) {
      fullTextSessionBuilder.setProperty( "hibernate.search.query.database_retrieval_method", databaseRetrievalMethod );
    }
    return fullTextSessionBuilder.build();
  }

  private void indexTestData(FullTextSessionBuilder builder) {
    FullTextSession session = builder.openFullTextSession();
    Transaction transaction = session.beginTransaction();
View Full Code Here

          org.hibernate.search.infinispan.ClusterSharedConnectionProvider.class.getName()
          );
    for ( Class<?> entityType : entityTypes ) {
      node.addAnnotatedClass( entityType );
    }
    return node.build();
  }

  /**
   * Wait some time for the cluster to form
   */
 
View Full Code Here

    cfg.addAnnotatedClass( A.class );
    cfg.addAnnotatedClass( B.class );
    cfg.addAnnotatedClass( C.class );
    cfg.addAnnotatedClass( ReferencesIndexedEmbeddedA.class );
    cfg.addAnnotatedClass( DepthExceedsPathTestCase.class );
    cfg.build();
  }

}
View Full Code Here

    cfg.addAnnotatedClass( A.class );
    cfg.addAnnotatedClass( B.class );
    cfg.addAnnotatedClass( C.class );
    cfg.addAnnotatedClass( DeepPathSimpleTypeCase.class );
    try {
      cfg.build();
      fail( "Exception should have been thrown for DeepPathSimpleTypeCase having invalid path: b.c.dne" );
    }
    catch (SearchException se) {
      assertTrue( "Expected search exception to contain information about invalid path b.c.dne",
          se.getMessage().contains( "b.c.dne" ) );
View Full Code Here

    cfg.addAnnotatedClass( A.class );
    cfg.addAnnotatedClass( B.class );
    cfg.addAnnotatedClass( C.class );
    cfg.addAnnotatedClass( DeepPathWithLeadingPrefixCase.class );
    try {
      cfg.build();
      fail( "Exception should have been thrown for DeepPathWithLeadingPrefixCase having invalid path: b.c.dne" );
    }
    catch (SearchException se) {
      assertTrue( "Should contain information about invalid path b.c.dne (message: <" + se.getMessage() + ">)" ,
          se.getMessage().matches( ".*\\[b.c.dne\\].*" ) );
View Full Code Here

    cfg.addAnnotatedClass( A.class );
    cfg.addAnnotatedClass( B.class );
    cfg.addAnnotatedClass( C.class );
    cfg.addAnnotatedClass( InvalidPrefixCase.class );
    try {
      cfg.build();
      fail( "Exception should have been thrown for InvalidPrefixCase having invalid path: b.c.dne" );
    }
    catch (SearchException se) {
      assertTrue( "Expected search exception to contain information about invalid path a.b.c.indexed",
          se.getMessage().contains( "a.b.c.indexed" ) );
View Full Code Here

    cfg.addAnnotatedClass( A.class );
    cfg.addAnnotatedClass( B.class );
    cfg.addAnnotatedClass( C.class );
    cfg.addAnnotatedClass( InvalidShallowPathCase.class );
    try {
      cfg.build();
      fail( "Exception should have been thrown for ShallowPathCase having invalid path: dne" );
    }
    catch (SearchException se) {
      assertTrue( "Expected search exception to contain information about invalid path dne",
          se.getMessage().contains( "dne" ) );
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.