Search in sources :

Example 1 with ArpInfoData

use of org.openkilda.messaging.info.event.ArpInfoData in project open-kilda by telstra.

the class PacketServiceTest method testHandleArpDataDifferentSwitchId.

@Test
public void testHandleArpDataDifferentSwitchId() {
    ArpInfoData updatedData = createArpInfoData();
    updatedData.setSwitchId(SWITCH_ID_2);
    runHandleArpDataWithAddedDevice(updatedData);
}
Also used : ArpInfoData(org.openkilda.messaging.info.event.ArpInfoData) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 2 with ArpInfoData

use of org.openkilda.messaging.info.event.ArpInfoData in project open-kilda by telstra.

the class PacketServiceTest method testHandleArpDataDifferentMac.

@Test
public void testHandleArpDataDifferentMac() {
    ArpInfoData updatedData = createArpInfoData();
    updatedData.setMacAddress(MAC_ADDRESS_2);
    runHandleArpDataWithAddedDevice(updatedData);
}
Also used : ArpInfoData(org.openkilda.messaging.info.event.ArpInfoData) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 3 with ArpInfoData

use of org.openkilda.messaging.info.event.ArpInfoData in project open-kilda by telstra.

the class PacketServiceTest method testHandleArpDataDifferentVlan.

@Test
public void testHandleArpDataDifferentVlan() {
    ArpInfoData updatedData = createArpInfoData();
    updatedData.setVlans(Collections.singletonList(VLAN_2));
    runHandleArpDataWithAddedDevice(updatedData);
}
Also used : ArpInfoData(org.openkilda.messaging.info.event.ArpInfoData) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 4 with ArpInfoData

use of org.openkilda.messaging.info.event.ArpInfoData in project open-kilda by telstra.

the class PacketServiceTest method runHandleArpDataWithAddedDevice.

private void runHandleArpDataWithAddedDevice(ArpInfoData updatedData) {
    ArpInfoData data = createArpInfoData();
    packetService.handleArpData(data);
    assertEquals(1, switchConnectedDeviceRepository.findAll().size());
    assertArpConnectedDeviceExistInDatabase(data);
    // we must add second device
    packetService.handleArpData(updatedData);
    assertEquals(2, switchConnectedDeviceRepository.findAll().size());
    assertArpConnectedDeviceExistInDatabase(data);
    assertArpConnectedDeviceExistInDatabase(updatedData);
}
Also used : ArpInfoData(org.openkilda.messaging.info.event.ArpInfoData)

Example 5 with ArpInfoData

use of org.openkilda.messaging.info.event.ArpInfoData in project open-kilda by telstra.

the class PacketServiceTest method testHandleArpDataNonExistentSwitch.

@Test
public void testHandleArpDataNonExistentSwitch() {
    ArpInfoData data = createArpInfoData();
    data.setSwitchId(new SwitchId("12345"));
    packetService.handleArpData(data);
    assertTrue(switchConnectedDeviceRepository.findAll().isEmpty());
}
Also used : ArpInfoData(org.openkilda.messaging.info.event.ArpInfoData) SwitchId(org.openkilda.model.SwitchId) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Aggregations

ArpInfoData (org.openkilda.messaging.info.event.ArpInfoData)9 Test (org.junit.Test)6 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)6 InfoMessage (org.openkilda.messaging.info.InfoMessage)2 Ethernet (net.floodlightcontroller.packet.Ethernet)1 Message (org.openkilda.messaging.Message)1 InfoData (org.openkilda.messaging.info.InfoData)1 LldpInfoData (org.openkilda.messaging.info.event.LldpInfoData)1 SwitchId (org.openkilda.model.SwitchId)1