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


Java DebugCounterServiceImpl.registerModule方法代码示例

本文整理汇总了Java中net.floodlightcontroller.debugcounter.DebugCounterServiceImpl.registerModule方法的典型用法代码示例。如果您正苦于以下问题:Java DebugCounterServiceImpl.registerModule方法的具体用法?Java DebugCounterServiceImpl.registerModule怎么用?Java DebugCounterServiceImpl.registerModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.floodlightcontroller.debugcounter.DebugCounterServiceImpl的用法示例。


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

示例1: setUp

import net.floodlightcontroller.debugcounter.DebugCounterServiceImpl; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
	setUpFeaturesReply();
	switchManager = createMock(IOFSwitchManager.class);
	connectionListener = createMock(IOFConnectionListener.class);
	newConnectionListener = createMock(INewOFConnectionListener.class);
	newConnection = new Capture<IOFConnectionBackend>();
	newFeaturesReply = new Capture<OFFeaturesReply>();
       eventLoop = new TestEventLoop();

	ctx = createMock(ChannelHandlerContext.class);
	channel = createMock(Channel.class);
	timer = new HashedWheelTimer();
	exceptionEventCapture = new Capture<Throwable>(CaptureType.ALL);
	pipeline = createMock(ChannelPipeline.class);
	writeCapture = new Capture<List<OFMessage>>(CaptureType.ALL);
	seenXids = null;


	// TODO: should mock IDebugCounterService and make sure
	// the expected counters are updated.
	debugCounterService = new DebugCounterServiceImpl();
	debugCounterService.registerModule(OFConnectionCounters.COUNTER_MODULE);
	SwitchManagerCounters counters =
			new SwitchManagerCounters(debugCounterService);
	expect(switchManager.getCounters()).andReturn(counters).anyTimes();
	replay(switchManager);
	handler = new OFChannelHandler(switchManager, newConnectionListener,
			pipeline, debugCounterService, /* 62 is OF versions 1.0 thru 1.4 in decimal */
			timer, Collections.singletonList(U32.of(62)), OFFactories.getFactory(OFVersion.OF_14));

	verify(switchManager);
	reset(switchManager);

	resetChannel();

	// replay controller. Reset it if you need more specific behavior
	replay(switchManager);

	// Mock ctx and channelStateEvent
	expect(ctx.channel()).andReturn(channel).anyTimes();
	expect(ctx.fireExceptionCaught(capture(exceptionEventCapture))).andReturn(ctx).anyTimes();
	replay(ctx);

	/* Setup an exception event capture on the channel. Right now
	 * we only expect exception events to be send up the channel.
	 * However, it's easy to extend to other events if we need it
	 */
	expect(pipeline.get(OFMessageDecoder.class)).andReturn(new OFMessageDecoder()).anyTimes();
	replay(pipeline);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:52,代码来源:OFChannelHandlerVer13Test.java

示例2: setUp

import net.floodlightcontroller.debugcounter.DebugCounterServiceImpl; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
	setUpFeaturesReply();
    switchManager = createMock(IOFSwitchManager.class);
    connectionListener = createMock(IOFConnectionListener.class);
    newConnectionListener = createMock(INewOFConnectionListener.class);
    newConnection = new Capture<IOFConnectionBackend>();
    newFeaturesReply = new Capture<OFFeaturesReply>();
    eventLoop = new TestEventLoop();

    ctx = createMock(ChannelHandlerContext.class);
    channel = createMock(Channel.class);
    timer = new HashedWheelTimer();
    exceptionEventCapture = new Capture<Throwable>(CaptureType.ALL);
    pipeline = createMock(ChannelPipeline.class);
    writeCapture = new Capture<List<OFMessage>>(CaptureType.ALL);
    seenXids = null;

    // TODO: should mock IDebugCounterService and make sure
    // the expected counters are updated.
    debugCounterService = new DebugCounterServiceImpl();
    debugCounterService.registerModule(OFConnectionCounters.COUNTER_MODULE);
    SwitchManagerCounters counters =
            new SwitchManagerCounters(debugCounterService);
    expect(switchManager.getCounters()).andReturn(counters).anyTimes();
    replay(switchManager);
    handler = new OFChannelHandler(switchManager, newConnectionListener,
                                   pipeline, debugCounterService,
                                   timer, Collections.singletonList(U32.of(0)), OFFactories.getFactory(OFVersion.OF_14));
    verify(switchManager);
    reset(switchManager);

    resetChannel();

    // replay controller. Reset it if you need more specific behavior
    replay(switchManager);

    // Mock ctx and channelStateEvent
    expect(ctx.channel()).andReturn(channel).anyTimes();
    expect(ctx.fireExceptionCaught(capture(exceptionEventCapture))).andReturn(ctx).anyTimes();
    replay(ctx);

    /* Setup an exception event capture on the channel. Right now
     * we only expect exception events to be send up the channel.
     * However, it's easy to extend to other events if we need it
     */
    expect(pipeline.get(OFMessageDecoder.class)).andReturn(new OFMessageDecoder()).anyTimes();
    replay(pipeline);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:50,代码来源:OFChannelHandlerVer10Test.java

