Search in sources :

Example 1 with PersistenceDummyEntityFactory

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());
    }
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) RuleManagerConfig(org.openkilda.rulemanager.RuleManagerConfig) PersistenceDummyEntityFactory(org.openkilda.persistence.dummy.PersistenceDummyEntityFactory) IslDirectionalReference(org.openkilda.persistence.dummy.IslDirectionalReference) FlowResourcesManager(org.openkilda.wfm.share.flow.resources.FlowResourcesManager) RuleManagerImpl(org.openkilda.rulemanager.RuleManagerImpl) Before(org.junit.Before)

Example 2 with PersistenceDummyEntityFactory

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());
    }
}
Also used : FlowResourcesConfig(org.openkilda.wfm.share.flow.resources.FlowResourcesConfig) PersistenceDummyEntityFactory(org.openkilda.persistence.dummy.PersistenceDummyEntityFactory) IslDirectionalReference(org.openkilda.persistence.dummy.IslDirectionalReference) FlowResourcesManager(org.openkilda.wfm.share.flow.resources.FlowResourcesManager) Before(org.junit.Before)

Example 3 with PersistenceDummyEntityFactory

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);
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) PersistenceDummyEntityFactory(org.openkilda.persistence.dummy.PersistenceDummyEntityFactory) FlowDefaults(org.openkilda.persistence.dummy.FlowDefaults) Before(org.junit.Before)

Example 4 with PersistenceDummyEntityFactory

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);
}
Also used : Switch(org.openkilda.model.Switch) PersistenceDummyEntityFactory(org.openkilda.persistence.dummy.PersistenceDummyEntityFactory) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)4 PersistenceDummyEntityFactory (org.openkilda.persistence.dummy.PersistenceDummyEntityFactory)4 IslDirectionalReference (org.openkilda.persistence.dummy.IslDirectionalReference)2 FlowResourcesConfig (org.openkilda.wfm.share.flow.resources.FlowResourcesConfig)2 FlowResourcesManager (org.openkilda.wfm.share.flow.resources.FlowResourcesManager)2 FlowEndpoint (org.openkilda.model.FlowEndpoint)1 Switch (org.openkilda.model.Switch)1 FlowDefaults (org.openkilda.persistence.dummy.FlowDefaults)1 RuleManagerConfig (org.openkilda.rulemanager.RuleManagerConfig)1 RuleManagerImpl (org.openkilda.rulemanager.RuleManagerImpl)1