Package org.hibernate.search.engine.spi

Examples of org.hibernate.search.engine.spi.SearchFactoryImplementor


  }

  @Test
  public void testExplicitTransactionalWorker() {
    manualConfiguration.addProperty( "hibernate.search.worker.scope", "transaction" );
    SearchFactoryImplementor searchFactoryImplementor =
        new SearchFactoryBuilder().configuration( manualConfiguration ).buildSearchFactory();
    assertNotNull( "Worker should have been created", searchFactoryImplementor.getWorker() );
    assertTrue( "Wrong worker class", searchFactoryImplementor.getWorker() instanceof TransactionalWorker );
  }
View Full Code Here


  }

  @Test
  public void testCustomWorker() {
    manualConfiguration.addProperty( "hibernate.search.worker.scope", CustomWorker.class.getName() );
    SearchFactoryImplementor searchFactoryImplementor =
        new SearchFactoryBuilder().configuration( manualConfiguration ).buildSearchFactory();
    assertNotNull( "Worker should have been created", searchFactoryImplementor.getWorker() );
    assertTrue( "Wrong worker class", searchFactoryImplementor.getWorker() instanceof CustomWorker );
  }
View Full Code Here

  @Test
  public void testCustomWorkerWithProperties() {
    manualConfiguration.addProperty( "hibernate.search.worker.scope", CustomWorkerExpectingFooAndBar.class.getName() );
    manualConfiguration.addProperty( "hibernate.search.worker.foo", "foo" );
    manualConfiguration.addProperty( "hibernate.search.worker.bar", "bar" );
    SearchFactoryImplementor searchFactoryImplementor =
        new SearchFactoryBuilder().configuration( manualConfiguration ).buildSearchFactory();
    assertNotNull( "Worker should have been created", searchFactoryImplementor.getWorker() );
    assertTrue( "Wrong worker class", searchFactoryImplementor.getWorker() instanceof CustomWorkerExpectingFooAndBar );
  }
View Full Code Here

  @Test
  public void testGetIndexedTypesNoTypeIndexed() {
    SearchConfigurationForTest cfg = getManualConfiguration();

    SearchFactoryImplementor sf = new SearchFactoryBuilder().configuration( cfg ).buildSearchFactory();
    Set<Class<?>> indexedClasses = sf.getIndexedTypes();
    assertEquals( "Wrong number of indexed entities", 0, indexedClasses.size() );
  }
View Full Code Here

        .entity( Foo.class ).indexed()
        .property( "id", FIELD ).documentId()
    ;
    cfg.setProgrammaticMapping( mapping );

    SearchFactoryImplementor sf = new SearchFactoryBuilder().configuration( cfg ).buildSearchFactory();
    Set<Class<?>> indexedClasses = sf.getIndexedTypes();
    assertEquals( "Wrong number of indexed entities", 1, indexedClasses.size() );
    assertTrue( indexedClasses.iterator().next().equals( Foo.class ) );
  }
View Full Code Here

        .entity( Bar.class ).indexed()
        .property( "id", FIELD ).documentId()
    ;
    cfg.setProgrammaticMapping( mapping );

    SearchFactoryImplementor sf = new SearchFactoryBuilder().configuration( cfg ).buildSearchFactory();
    Set<Class<?>> indexedClasses = sf.getIndexedTypes();
    assertEquals( "Wrong number of indexed entities", 2, indexedClasses.size() );
  }
View Full Code Here

  @Test
  public void testGetTypeDescriptorForUnindexedType() {
    SearchConfigurationForTest cfg = getManualConfiguration();

    SearchFactoryImplementor sf = new SearchFactoryBuilder().configuration( cfg ).buildSearchFactory();
    IndexedTypeDescriptor indexedTypeDescriptor = sf.getIndexedTypeDescriptor( Foo.class);
    assertNotNull( indexedTypeDescriptor );
    assertFalse( indexedTypeDescriptor.isIndexed() );
  }
View Full Code Here

        .entity( Foo.class ).indexed()
        .property( "id", FIELD ).documentId()
    ;
    cfg.setProgrammaticMapping( mapping );

    SearchFactoryImplementor sf = new SearchFactoryBuilder().configuration( cfg ).buildSearchFactory();
    IndexedTypeDescriptor indexedTypeDescriptor = sf.getIndexedTypeDescriptor( Foo.class);
    assertNotNull( indexedTypeDescriptor );
    assertTrue( indexedTypeDescriptor.isIndexed() );
  }
View Full Code Here

  }

  @Test
  public void testDefaultRegistration() throws Exception {
    String suffix = null;
    SearchFactoryImplementor searchFactory = createSearchFactoryUsingJndiPrefix( suffix );
    testStatisticsMBeanRegistered( suffix );
    searchFactory.close();
  }
View Full Code Here

  }

  @Test
  public void testRegistrationWithSuffix() throws Exception {
    String suffix = "myapp";
    SearchFactoryImplementor searchFactory = createSearchFactoryUsingJndiPrefix( suffix );
    testStatisticsMBeanRegistered( suffix );
    searchFactory.close();
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.engine.spi.SearchFactoryImplementor

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.