示例3: setUp

import net.floodlightcontroller.debugcounter.DebugCounterServiceImpl; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    switchManager = createMock(IOFSwitchManager.class);
    connectionListener = createMock(IOFConnectionListener.class);
    newConnectionListener = createMock(INewOFConnectionListener.class);
    newConnection = new Capture<IOFConnectionBackend>();
    newFeaturesReply = new Capture<OFFeaturesReply>();

    ctx = createMock(ChannelHandlerContext.class);
    channelStateEvent = createMock(ChannelStateEvent.class);
    channel = createMock(Channel.class);
    timer = new HashedWheelTimer();
    messageEvent = createMock(MessageEvent.class);
    exceptionEventCapture = new Capture<ExceptionEvent>(CaptureType.ALL);
    pipeline = createMock(ChannelPipeline.class);
    writeCapture = new Capture<List<OFMessage>>(CaptureType.ALL);
    seenXids = null;


    // TODO: should mock IDebugCounterService and make sure
    // the expected counters are updated.
    debugCounterService = new DebugCounterServiceImpl();
    debugCounterService.registerModule(OFConnectionCounters.COUNTER_MODULE);
    SwitchManagerCounters counters =
            new SwitchManagerCounters(debugCounterService);
    expect(switchManager.getCounters()).andReturn(counters).anyTimes();
    replay(switchManager);
    handler = new OFChannelHandler(switchManager, newConnectionListener,
                                   pipeline, debugCounterService, timer);
    verify(switchManager);
    reset(switchManager);

    resetChannel();

    // replay controller. Reset it if you need more specific behavior
    replay(switchManager);

    // Mock ctx and channelStateEvent
    expect(ctx.getChannel()).andReturn(channel).anyTimes();
    expect(channelStateEvent.getChannel()).andReturn(channel).anyTimes();
    replay(ctx, channelStateEvent);

    /* Setup an exception event capture on the channel. Right now
     * we only expect exception events to be send up the channel.
     * However, it's easy to extend to other events if we need it
     */
    pipeline.sendUpstream(capture(exceptionEventCapture));
    expectLastCall().anyTimes();
    expect(pipeline.get(OFMessageDecoder.class)).andReturn(new OFMessageDecoder()).anyTimes();
    replay(pipeline);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:52,代码来源:OFChannelHandlerVer13Test.java

示例4: setUp

import net.floodlightcontroller.debugcounter.DebugCounterServiceImpl; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    switchManager = createMock(IOFSwitchManager.class);
    connectionListener = createMock(IOFConnectionListener.class);
    newConnectionListener = createMock(INewOFConnectionListener.class);
    newConnection = new Capture<IOFConnectionBackend>();
    newFeaturesReply = new Capture<OFFeaturesReply>();

    ctx = createMock(ChannelHandlerContext.class);
    channelStateEvent = createMock(ChannelStateEvent.class);
    channel = createMock(Channel.class);
    timer = new HashedWheelTimer();
    messageEvent = createMock(MessageEvent.class);
    exceptionEventCapture = new Capture<ExceptionEvent>(CaptureType.ALL);
    pipeline = createMock(ChannelPipeline.class);
    writeCapture = new Capture<List<OFMessage>>(CaptureType.ALL);
    seenXids = null;

    // TODO: should mock IDebugCounterService and make sure
    // the expected counters are updated.
    debugCounterService = new DebugCounterServiceImpl();
    debugCounterService.registerModule(OFConnectionCounters.COUNTER_MODULE);
    SwitchManagerCounters counters =
            new SwitchManagerCounters(debugCounterService);
    expect(switchManager.getCounters()).andReturn(counters).anyTimes();
    replay(switchManager);
    handler = new OFChannelHandler(switchManager, newConnectionListener,
                                   pipeline, debugCounterService,
                                   timer);
    verify(switchManager);
    reset(switchManager);

    resetChannel();

    // replay controller. Reset it if you need more specific behavior
    replay(switchManager);

    // Mock ctx and channelStateEvent
    expect(ctx.getChannel()).andReturn(channel).anyTimes();
    expect(channelStateEvent.getChannel()).andReturn(channel).anyTimes();
    replay(ctx, channelStateEvent);

    /* Setup an exception event capture on the channel. Right now
     * we only expect exception events to be send up the channel.
     * However, it's easy to extend to other events if we need it
     */
    pipeline.sendUpstream(capture(exceptionEventCapture));
    expectLastCall().anyTimes();
    expect(pipeline.get(OFMessageDecoder.class)).andReturn(new OFMessageDecoder()).anyTimes();
    replay(pipeline);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:52,代码来源:OFChannelHandlerVer10Test.java

示例5: setUp

