Package org.hibernate.boot.registry.classloading.internal

Examples of org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl


  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


  @Test
  public void testEmbeddedIsTheDefaultGraphDatabaseService() throws Exception {
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, Neo4jTestHelper.dbLocation() );
    Neo4jGraphDatabaseServiceFactoryProvider graphService = new Neo4jGraphDatabaseServiceFactoryProvider();
    GraphDatabaseService db = graphService.load( properties, new ClassLoaderServiceImpl() ).create();
    db.shutdown();
    assertThat( db.getClass() ). isEqualTo( EmbeddedGraphDatabase.class );
  }
View Full Code Here

  public void testSelectedGraphDatabaseServiceIsLoaded() throws Exception {
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, Neo4jTestHelper.dbLocation() );
    properties.put( InternalProperties.NEO4J_GRAPHDB_FACTORYCLASS, MockGraphServiceFactory.class.getName() );
    Neo4jGraphDatabaseServiceFactoryProvider graphService = new Neo4jGraphDatabaseServiceFactoryProvider();
    GraphDatabaseService db = graphService.load( properties, new ClassLoaderServiceImpl() ).create();
    db.shutdown();
    assertThat( db.getClass() ). isEqualTo( MockGraphDatabaseService.class );
  }
View Full Code Here

  public void testPropertiesArePassed() throws Exception {
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, Neo4jTestHelper.dbLocation() );
    properties.put( InternalProperties.NEO4J_GRAPHDB_FACTORYCLASS, MockGraphServiceFactory.class.getName() );
    Neo4jGraphDatabaseServiceFactoryProvider graphService = new Neo4jGraphDatabaseServiceFactoryProvider();
    MockGraphDatabaseService db = (MockGraphDatabaseService) graphService.load( properties, new ClassLoaderServiceImpl() ).create();
    db.shutdown();
    assertTrue( "GraphDatabaseService factory cannot read the configuration properties", db.isConfigurationReadable() );
  }
View Full Code Here

    Properties configurationValues = new Properties();
    configurationValues.put( Neo4jProperties.DATABASE_PATH, dbLocation );
    provider = new Neo4jDatastoreProvider();

    ServiceRegistryImplementor serviceRegistry = mock( ServiceRegistryImplementor.class );
    when( serviceRegistry.getService( ClassLoaderService.class ) ).thenReturn( new ClassLoaderServiceImpl() );
    provider.injectServices( serviceRegistry );

    Set<PersistentNoSqlIdentifierGenerator> sequences = new HashSet<PersistentNoSqlIdentifierGenerator>();
    sequences.add( identifierGenerator( INITIAL_VALUE_SEQUENCE, INITIAL_VALUE_FIRST_VALUE_TEST ) );
    sequences.add( identifierGenerator( THREAD_SAFETY_SEQUENCE, INITIAL_VALUE_THREAD_SAFETY_TEST ) );
View Full Code Here

    }
  }

  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 );
View Full Code Here

  @Before
  public void setupConfigurationMapAndContexts() {
    cfg = new HashMap<String, Object>();
    cfg.put( OgmProperties.DATABASE, "database" );

    reader = new ConfigurationPropertyReader( cfg, new ClassLoaderServiceImpl() );
    globalOptions = OptionsContextImpl.forGlobal( OptionValueSources.getDefaultSources( reader ) );
  }
View Full Code Here

    );

    AssociationContext associationContext = new AssociationContextImpl(
        new AssociationTypeContextImpl(
            OptionsContextImpl.forProperty(
                OptionValueSources.getDefaultSources( new ConfigurationPropertyReader( sessions.getProperties(), new ClassLoaderServiceImpl() ) ),
                Project.class,
                "modules"
            ),
            new AssociatedEntityKeyMetadata( null, null ),
            null
View Full Code Here

    cfg.put( OgmProperties.DATABASE, "database" );

    context = new AppendableConfigurationContext();
    configuration = new MongoDB().getConfigurationBuilder( new ConfigurationContextImpl( context ) );

    reader = new ConfigurationPropertyReader( cfg, new ClassLoaderServiceImpl() );
  }
View Full Code Here

    // then
    assertThat( context.getUnique( NameExampleOption.class ) ).isEqualTo( "foobar" );
  }

  private List<OptionValueSource> getSources() {
    return OptionValueSources.getDefaultSources( new ConfigurationPropertyReader( cfg, new ClassLoaderServiceImpl() ) );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl

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.