Search in sources :

Example 11 with Isl

use of org.openkilda.model.Isl in project open-kilda by telstra.

the class FermaIslRepositoryTest method shouldDeleteFoundIsl.

@Test
public void shouldDeleteFoundIsl() {
    Isl isl1 = createIsl(switchA, 1, switchB, 1);
    createIsl(switchA, 2, switchB, 2);
    assertThat(islRepository.findAll(), Matchers.hasSize(2));
    transactionManager.doInTransaction(() -> islRepository.remove(isl1));
    assertThat(islRepository.findAll(), Matchers.hasSize(1));
}
Also used : Isl(org.openkilda.model.Isl) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 12 with Isl

use of org.openkilda.model.Isl in project open-kilda by telstra.

the class FermaIslRepositoryTest method shouldFindAllIsls.

@Test
public void shouldFindAllIsls() {
    Isl isl1 = createIsl(switchA, 111, switchB, 121, IslStatus.ACTIVE);
    Isl isl2 = createIsl(switchA, 112, switchB, 122, IslStatus.INACTIVE);
    Isl isl3 = createIsl(switchA, 113, switchB, 123, IslStatus.MOVED);
    List<Isl> foundIsls = Lists.newArrayList(islRepository.findAll());
    assertThat(foundIsls, Matchers.hasSize(3));
    assertThat(foundIsls, Matchers.containsInAnyOrder(isl1, isl2, isl3));
}
Also used : Isl(org.openkilda.model.Isl) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 13 with Isl

use of org.openkilda.model.Isl in project open-kilda by telstra.

the class FermaIslRepositoryTest method shouldFindIslByDestSwitch.

@Test
public void shouldFindIslByDestSwitch() {
    Isl isl1 = createIsl(switchA, 111, switchB, 121);
    Isl isl2 = createIsl(switchA, 112, switchB, 122);
    List<Isl> foundIsls = Lists.newArrayList(islRepository.findByDestSwitch(TEST_SWITCH_B_ID));
    assertThat(foundIsls, Matchers.hasSize(2));
    assertThat(foundIsls, Matchers.containsInAnyOrder(isl1, isl2));
}
Also used : Isl(org.openkilda.model.Isl) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 14 with Isl

use of org.openkilda.model.Isl in project open-kilda by telstra.

the class FermaIslRepositoryTest method shouldCreateAndFindIslByEndpoint.

@Test
public void shouldCreateAndFindIslByEndpoint() {
    Isl isl = createIsl(switchA, 1, switchB, 1);
    assertThat(islRepository.findAll(), Matchers.hasSize(1));
    List<Isl> foundIsls = Lists.newArrayList(islRepository.findBySrcEndpoint(TEST_SWITCH_A_ID, 1));
    assertThat(foundIsls, Matchers.hasSize(1));
    assertThat(foundIsls, Matchers.contains(isl));
}
Also used : Isl(org.openkilda.model.Isl) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 15 with Isl

use of org.openkilda.model.Isl in project open-kilda by telstra.

the class FermaIslRepositoryTest method shouldFindIslByDestEndpoint.

@Test
public void shouldFindIslByDestEndpoint() {
    Isl isl = createIsl(switchA, 111, switchB, 112);
    List<Isl> foundIsls = Lists.newArrayList(islRepository.findByDestEndpoint(TEST_SWITCH_B_ID, 112));
    assertThat(foundIsls, Matchers.hasSize(1));
    assertThat(foundIsls, Matchers.contains(isl));
}
Also used : Isl(org.openkilda.model.Isl) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Aggregations

Isl (org.openkilda.model.Isl)83 Test (org.junit.Test)49 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)25 Endpoint (org.openkilda.wfm.share.model.Endpoint)18 Switch (org.openkilda.model.Switch)17 IslReference (org.openkilda.wfm.share.model.IslReference)11 SwitchId (org.openkilda.model.SwitchId)10 IslInfoData (org.openkilda.messaging.info.event.IslInfoData)9 IslDataHolder (org.openkilda.wfm.topology.network.model.IslDataHolder)8 ArrayList (java.util.ArrayList)6 PathId (org.openkilda.model.PathId)6 Flow (org.openkilda.model.Flow)5 IslRepository (org.openkilda.persistence.repositories.IslRepository)5 Collection (java.util.Collection)4 HashMap (java.util.HashMap)4 List (java.util.List)4 Map (java.util.Map)4 FlowPath (org.openkilda.model.FlowPath)4 PersistenceException (org.openkilda.persistence.exceptions.PersistenceException)4 IslFrame (org.openkilda.persistence.ferma.frames.IslFrame)4