use of org.openkilda.testing.model.topology.TopologyDefinition in project open-kilda by telstra.
the class FlowManagerTest method setUp.
@Before
public void setUp() throws IOException {
MockitoAnnotations.initMocks(this);
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
mapper.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS);
TopologyDefinition topology = mapper.readValue(getClass().getResourceAsStream("/5-switch-test-topology.yaml"), TopologyDefinition.class);
when(topologyDefinition.getActiveSwitches()).thenReturn(topology.getActiveSwitches());
when(topologyDefinition.getTraffGens()).thenReturn(topology.getTraffGens());
}
use of org.openkilda.testing.model.topology.TopologyDefinition in project open-kilda by telstra.
the class TopologyConfig method topologyDefinition.
@Bean
public TopologyDefinition topologyDefinition() throws IOException {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
mapper.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS);
TopologyDefinition topologyDefinition = mapper.readValue(topologyDefinitionFile.getInputStream(), TopologyDefinition.class);
topologyDefinition.setBfdOffset(bfdOffset);
for (TopologyDefinition.Switch sw : topologyDefinition.getSwitches()) {
sw.setController(managementController + " " + statController);
}
return topologyDefinition;
}
use of org.openkilda.testing.model.topology.TopologyDefinition in project open-kilda by telstra.
the class TestTopologyConfig method topologyDefinition.
@Bean
public TopologyDefinition topologyDefinition() throws IOException {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
mapper.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS);
TopologyDefinition topology = mapper.readValue(getClass().getResourceAsStream("/3-switch-test-topology.yaml"), TopologyDefinition.class);
return spy(topology);
}
Aggregations