Package org.hibernate.search.testsupport.setup

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


  @Rule
  public ExpectedException exceptions = ExpectedException.none();

  @Test
  public void testOverrideOptionGetsApplied() throws IOException {
    SearchConfigurationForTest cfg = new SearchConfigurationForTest()
      .addProperty( "hibernate.search.default.directory_provider", "infinispan" )
      .addProperty( DefaultCacheManagerService.INFINISPAN_TRANSPORT_OVERRIDE_RESOURCENAME, "not existing" )
      .addClass( Dvd.class );

    //The most practical way to figure out if the property was applied is to provide it with
View Full Code Here


    tryCreatingDocumentBuilder( reverted, reflectionManager );
    //No assertions needed: we just verify the previous statements won't throw an exception
  }

  private static void tryCreatingDocumentBuilder(XClass mappedXClass, ReflectionManager reflectionManager) {
    SearchConfiguration searchConfiguration = new SearchConfigurationForTest();
    ConfigContext context = new ConfigContext( searchConfiguration, new BuildContextForTest( searchConfiguration ) );
    MetadataProvider metadataProvider = new AnnotationMetadataProvider( reflectionManager, context );
    TypeMetadata typeMetadata = metadataProvider.getTypeMetadataFor( reflectionManager.toClass( mappedXClass ));
    new DocumentBuilderIndexedEntity( mappedXClass,
        typeMetadata,
View Full Code Here

  private SearchConfigurationForTest searchConfiguration;
  private ServiceManager serviceManagerUnderTest;

  @Before
  public void setUp() {
    searchConfiguration = new SearchConfigurationForTest();
    serviceManagerUnderTest = new StandardServiceManager(
        searchConfiguration,
        new DummyBuildContext()
    );
  }
View Full Code Here

    assertTrue( "The same service instance should have been returned", simpleService1 == simpleService2 );
  }

  @Test
  public void providedServicesHavePrecedence() {
    SearchConfigurationForTest configuration = new SearchConfigurationForTest();
    configuration.getProvidedServices().put( SimpleService.class, new ProgrammaticallyConfiguredSimpleService() );

    serviceManagerUnderTest = new StandardServiceManager(
        configuration,
        new DummyBuildContext()
    );
View Full Code Here

  }

  @Test
  @TestForIssue(jiraKey = "HSEARCH-1547")
  public void testProvidedServicesCannotImplementStartable() {
    searchConfiguration = new SearchConfigurationForTest();

    thrown.expect( SearchException.class );
    thrown.expectMessage( JUnitMatchers.containsString( "HSEARCH000210" ) );
    searchConfiguration.addProvidedService(
        StartableProvidedService.class,
View Full Code Here

  }

  @Test
  @TestForIssue(jiraKey = "HSEARCH-1547")
  public void testProvidedServicesCannotImplementStoppable() {
    searchConfiguration = new SearchConfigurationForTest();

    thrown.expect( SearchException.class );
    thrown.expectMessage( JUnitMatchers.containsString( "HSEARCH000210" ) );
    searchConfiguration.addProvidedService(
        StoppableProvidedService.class,
View Full Code Here

*/
public class NativeJavaSerializationProviderTest {
  @Test
  public void testCorrectSerializationProviderDetected() {
    ServiceManager serviceManager = new StandardServiceManager(
        new SearchConfigurationForTest(),
        null
    );

    SerializationProvider serializationProvider = serviceManager.requestService( SerializationProvider.class );
    assertTrue( "Wrong serialization provider", serializationProvider instanceof NativeJavaSerializationProvider );
View Full Code Here

*/
public class IndexMetadataCompleteConfiguredTest {

  @Test
  public void testDefaultImplementation() {
    SearchConfigurationForTest cfg = new SearchConfigurationForTest();
    verifyIndexCompleteMetadataOption( true, cfg );
  }
View Full Code Here

    verifyIndexCompleteMetadataOption( true, cfg );
  }

  @Test
  public void testIndexMetadataCompleteFalse() {
    SearchConfigurationForTest cfg = new SearchConfigurationForTest();
    cfg.setIndexMetadataComplete( false );
    verifyIndexCompleteMetadataOption( false, cfg );
  }
View Full Code Here

    verifyIndexCompleteMetadataOption( false, cfg );
  }

  @Test
  public void testIndexMetadataCompleteTrue() {
    SearchConfigurationForTest cfg = new SearchConfigurationForTest();
    cfg.setIndexMetadataComplete( true );
    verifyIndexCompleteMetadataOption( true, 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.