Examples of OFDescriptionStatistics


Examples of org.openflow.protocol.statistics.OFDescriptionStatistics

        replay(listener);


        OFFeaturesReply featuresReply = createOFFeaturesReply();
        featuresReply.setDatapathId(42L);
        OFDescriptionStatistics desc = createOFDescriptionStatistics();
        SwitchSyncRepresentation ssr =
                new SwitchSyncRepresentation(featuresReply, desc);
        storeClient.put(1L, ssr);

        Iterator<Long> keysToNotify = Collections.singletonList(1L).iterator();
View Full Code Here

Examples of org.openflow.protocol.statistics.OFDescriptionStatistics

     * two different switches have the same DPIP or if a switch reconnects
     * while the old TCP connection is still alive
     */
    @Test
    public void testSwitchActivatedWithAlreadyActiveSwitch() throws Exception {
        OFDescriptionStatistics oldDesc = createOFDescriptionStatistics();
        oldDesc.setDatapathDescription("Ye Olde Switch");
        OFDescriptionStatistics newDesc = createOFDescriptionStatistics();
        newDesc.setDatapathDescription("The new Switch");
        OFFeaturesReply featuresReply = createOFFeaturesReply();


        // Setup: add a switch to the controller
        IOFSwitch oldsw = createMock(IOFSwitch.class);
View Full Code Here

Examples of org.openflow.protocol.statistics.OFDescriptionStatistics

       fr1.setDatapathId(dpid);
       OFPhysicalPort p2 = createOFPhysicalPort("Port1", 1);
       p2.setAdvertisedFeatures(0x2); // just some bogus values
       fr2.setPorts(Collections.singletonList(p2));

       OFDescriptionStatistics desc = createOFDescriptionStatistics();

       // activate switch
       IOFSwitch sw = doActivateNewSwitch(dpid, desc, fr1);

       // check the store
View Full Code Here

Examples of org.openflow.protocol.statistics.OFDescriptionStatistics

        replay(driver1);
        replay(driver2);
        replay(driver3);
        replay(mockSwitch);

        OFDescriptionStatistics desc = createOFDescriptionStatistics();
        desc.setManufacturerDescription("test switch");
        desc.setHardwareDescription("version 0.9");
        reset(driver1);
        reset(driver2);
        reset(driver3);
        reset(mockSwitch);
        mockSwitch.setSwitchProperties(desc);
        expectLastCall().once();
        expect(driver1.getOFSwitchImpl(desc)).andReturn(mockSwitch).once();
        replay(driver1);
        replay(driver2);
        replay(driver3);
        replay(mockSwitch);
        returnedSwitch = controller.getOFSwitchInstance(desc);
        assertSame(mockSwitch, returnedSwitch);
        verify(driver1);
        verify(driver2);
        verify(driver3);
        verify(mockSwitch);

        desc = createOFDescriptionStatistics();
        desc.setManufacturerDescription("testFooBar");
        desc.setHardwareDescription("version 0.9");
        reset(driver1);
        reset(driver2);
        reset(driver3);
        reset(mockSwitch);
        mockSwitch.setSwitchProperties(desc);
        expectLastCall().once();
        expect(driver2.getOFSwitchImpl(desc)).andReturn(mockSwitch).once();
        replay(driver1);
        replay(driver2);
        replay(driver3);
        replay(mockSwitch);
        returnedSwitch = controller.getOFSwitchInstance(desc);
        assertSame(mockSwitch, returnedSwitch);
        verify(driver1);
        verify(driver2);
        verify(driver3);
        verify(mockSwitch);

        desc = createOFDescriptionStatistics();
        desc.setManufacturerDescription("FooBar");
        desc.setHardwareDescription("version 0.9");
        reset(driver1);
        reset(driver2);
        reset(driver3);
        reset(mockSwitch);
        mockSwitch.setSwitchProperties(desc);
View Full Code Here

Examples of org.openflow.protocol.statistics.OFDescriptionStatistics

        controller.addOFSwitchDriver("test switch", driver);

        replay(driver);
        replay(mockSwitch);

        OFDescriptionStatistics desc = createOFDescriptionStatistics();
        desc.setManufacturerDescription("test switch");
        desc.setHardwareDescription("version 0.9");
        reset(driver);
        reset(mockSwitch);
        mockSwitch.setSwitchProperties(desc);
        expectLastCall().once();
        expect(driver.getOFSwitchImpl(desc)).andReturn(mockSwitch).once();
        replay(driver);
        replay(mockSwitch);
        returnedSwitch = controller.getOFSwitchInstance(desc);
        assertSame(mockSwitch, returnedSwitch);
        verify(driver);
        verify(mockSwitch);


        desc = createOFDescriptionStatistics();
        desc.setManufacturerDescription("Foo Bar test switch");
        desc.setHardwareDescription("version 0.9");
        reset(driver);
        reset(mockSwitch);
        replay(driver);
        replay(mockSwitch);
        returnedSwitch = controller.getOFSwitchInstance(desc);
View Full Code Here

Examples of org.openflow.protocol.statistics.OFDescriptionStatistics

            fail("Expected IllegalStateException not thrown");
        } catch (IllegalStateException e) {
            //expected
        }

        OFDescriptionStatistics desc = createOFDescriptionStatistics();

        desc.setDatapathDescription(null);
        try {
            controller.getOFSwitchInstance(desc);
            fail("Expected NullPointerException not thrown");
        } catch (NullPointerException e) {
            //expected
        }
        desc.setHardwareDescription(null);
        try {
            controller.getOFSwitchInstance(desc);
            fail("Expected NullPointerException not thrown");
        } catch (NullPointerException e) {
            //expected
        }
        desc.setManufacturerDescription(null);
        try {
            controller.getOFSwitchInstance(desc);
            fail("Expected NullPointerException not thrown");
        } catch (NullPointerException e) {
            //expected
        }
        desc.setSerialNumber(null);
        try {
            controller.getOFSwitchInstance(desc);
            fail("Expected NullPointerException not thrown");
        } catch (NullPointerException e) {
            //expected
        }
        desc.setSoftwareDescription(null);
        try {
            controller.getOFSwitchInstance(desc);
            fail("Expected NullPointerException not thrown");
        } catch (NullPointerException e) {
            //expected
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.