Package org.hibernate.search.testsupport.setup

Examples of org.hibernate.search.testsupport.setup.SearchConfigurationForTest


        .providedId().name( "myID" )
      //Entity missing both @DocumentId and @ProvidedId:
      .property( "title", ElementType.FIELD ).field()
      .property( "text", ElementType.FIELD ).field()
      ;
    SearchConfigurationForTest cfg = new SearchConfigurationForTest()
      .setProgrammaticMapping( mapping )
      .setIdProvidedImplicit( true )
      .addClass( Book.class );
    storeBooksViaProvidedId( cfg, "myID", false );
  }
View Full Code Here


        .providedId().name( "myID" )
      //Entity missing both @DocumentId and @ProvidedId:
      .property( "title", ElementType.FIELD ).field()
      .property( "text", ElementType.FIELD ).field()
      ;
    SearchConfigurationForTest cfg = new SearchConfigurationForTest()
      .setProgrammaticMapping( mapping )
      .setIdProvidedImplicit( false ) //DEFAULT
      .addClass( Book.class );
    storeBooksViaProvidedId( cfg, "myID", false );
  }
View Full Code Here

        .providedId().name( "myID" )
      //Entity missing both @DocumentId and @ProvidedId:
      .property( "title", ElementType.FIELD ).field()
      .property( "text", ElementType.FIELD ).field()
      ;
    SearchConfigurationForTest cfg = new SearchConfigurationForTest()
      .setProgrammaticMapping( mapping )
      //.setIdProvidedImplicit( false ) //Test it's the default
      .addClass( Book.class );
    storeBooksViaProvidedId( cfg, "myID", false );
  }
View Full Code Here

    mapping
      .entity( Book.class ).indexed()
        .property( "title", ElementType.FIELD ).documentId()
        .property( "text", ElementType.FIELD ).field()
      ;
    SearchConfigurationForTest cfg = new SearchConfigurationForTest()
      .setProgrammaticMapping( mapping )
      //.setIdProvidedImplicit( false ) //Test it's the default
      .addClass( Book.class );
    storeBooksViaProvidedId( cfg, "title", true );
  }
View Full Code Here

@TestForIssue(jiraKey = "HSEARCH-1211")
public class IndexManagerFactoryCustomizationTest {

  @Test
  public void testDefaultImplementation() {
    SearchConfigurationForTest cfg = new SearchConfigurationForTest();
    verifyIndexManagerTypeIs( DirectoryBasedIndexManager.class, cfg );
  }
View Full Code Here

    verifyIndexManagerTypeIs( DirectoryBasedIndexManager.class, cfg );
  }

  @Test
  public void testOverriddenDefaultImplementation() {
    SearchConfigurationForTest configurationForTest = new SearchConfigurationForTest();

    Map<Class<? extends Service>, String> fakedDiscoveredServices = CollectionHelper.newHashMap( 1 );
    fakedDiscoveredServices.put( IndexManagerFactory.class, NRTIndexManagerFactory.class.getName() );
    configurationForTest.setClassLoaderService( new CustomClassLoaderService( fakedDiscoveredServices ) );

    verifyIndexManagerTypeIs( NRTIndexManager.class, configurationForTest );
  }
View Full Code Here

        directoryBasedIndexManager.getDirectoryProvider() instanceof FSDirectoryProvider
    );
  }

  private MutableSearchFactory getSearchFactory(Map<String, String> shardingProperties) {
    SearchConfigurationForTest configuration = new SearchConfigurationForTest();
    for ( Map.Entry<String, String> entry : shardingProperties.entrySet() ) {
      configuration.addProperty( entry.getKey(), entry.getValue() );
    }
    configuration.addClass( Foo.class );

    return (MutableSearchFactory) new SearchFactoryBuilder().configuration(
        configuration
    ).buildSearchFactory();
  }
View Full Code Here

  );
  private AnnotationMetadataProvider metadataProvider;

  @Before
  public void setUp() {
    SearchConfiguration searchConfiguration = new SearchConfigurationForTest();
    ConfigContext configContext = new ConfigContext(
        searchConfiguration,
        new BuildContextForTest( searchConfiguration )
    );
    metadataProvider = new AnnotationMetadataProvider( new JavaReflectionManager(), configContext );
View Full Code Here

*/
public class OptimizerStrategyLoadTest {

  @Test
  public void testDefaultImplementation() {
    SearchConfigurationForTest cfg = new SearchConfigurationForTest();
    cfg.addProperty( "hibernate.search.default.optimizer.implementation", "default" );
    verifyOptimizerImplementationIs( ExplicitOnlyOptimizerStrategy.class, cfg );
  }
View Full Code Here

    verifyOptimizerImplementationIs( ExplicitOnlyOptimizerStrategy.class, cfg );
  }

  @Test
  public void testUnsetImplementation() {
    SearchConfigurationForTest cfg = new SearchConfigurationForTest();
    verifyOptimizerImplementationIs( ExplicitOnlyOptimizerStrategy.class, cfg );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.testsupport.setup.SearchConfigurationForTest

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.