import net.floodlightcontroller.debugcounter.DebugCounterServiceImpl; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
	setUpFeaturesReply();
    switchManager = createMock(IOFSwitchManager.class);
    connectionListener = createMock(IOFConnectionListener.class);
    newConnectionListener = createMock(INewOFConnectionListener.class);
    newConnection = new Capture<IOFConnectionBackend>();
    newFeaturesReply = new Capture<OFFeaturesReply>();

    ctx = createMock(ChannelHandlerContext.class);
    channelStateEvent = createMock(ChannelStateEvent.class);
    channel = createMock(Channel.class);
    timer = new HashedWheelTimer();
    messageEvent = createMock(MessageEvent.class);
    exceptionEventCapture = new Capture<ExceptionEvent>(CaptureType.ALL);
    pipeline = createMock(ChannelPipeline.class);
    writeCapture = new Capture<List<OFMessage>>(CaptureType.ALL);
    seenXids = null;


    // TODO: should mock IDebugCounterService and make sure
    // the expected counters are updated.
    debugCounterService = new DebugCounterServiceImpl();
    debugCounterService.registerModule(OFConnectionCounters.COUNTER_MODULE);
    SwitchManagerCounters counters =
            new SwitchManagerCounters(debugCounterService);
    expect(switchManager.getCounters()).andReturn(counters).anyTimes();
    replay(switchManager);
    handler = new OFChannelHandler(switchManager, newConnectionListener,
                                   pipeline, debugCounterService, /* 62 is OF versions 1.0 thru 1.4 in decimal */
                                   timer, Collections.singletonList(U32.of(62)), OFFactories.getFactory(OFVersion.OF_14));

    verify(switchManager);
    reset(switchManager);

    resetChannel();

    // replay controller. Reset it if you need more specific behavior
    replay(switchManager);

    // Mock ctx and channelStateEvent
    expect(ctx.getChannel()).andReturn(channel).anyTimes();
    expect(channelStateEvent.getChannel()).andReturn(channel).anyTimes();
    replay(ctx, channelStateEvent);

    /* Setup an exception event capture on the channel. Right now
     * we only expect exception events to be send up the channel.
     * However, it's easy to extend to other events if we need it
     */
    pipeline.sendUpstream(capture(exceptionEventCapture));
    expectLastCall().anyTimes();
    expect(pipeline.get(OFMessageDecoder.class)).andReturn(new OFMessageDecoder()).anyTimes();
    replay(pipeline);
}
 
开发者ID:rhoybeen,项目名称:floodlightLB,代码行数:55,代码来源:OFChannelHandlerVer13Test.java

示例6: setUp

import net.floodlightcontroller.debugcounter.DebugCounterServiceImpl; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
	setUpFeaturesReply();
    switchManager = createMock(IOFSwitchManager.class);
    connectionListener = createMock(IOFConnectionListener.class);
    newConnectionListener = createMock(INewOFConnectionListener.class);
    newConnection = new Capture<IOFConnectionBackend>();
    newFeaturesReply = new Capture<OFFeaturesReply>();

    ctx = createMock(ChannelHandlerContext.class);
    channelStateEvent = createMock(ChannelStateEvent.class);
    channel = createMock(Channel.class);
    timer = new HashedWheelTimer();
    messageEvent = createMock(MessageEvent.class);
    exceptionEventCapture = new Capture<ExceptionEvent>(CaptureType.ALL);
    pipeline = createMock(ChannelPipeline.class);
    writeCapture = new Capture<List<OFMessage>>(CaptureType.ALL);
    seenXids = null;

    // TODO: should mock IDebugCounterService and make sure
    // the expected counters are updated.
    debugCounterService = new DebugCounterServiceImpl();
    debugCounterService.registerModule(OFConnectionCounters.COUNTER_MODULE);
    SwitchManagerCounters counters =
            new SwitchManagerCounters(debugCounterService);
    expect(switchManager.getCounters()).andReturn(counters).anyTimes();
    replay(switchManager);
    handler = new OFChannelHandler(switchManager, newConnectionListener,
                                   pipeline, debugCounterService,
                                   timer, Collections.singletonList(U32.of(0)), OFFactories.getFactory(OFVersion.OF_14));
    verify(switchManager);
    reset(switchManager);

    resetChannel();

    // replay controller. Reset it if you need more specific behavior
    replay(switchManager);

    // Mock ctx and channelStateEvent
    expect(ctx.getChannel()).andReturn(channel).anyTimes();
    expect(channelStateEvent.getChannel()).andReturn(channel).anyTimes();
    replay(ctx, channelStateEvent);

    /* Setup an exception event capture on the channel. Right now
     * we only expect exception events to be send up the channel.
     * However, it's easy to extend to other events if we need it
     */
    pipeline.sendUpstream(capture(exceptionEventCapture));
    expectLastCall().anyTimes();
    expect(pipeline.get(OFMessageDecoder.class)).andReturn(new OFMessageDecoder()).anyTimes();
    replay(pipeline);
}
 
开发者ID:rhoybeen,项目名称:floodlightLB,代码行数:53,代码来源:OFChannelHandlerVer10Test.java


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