Examples of ITopologyService


Examples of net.floodlightcontroller.topology.ITopologyService

        assertNull(dsr.getEntities());
    }

    @Test
    public void testDeviceSyncRepresentationFromDevice() {
        ITopologyService mockTopology = makeMockTopologyAllPortsAp();
        replay(mockTopology);
        deviceManager.topology = mockTopology;

        deviceManager.entityClassifier = new MockEntityClassifier();
View Full Code Here

Examples of net.floodlightcontroller.topology.ITopologyService

     * store or delete from the store.
     */
    @Test
    public void testWriteToSyncStore() throws Exception {
        int syncStoreIntervalMs = 50;
        ITopologyService mockTopology = makeMockTopologyAllPortsAp();
        replay(mockTopology);
        deviceManager.topology = mockTopology;
        deviceManager.setSyncStoreWriteInterval(syncStoreIntervalMs);

        Entity e1a = new Entity(1L, (short)2, 3, 4L, 5, new Date(1000));
View Full Code Here

Examples of net.floodlightcontroller.topology.ITopologyService

    @Test
    public void testToMaster() throws Exception {
        int syncStoreWriteIntervalMs = 0;
        int initialSyncStoreConsolidateIntervalMs = 50;
        ITopologyService mockTopology = makeMockTopologyAllPortsAp();
        replay(mockTopology);
        deviceManager.topology = mockTopology;
        // We want an EntityClassifier that has switch/port as key fields
        deviceManager.entityClassifier = new MockEntityClassifier();
        deviceManager.setSyncStoreWriteInterval(syncStoreWriteIntervalMs);
View Full Code Here

Examples of net.floodlightcontroller.topology.ITopologyService


    @Test
    public void testConsolitateStore() throws Exception {
        int syncStoreInternalMs = 0;
        ITopologyService mockTopology = makeMockTopologyAllPortsAp();
        replay(mockTopology);
        deviceManager.topology = mockTopology;
        // We want an EntityClassifier that has switch/port as key fields
        deviceManager.entityClassifier = new MockEntityClassifier();
        deviceManager.setSyncStoreWriteInterval(syncStoreInternalMs);
View Full Code Here

Examples of net.floodlightcontroller.topology.ITopologyService

        replay(mockListener);
        deviceManager.addListener(mockListener);
        verify(mockListener);
        reset(mockListener);

        ITopologyService mockTopology = createMock(ITopologyService.class);
        expect(mockTopology.getL2DomainId(1L)).
        andReturn(1L).anyTimes();
        expect(mockTopology.getL2DomainId(2L)).
        andReturn(1L).anyTimes();
        expect(mockTopology.getL2DomainId(3L)).
        andReturn(1L).anyTimes();
        expect(mockTopology.getL2DomainId(4L)).
        andReturn(1L).anyTimes();
        expect(mockTopology.isBroadcastDomainPort(anyLong(), anyShort()))
                .andReturn(false).anyTimes();
        expect(mockTopology.isInSameBroadcastDomain(anyLong(), anyShort(),
                                                    anyLong(), anyShort()))
                .andReturn(false).anyTimes();

        expect(mockTopology.isAttachmentPointPort(or(eq(1L), eq(3L)), anyShort()))
                .andReturn(true).anyTimes();
        // Switches 2 and 4 have only internal ports
        expect(mockTopology.isAttachmentPointPort(or(eq(2L), eq(4L)), anyShort()))
                .andReturn(false).anyTimes();

        expect(mockTopology.isConsistent(1L, (short)1, 3L, (short)1))
                .andReturn(false).once();

        Date topologyUpdateTime = new Date();
        expect(mockTopology.getLastUpdateTime()).andReturn(topologyUpdateTime).
        anyTimes();

        replay(mockTopology);

        deviceManager.topology = mockTopology;
View Full Code Here

Examples of net.floodlightcontroller.topology.ITopologyService

        replay(mockListener);
        deviceManager.addListener(mockListener);
        verify(mockListener);
        reset(mockListener);

        ITopologyService mockTopology = createMock(ITopologyService.class);
        expect(mockTopology.getL2DomainId(1L)).
        andReturn(1L).anyTimes();
        expect(mockTopology.getL2DomainId(5L)).
        andReturn(1L).anyTimes();
        expect(mockTopology.getL2DomainId(10L)).
        andReturn(10L).anyTimes();
        expect(mockTopology.getL2DomainId(50L)).
        andReturn(10L).anyTimes();
        expect(mockTopology.isBroadcastDomainPort(anyLong(), anyShort()))
                .andReturn(false).anyTimes();
        expect(mockTopology.isInSameBroadcastDomain(anyLong(), anyShort(),
                                                    anyLong(), anyShort()))
                .andReturn(false).anyTimes();

        expect(mockTopology.isAttachmentPointPort(anyLong(), anyShort()))
                .andReturn(true).anyTimes();
        expect(mockTopology.isConsistent(5L, (short)1, 50L, (short)1))
                .andReturn(false).anyTimes();

        Date topologyUpdateTime = new Date();
        expect(mockTopology.getLastUpdateTime()).andReturn(topologyUpdateTime).
        anyTimes();

        replay(mockTopology);

        deviceManager.topology = mockTopology;
View Full Code Here

Examples of net.floodlightcontroller.topology.ITopologyService

        verify(mockListener);
    }

    @Test
    public void testBDAttachmentPointLearning() throws Exception {
        ITopologyService mockTopology = createMock(ITopologyService.class);
        expect(mockTopology.getL2DomainId(anyLong())).
        andReturn(1L).anyTimes();
        expect(mockTopology.isAttachmentPointPort(anyLong(), anyShort())).
        andReturn(true).anyTimes();
        expect(mockTopology.isBroadcastDomainPort(1L, (short)1)).
        andReturn(false).anyTimes();
        expect(mockTopology.isBroadcastDomainPort(1L, (short)2)).
        andReturn(true).anyTimes();
        expect(mockTopology.isInSameBroadcastDomain(1L, (short)1,
                                                    1L, (short)2)).andReturn(true).anyTimes();
        expect(mockTopology.isInSameBroadcastDomain(1L, (short)2,
                                                    1L, (short)1)).andReturn(true).anyTimes();
        expect(mockTopology.isConsistent(anyLong(), anyShort(), anyLong(), anyShort())).andReturn(false).anyTimes();

        Date topologyUpdateTime = new Date();
        expect(mockTopology.getLastUpdateTime()).andReturn(topologyUpdateTime).
        anyTimes();

        replay(mockTopology);

        deviceManager.topology = mockTopology;
View Full Code Here

Examples of net.floodlightcontroller.topology.ITopologyService

     * one OFPP_LOCAL to another OFPP_LOCAL port.
     * @throws Exception
     */
    @Test
    public void testLOCALAttachmentPointLearning() throws Exception {
        ITopologyService mockTopology = createMock(ITopologyService.class);
        expect(mockTopology.getL2DomainId(anyLong())).
        andReturn(1L).anyTimes();
        expect(mockTopology.isAttachmentPointPort(anyLong(), anyShort())).
        andReturn(true).anyTimes();
        expect(mockTopology.isBroadcastDomainPort(1L, (short)1)).
        andReturn(false).anyTimes();
        expect(mockTopology.isBroadcastDomainPort(1L, OFPort.OFPP_LOCAL.getValue())).
        andReturn(false).anyTimes();
        expect(mockTopology.isBroadcastDomainPort(1L, (short)2)).
        andReturn(true).anyTimes();
        expect(mockTopology.isInSameBroadcastDomain(1L, (short)1,
                                                    1L, OFPort.OFPP_LOCAL.getValue())).andReturn(true).anyTimes();
        expect(mockTopology.isInSameBroadcastDomain(1L, OFPort.OFPP_LOCAL.getValue(),
                                                    1L, (short)2)).andReturn(true).anyTimes();
        expect(mockTopology.isInSameBroadcastDomain(1L, (short)2,
                                                    1L, OFPort.OFPP_LOCAL.getValue())).andReturn(true).anyTimes();
        expect(mockTopology.isConsistent(anyLong(), anyShort(), anyLong(), anyShort())).andReturn(false).anyTimes();

        Date topologyUpdateTime = new Date();
        expect(mockTopology.getLastUpdateTime()).andReturn(topologyUpdateTime).
        anyTimes();

        replay(mockTopology);

        deviceManager.topology = mockTopology;
View Full Code Here

Examples of net.floodlightcontroller.topology.ITopologyService

                ((Ethernet)this.testARPReplyPacket_1).getSourceMACAddress();
        OFPacketIn packetIn = testARPReplyPacketIn_1;
        Integer ipaddr = IPv4.toIPv4Address("192.168.1.1");

        // Mock up our expected behavior
        ITopologyService mockTopology = createMock(ITopologyService.class);
        deviceManager.topology = mockTopology;
        mockTopologyForPacketInTests(mockTopology);
        replay(mockTopology);

        FloodlightContext cntx = new FloodlightContext();
View Full Code Here

Examples of net.floodlightcontroller.topology.ITopologyService

                                .getSourceMACAddress());
        Integer ipaddr = IPv4.toIPv4Address("192.168.1.1");
        OFPacketIn packetIn = testARPReplyPacketIn_2;

        // Mock up our expected behavior
        ITopologyService mockTopology = createMock(ITopologyService.class);
        deviceManager.topology = mockTopology;
        mockTopologyForPacketInTests(mockTopology);
        replay(mockTopology);

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.