本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}