use of org.openkilda.config.provider.PropertiesBasedConfigurationProvider in project open-kilda by telstra.
the class FlowResourcesManagerTest method setUp.
@Before
public void setUp() {
Properties configProps = new Properties();
configProps.setProperty("flow.meter-id.max", "40");
configProps.setProperty("flow.vlan.max", "50");
PropertiesBasedConfigurationProvider configurationProvider = new PropertiesBasedConfigurationProvider(configProps);
flowResourcesConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
resourcesManager = new FlowResourcesManager(persistenceManager, flowResourcesConfig);
flowMeterRepository = repositoryFactory.createFlowMeterRepository();
flowCookieRepository = repositoryFactory.createFlowCookieRepository();
switchRepository = repositoryFactory.createSwitchRepository();
switchRepository.findAll().forEach(switchRepository::remove);
Stream.of(switch1, switch3, switch4, switch5).forEach(switchRepository::add);
}
use of org.openkilda.config.provider.PropertiesBasedConfigurationProvider in project open-kilda by telstra.
the class PathsServiceTest method setUpOnce.
@BeforeClass
public static void setUpOnce() {
RepositoryFactory repositoryFactory = persistenceManager.getRepositoryFactory();
kildaConfigurationRepository = repositoryFactory.createKildaConfigurationRepository();
switchRepository = repositoryFactory.createSwitchRepository();
switchPropertiesRepository = repositoryFactory.createSwitchPropertiesRepository();
islRepository = repositoryFactory.createIslRepository();
kildaConfigurationRepository = repositoryFactory.createKildaConfigurationRepository();
PathComputerConfig pathComputerConfig = new PropertiesBasedConfigurationProvider().getConfiguration(PathComputerConfig.class);
pathsService = new PathsService(repositoryFactory, pathComputerConfig);
}
use of org.openkilda.config.provider.PropertiesBasedConfigurationProvider in project open-kilda by telstra.
the class PersistenceConfig method configurationProvider.
@Bean
public ConfigurationProvider configurationProvider(@Value("${kilda.config.file:kilda.properties}") String fileLocation) throws IOException {
Resource resource = new FileSystemResource(fileLocation);
Properties props = PropertiesLoaderUtils.loadProperties(resource);
return new PropertiesBasedConfigurationProvider(props);
}
use of org.openkilda.config.provider.PropertiesBasedConfigurationProvider in project open-kilda by telstra.
the class AbstractSpeakerCommandTest method setUp.
@Before
public void setUp() throws Exception {
injectMocks(this);
moduleContext.addService(SessionService.class, sessionService);
moduleContext.addService(IOFSwitchService.class, ofSwitchManager);
expect(commandProcessor.getModuleContext()).andReturn(moduleContext).anyTimes();
// sw
prepareSwitch(sw, dpId);
prepareSwitch(swNext, dpIdNext);
Properties configProps = new Properties();
PropertiesBasedConfigurationProvider provider = new PropertiesBasedConfigurationProvider(configProps);
KildaCoreConfig config = provider.getConfiguration(KildaCoreConfig.class);
expect(kildaCore.getConfig()).andReturn(config).anyTimes();
moduleContext.addService(KildaCore.class, kildaCore);
moduleContext.addService(FeatureDetectorService.class, featureDetectorService);
prepareSessionService();
switchSessionProducePlan.put(dpId, ImmutableList.of(session).iterator());
switchSessionProducePlan.put(dpIdNext, ImmutableList.of(session).iterator());
}
use of org.openkilda.config.provider.PropertiesBasedConfigurationProvider in project open-kilda by telstra.
the class InMemoryGraphPersistenceManager method newInstance.
/**
* Create new {@link InMemoryGraphPersistenceManager}.
*/
public static InMemoryGraphPersistenceManager newInstance() {
Properties properties = new Properties();
properties.put("persistence.implementation.default", PersistenceImplementationType.IN_MEMORY_GRAPH.name());
PropertiesBasedConfigurationProvider configurationProvider = new PropertiesBasedConfigurationProvider(properties);
InMemoryGraphPersistenceImplementation implementation = new InMemoryGraphPersistenceImplementation(configurationProvider);
return new InMemoryGraphPersistenceManager(configurationProvider, PersistenceImplementationType.IN_MEMORY_GRAPH, implementation);
}
Aggregations