Search in sources :

Example 11 with PropertiesBasedConfigurationProvider

use of org.openkilda.config.provider.PropertiesBasedConfigurationProvider in project open-kilda by telstra.

the class InMemoryGraphBasedTest method initPersistenceManager.

@BeforeClass
public static void initPersistenceManager() {
    Properties properties = new Properties();
    properties.put("persistence.implementation.default", PersistenceImplementationType.IN_MEMORY_GRAPH.name());
    configurationProvider = new PropertiesBasedConfigurationProvider(properties);
    inMemoryGraphPersistenceImplementation = new InMemoryGraphPersistenceImplementation(configurationProvider);
    InMemoryGraphPersistenceImplementation persistenceImplementation = Mockito.spy(inMemoryGraphPersistenceImplementation);
    repositoryFactory = Mockito.spy(inMemoryGraphPersistenceImplementation.getRepositoryFactory());
    Mockito.when(persistenceImplementation.getRepositoryFactory()).thenReturn(repositoryFactory);
    inMemoryGraphPersistenceManager = new InMemoryGraphPersistenceManager(configurationProvider, PersistenceImplementationType.IN_MEMORY_GRAPH, persistenceImplementation);
    inMemoryGraphPersistenceManager.install();
    persistenceManager = Mockito.spy(inMemoryGraphPersistenceManager);
    transactionManager = inMemoryGraphPersistenceManager.getTransactionManager();
}
Also used : PropertiesBasedConfigurationProvider(org.openkilda.config.provider.PropertiesBasedConfigurationProvider) Properties(java.util.Properties) BeforeClass(org.junit.BeforeClass)

Aggregations

PropertiesBasedConfigurationProvider (org.openkilda.config.provider.PropertiesBasedConfigurationProvider)11 Properties (java.util.Properties)9 BeforeClass (org.junit.BeforeClass)4 Before (org.junit.Before)3 IOFSwitchService (net.floodlightcontroller.core.internal.IOFSwitchService)2 FloodlightModuleContext (net.floodlightcontroller.core.module.FloodlightModuleContext)2 KildaCore (org.openkilda.floodlight.KildaCore)2 FlowSegmentMetadata (org.openkilda.floodlight.model.FlowSegmentMetadata)2 FeatureDetectorService (org.openkilda.floodlight.service.FeatureDetectorService)2 MessageContext (org.openkilda.messaging.MessageContext)2 PathComputerConfig (org.openkilda.pce.PathComputerConfig)2 RepositoryFactory (org.openkilda.persistence.repositories.RepositoryFactory)2 FlowResourcesConfig (org.openkilda.wfm.share.flow.resources.FlowResourcesConfig)2 KildaCoreConfig (org.openkilda.floodlight.KildaCoreConfig)1 InstallIngressFlow (org.openkilda.messaging.command.flow.InstallIngressFlow)1 FlowEntry (org.openkilda.messaging.info.rule.FlowEntry)1 FlowEndpoint (org.openkilda.model.FlowEndpoint)1 SwitchProperties (org.openkilda.model.SwitchProperties)1 FlowSegmentCookie (org.openkilda.model.cookie.FlowSegmentCookie)1 AvailableNetworkFactory (org.openkilda.pce.AvailableNetworkFactory)1