use of org.openkilda.persistence.dummy.PersistenceDummyEntityFactory in project open-kilda by telstra.
the class AbstractYFlowTest method before.
@Before
public void before() {
dummyFactory = new PersistenceDummyEntityFactory(persistenceManager);
FlowResourcesConfig resourceConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
flowResourcesManager = spy(new FlowResourcesManager(persistenceManager, resourceConfig));
RuleManagerConfig ruleManagerConfig = configurationProvider.getConfiguration(RuleManagerConfig.class);
ruleManager = spy(new RuleManagerImpl(ruleManagerConfig));
alterFeatureToggles(true, true, true, true);
dummyFactory.makeSwitch(SWITCH_SHARED);
dummyFactory.makeSwitch(SWITCH_FIRST_EP);
dummyFactory.makeSwitch(SWITCH_SECOND_EP);
dummyFactory.makeSwitch(SWITCH_TRANSIT);
dummyFactory.makeSwitch(SWITCH_NEW_TRANSIT);
dummyFactory.makeSwitch(SWITCH_ALT_TRANSIT);
dummyFactory.makeSwitch(SWITCH_NEW_FIRST_EP);
dummyFactory.makeSwitch(SWITCH_NEW_SECOND_EP);
for (IslDirectionalReference reference : new IslDirectionalReference[] { islSharedToFirst, islSharedToSecond, islSharedToTransit, islTransitToFirst, islTransitToSecond, islSharedToAltTransit, islAltTransitToFirst, islAltTransitToSecond, islTransitToNewFirst, islTransitToNewSecond, islSharedToNewAltTransit, islNewAltTransitToFirst, islNewAltTransitToSecond, islSharedToNewTransit, islNewTransitToFirst, islNewTransitToSecond }) {
dummyFactory.makeIsl(reference.getSourceEndpoint(), reference.getDestEndpoint());
dummyFactory.makeIsl(reference.getDestEndpoint(), reference.getSourceEndpoint());
}
}
use of org.openkilda.persistence.dummy.PersistenceDummyEntityFactory in project open-kilda by telstra.
the class AbstractFlowTest method before.
@Before
public void before() {
dummyFactory = new PersistenceDummyEntityFactory(persistenceManager);
FlowResourcesConfig resourceConfig = configurationProvider.getConfiguration(FlowResourcesConfig.class);
flowResourcesManager = spy(new FlowResourcesManager(persistenceManager, resourceConfig));
alterFeatureToggles(true, true, true);
dummyFactory.makeSwitch(SWITCH_SOURCE);
dummyFactory.makeSwitch(SWITCH_DEST);
dummyFactory.makeSwitch(SWITCH_TRANSIT);
for (IslDirectionalReference reference : new IslDirectionalReference[] { islSourceDest, islSourceDestAlt, islSourceTransit, islTransitDest }) {
dummyFactory.makeIsl(reference.getSourceEndpoint(), reference.getDestEndpoint());
dummyFactory.makeIsl(reference.getDestEndpoint(), reference.getSourceEndpoint());
}
}
use of org.openkilda.persistence.dummy.PersistenceDummyEntityFactory in project open-kilda by telstra.
the class ActionServiceTest method setup.
@Before
public void setup() {
FlowDefaults flowDefaults = new FlowDefaults();
flowDefaults.setPathComputationStrategy(PathComputationStrategy.LATENCY);
dummyFactory = new PersistenceDummyEntityFactory(persistenceManager, flowDefaults);
flowRepository = persistenceManager.getRepositoryFactory().createFlowRepository();
flowStatsRepository = persistenceManager.getRepositoryFactory().createFlowStatsRepository();
featureTogglesRepository = persistenceManager.getRepositoryFactory().createFeatureTogglesRepository();
featureTogglesRepository.add(KildaFeatureToggles.builder().flowLatencyMonitoringReactions(true).build());
createTestSwitch(SRC_SWITCH);
createTestSwitch(DST_SWITCH);
flow = dummyFactory.makeFlow(new FlowEndpoint(SRC_SWITCH, IN_PORT), new FlowEndpoint(DST_SWITCH, OUT_PORT));
service = new ActionService(carrier, persistenceManager, clock, TIMEOUT, THRESHOLD);
}
use of org.openkilda.persistence.dummy.PersistenceDummyEntityFactory in project open-kilda by telstra.
the class FlowCacheServiceTest method setup.
@Before
public void setup() {
dummyFactory = new PersistenceDummyEntityFactory(persistenceManager);
islRepository = persistenceManager.getRepositoryFactory().createIslRepository();
Switch firstSwitch = createTestSwitch(SRC_SWITCH.toLong());
Switch secondSwitch = createTestSwitch(DST_SWITCH.toLong());
createIsl(firstSwitch, ISL_SRC_PORT, secondSwitch, ISL_DST_PORT);
createIsl(secondSwitch, ISL_DST_PORT, firstSwitch, ISL_SRC_PORT);
createIsl(firstSwitch, ISL_SRC_PORT_2, secondSwitch, ISL_DST_PORT_2);
createIsl(secondSwitch, ISL_DST_PORT_2, firstSwitch, ISL_SRC_PORT_2);
}
Aggregations