Examples of injectServices()


Examples of org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform.injectServices()

         protected org.infinispan.transaction.lookup.TransactionManagerLookup createTransactionManagerLookup(Settings settings, Properties properties) {
            return new HibernateTransactionManagerLookup(null, null) {
               @Override
               public TransactionManager getTransactionManager() throws Exception {
                  AbstractJtaPlatform jta = new JBossStandAloneJtaPlatform();
                  jta.injectServices(ServiceRegistryBuilder.buildServiceRegistry());
                  return jta.getTransactionManager();
               }
            };
         }
View Full Code Here

Examples of org.hibernate.engine.transaction.jta.platform.internal.JBossStandAloneJtaPlatform.injectServices()

  }

  private static ServiceRegistryImplementor getServiceRegistry() {
    ServiceRegistryImplementor serviceRegistry = mock( ServiceRegistryImplementor.class );
    JBossStandAloneJtaPlatform jtaPlatform = new JBossStandAloneJtaPlatform();
    jtaPlatform.injectServices( serviceRegistry );

    when( serviceRegistry.getService( ClassLoaderService.class ) ).thenReturn( new ClassLoaderServiceImpl() );
    when( serviceRegistry.getService( JtaPlatform.class ) ).thenReturn( jtaPlatform );

    return serviceRegistry;
View Full Code Here

Examples of org.hibernate.engine.transaction.jta.platform.internal.JBossStandAloneJtaPlatform.injectServices()

         protected org.infinispan.transaction.lookup.TransactionManagerLookup createTransactionManagerLookup(Settings settings, Properties properties) {
            return new HibernateTransactionManagerLookup(null, null) {
               @Override
               public TransactionManager getTransactionManager() throws Exception {
                  AbstractJtaPlatform jta = new JBossStandAloneJtaPlatform();
                  jta.injectServices(ServiceRegistryBuilder.buildServiceRegistry());
                  return jta.getTransactionManager();
               }
            };
         }
View Full Code Here

Examples of org.hibernate.ogm.datastore.infinispan.impl.InfinispanDatastoreProvider.injectServices()

    configurationValues.put( InfinispanProperties.CONFIGURATION_RESOURCE_NAME, "infinispan-dist-duplicate-domains-allowed.xml" );
    ServiceRegistryImplementor serviceRegistry = getServiceRegistry();

    InfinispanDatastoreProvider provider = new InfinispanDatastoreProvider();
    provider.configure( configurationValues );
    provider.injectServices( serviceRegistry );
    provider.start();

    return provider;
  }
View Full Code Here

Examples of org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider.injectServices()

    cfg.put( OgmProperties.DATABASE, "test" );
    cfg.put( OgmProperties.USERNAME, "notauser" );
    cfg.put( OgmProperties.PASSWORD, "test" );

    MongoDBDatastoreProvider provider = new MongoDBDatastoreProvider();
    provider.injectServices( getServiceRegistry( cfg ) );
    provider.configure( cfg );

    error.expect( HibernateException.class );
    error.expectMessage( "OGM001213" );
View Full Code Here

Examples of org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider.injectServices()

  public void testConnectionErrorWrappedInHibernateException() throws Exception {
    Map<String, String> cfg = TestHelper.getEnvironmentProperties();
    cfg.put( OgmProperties.HOST, NON_EXISTENT_IP );

    MongoDBDatastoreProvider provider = new MongoDBDatastoreProvider();
    provider.injectServices( getServiceRegistry( cfg ) );
    provider.configure( cfg );

    error.expect( HibernateException.class );
    error.expectMessage( "OGM001214" );
View Full Code Here

Examples of org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider.injectServices()

    /*
     * To be sure, the test passes on slow / busy machines the hole
     * operation should not take more than 3 seconds.
      */
    final long estimateSpentTime = 3L * 1000L * 1000L * 1000L;
    provider.injectServices( getServiceRegistry( cfg ) );
    provider.configure( cfg );

    Exception exception = null;
    final long start = System.nanoTime();
    try {
View Full Code Here

Examples of org.hibernate.ogm.options.navigation.impl.OptionsServiceImpl.injectServices()

  private ServiceRegistryImplementor getServiceRegistry(Map<String, ?> cfg) {
    ServiceRegistryImplementor serviceRegistry = mock( ServiceRegistryImplementor.class );
    when( serviceRegistry.getService( ClassLoaderService.class ) ).thenReturn( new ClassLoaderServiceImpl() );

    OptionsServiceImpl optionsService = new OptionsServiceImpl();
    optionsService.injectServices( serviceRegistry );
    optionsService.configure( cfg );
    when( serviceRegistry.getService( OptionsService.class ) ).thenReturn( optionsService );

    return serviceRegistry;
  }
View Full Code Here

Examples of org.hibernate.service.jta.platform.internal.AbstractJtaPlatform.injectServices()

         protected org.infinispan.transaction.lookup.TransactionManagerLookup createTransactionManagerLookup(Settings settings, Properties properties) {
            return new HibernateTransactionManagerLookup(null, null) {
               @Override
               public TransactionManager getTransactionManager() throws Exception {
                  AbstractJtaPlatform jta = new JBossStandAloneJtaPlatform();
                  jta.injectServices(ServiceRegistryBuilder.buildServiceRegistry());
                  return jta.getTransactionManager();
               }
            };
         }
View Full Code Here

Examples of org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform.injectServices()

         protected org.infinispan.transaction.lookup.TransactionManagerLookup createTransactionManagerLookup(Settings settings, Properties properties) {
            return new HibernateTransactionManagerLookup(null, null) {
               @Override
               public TransactionManager getTransactionManager() throws Exception {
                  AbstractJtaPlatform jta = new JBossStandAloneJtaPlatform();
                  jta.injectServices(ServiceRegistryBuilder.buildServiceRegistry());
                  return jta.getTransactionManager();
               }
            };
         }
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.