当前位置: 首页>>代码示例>>Java>>正文


Java IUpdate类代码示例

本文整理汇总了Java中net.floodlightcontroller.core.internal.Controller.IUpdate的典型用法代码示例。如果您正苦于以下问题:Java IUpdate类的具体用法?Java IUpdate怎么用?Java IUpdate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IUpdate类属于net.floodlightcontroller.core.internal.Controller包,在下文中一共展示了IUpdate类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSetRole

import net.floodlightcontroller.core.internal.Controller.IUpdate; //导入依赖的package包/类
@Test 
public void testSetRole() {
    controller.connectedSwitches.add(new OFSwitchImpl());
    RoleChanger roleChanger = createMock(RoleChanger.class); 
    roleChanger.submitRequest(controller.connectedSwitches, Role.SLAVE);
    controller.roleChanger = roleChanger;
    
    assertEquals("Check that update queue is empty", 0, 
                controller.updates.size());
    
    replay(roleChanger);
    controller.setRole(Role.SLAVE);
    verify(roleChanger);
    
    Controller.IUpdate upd = controller.updates.poll();
    assertNotNull("Check that update queue has an update", upd);
    assertTrue("Check that update is HARoleUpdate", 
               upd instanceof Controller.HARoleUpdate);
    Controller.HARoleUpdate roleUpd = (Controller.HARoleUpdate)upd;
    assertSame(null, roleUpd.oldRole);
    assertSame(Role.SLAVE, roleUpd.newRole);
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:23,代码来源:ControllerTest.java

示例2: testSetRole

import net.floodlightcontroller.core.internal.Controller.IUpdate; //导入依赖的package包/类
@Test
public void testSetRole() {
    controller.connectedSwitches.add(new OFSwitchImpl());
    RoleChanger roleChanger = createMock(RoleChanger.class);
    roleChanger.submitRequest(controller.connectedSwitches, Role.SLAVE);
    controller.roleChanger = roleChanger;

    assertEquals("Check that update queue is empty", 0,
                controller.updates.size());

    replay(roleChanger);
    controller.setRole(Role.SLAVE, "Testing");
    controller.doSetRole(); // avoid wait
    verify(roleChanger);

    Controller.IUpdate upd = controller.updates.poll();
    assertNotNull("Check that update queue has an update", upd);
    assertTrue("Check that update is HARoleUpdate",
               upd instanceof Controller.HARoleUpdate);
    Controller.HARoleUpdate roleUpd = (Controller.HARoleUpdate)upd;
    assertSame(Role.MASTER, roleUpd.oldRole);
    assertSame(Role.SLAVE, roleUpd.newRole);
}
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:24,代码来源:ControllerTest.java

示例3: testSetRole

import net.floodlightcontroller.core.internal.Controller.IUpdate; //导入依赖的package包/类
@Test 
public void testSetRole() {
    controller.connectedSwitches.add(new OFSwitchImpl());
    RoleChanger roleChanger = createMock(RoleChanger.class); 
    roleChanger.submitRequest(controller.connectedSwitches, Role.SLAVE);
    controller.roleChanger = roleChanger;
    
    assertEquals("Check that update queue is empty", 0, 
                controller.updates.size());
    
    replay(roleChanger);
    controller.setRole(Role.SLAVE);
    controller.doSetRole(); // avoid wait
    verify(roleChanger);
    
    Controller.IUpdate upd = controller.updates.poll();
    assertNotNull("Check that update queue has an update", upd);
    assertTrue("Check that update is HARoleUpdate", 
               upd instanceof Controller.HARoleUpdate);
    Controller.HARoleUpdate roleUpd = (Controller.HARoleUpdate)upd;
    assertSame(Role.MASTER, roleUpd.oldRole);
    assertSame(Role.SLAVE, roleUpd.newRole);
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:24,代码来源:ControllerTest.java

示例4: addUpdateToQueue

import net.floodlightcontroller.core.internal.Controller.IUpdate; //导入依赖的package包/类
@Override
public void addUpdateToQueue(final IUpdate update) {
    if (useAsyncUpdates) {
        mostRecentUpdateFuture = executorService.submit(new Runnable() {
            @Override
            public void run() {
                update.dispatch();
            }
        });
    } else {
        update.dispatch();
    }
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:14,代码来源:MockFloodlightProvider.java

示例5: transitionToActive

import net.floodlightcontroller.core.internal.Controller.IUpdate; //导入依赖的package包/类
/**
 * Dispatches a new role change notification
 * @param oldRole
 * @param newRole
 */
public void transitionToActive() {
    IUpdate update = new IUpdate() {
        @Override
        public void dispatch() {
            for (IHAListener rl : haListeners.getOrderedListeners()) {
                rl.transitionToActive();
            }
        }
    };
    addUpdateToQueue(update);
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:17,代码来源:MockFloodlightProvider.java

示例6: setRoleAndMockController

import net.floodlightcontroller.core.internal.Controller.IUpdate; //导入依赖的package包/类
/**
 * Helper method that mocks up the controller and sets the supplied role
 * @param role the desired role to pass to setRole
 */
private void setRoleAndMockController(HARole role) {
    reset(controller);
    controller.addUpdateToQueue(anyObject(IUpdate.class));
    expectLastCall().anyTimes();
    replay(controller);

    roleManager.setRole(role, "test");
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:13,代码来源:RoleManagerTest.java


注:本文中的net.floodlightcontroller.core.internal.Controller.IUpdate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。