test_class.declarator: packetIn
test_class.modifier: protected
test_class.original_string: protected OFPacketIn packetIn;
test_class.type: OFPacketIn
test_class.var_name: packetIn
test_class.declarator: testPacket
test_class.modifier: protected
test_class.original_string: protected IPacket testPacket;
test_class.type: IPacket
test_class.var_name: testPacket
test_class.declarator: testPacketSerialized
test_class.modifier: protected
test_class.original_string: protected byte[] testPacketSerialized;
test_class.type: byte[]
test_class.var_name: testPacketSerialized
test_class.declarator: mockFloodlightProvider
test_class.modifier: private
test_class.original_string: private   MockFloodlightProvider mockFloodlightProvider;
test_class.type: MockFloodlightProvider
test_class.var_name: mockFloodlightProvider
test_class.declarator: hub
test_class.modifier: private
test_class.original_string: private Hub hub;
test_class.type: Hub
test_class.var_name: hub
test_class.file: src/agents/apps/floodlight/floodlight-0.91/src/test/java/net/floodlightcontroller/hub/HubTest.java
test_class.identifier: HubTest
test_class.superclass: extends FloodlightTestCase
test_case.body: @Test
      public void testFloodNoBufferId() throws Exception {
          // build our expected flooded packetOut
          OFPacketOut po = ((OFPacketOut) mockFloodlightProvider.getOFMessageFactory().getMessage(OFType.PACKET_OUT))
              .setActions(Arrays.asList(new OFAction[] {new OFActionOutput().setPort(OFPort.OFPP_FLOOD.getValue())}))
              .setActionsLength((short) OFActionOutput.MINIMUM_LENGTH)
              .setBufferId(-1)
              .setInPort((short) 1)
              .setPacketData(this.testPacketSerialized);
          po.setLengthU(OFPacketOut.MINIMUM_LENGTH + po.getActionsLengthU()
                  + this.testPacketSerialized.length);
  
          // Mock up our expected behavior
          IOFSwitch mockSwitch = createMock(IOFSwitch.class);
          
          Capture<OFMessage> wc1 = new Capture<OFMessage>(CaptureType.ALL);
          Capture<FloodlightContext> bc1 = new Capture<FloodlightContext>(CaptureType.ALL);
          
          mockSwitch.write(capture(wc1), capture(bc1));
  
          // Start recording the replay on the mocks
          replay(mockSwitch);
          // Get the listener and trigger the packet in
          IOFMessageListener listener = mockFloodlightProvider.getListeners().get(
                  OFType.PACKET_IN).get(0);
          listener.receive(mockSwitch, this.packetIn,
                           parseAndAnnotate(this.packetIn));
  
          // Verify the replay matched our expectations
          verify(mockSwitch);
          
          assertTrue(wc1.hasCaptured());
          OFMessage m = wc1.getValue();
          assertEquals(po, m);
      }
test_case.class_method_signature: HubTest.testFloodNoBufferId()
test_case.full_signature: @Test public void testFloodNoBufferId()
test_case.identifier: testFloodNoBufferId
test_case.invocations: setPacketData setInPort setBufferId setActionsLength setActions getMessage getOFMessageFactory asList setPort getValue setLengthU getActionsLengthU createMock write capture capture replay get get getListeners receive parseAndAnnotate verify assertTrue hasCaptured getValue assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFloodNoBufferId()
focal_class.declarator: log = LoggerFactory.getLogger(Hub.class)
focal_class.modifier: protected static
focal_class.original_string: protected static Logger log = LoggerFactory.getLogger(Hub.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: floodlightProvider
focal_class.modifier: protected
focal_class.original_string: protected IFloodlightProviderService floodlightProvider;
focal_class.type: IFloodlightProviderService
focal_class.var_name: floodlightProvider
focal_class.file: src/agents/apps/floodlight/floodlight-0.91/src/main/java/net/floodlightcontroller/hub/Hub.java
focal_class.identifier: Hub
focal_class.interfaces: implements IFloodlightModule, IOFMessageListener
focal_class.class_method_signature: Hub.setFloodlightProvider(IFloodlightProviderService floodlightProvider)
focal_class.full_signature: public void setFloodlightProvider(IFloodlightProviderService floodlightProvider)
focal_class.identifier: setFloodlightProvider
focal_class.modifiers: public
focal_class.parameters: (IFloodlightProviderService floodlightProvider)
focal_class.return: void
focal_class.signature: void setFloodlightProvider(IFloodlightProviderService floodlightProvider)
focal_class.class_method_signature: Hub.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: Hub.receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_class.full_signature: public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_class.identifier: receive
focal_class.modifiers: public
focal_class.parameters: (IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_class.return: Command
focal_class.signature: Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_class.class_method_signature: Hub.isCallbackOrderingPrereq(OFType type, String name)
focal_class.full_signature: @Override public boolean isCallbackOrderingPrereq(OFType type, String name)
focal_class.identifier: isCallbackOrderingPrereq
focal_class.modifiers: @Override public
focal_class.parameters: (OFType type, String name)
focal_class.return: boolean
focal_class.signature: boolean isCallbackOrderingPrereq(OFType type, String name)
focal_class.class_method_signature: Hub.isCallbackOrderingPostreq(OFType type, String name)
focal_class.full_signature: @Override public boolean isCallbackOrderingPostreq(OFType type, String name)
focal_class.identifier: isCallbackOrderingPostreq
focal_class.modifiers: @Override public
focal_class.parameters: (OFType type, String name)
focal_class.return: boolean
focal_class.signature: boolean isCallbackOrderingPostreq(OFType type, String name)
focal_class.class_method_signature: Hub.getModuleServices()
focal_class.full_signature: @Override public Collection<Class<? extends IFloodlightService>> getModuleServices()
focal_class.identifier: getModuleServices
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<Class<? extends IFloodlightService>>
focal_class.signature: Collection<Class<? extends IFloodlightService>> getModuleServices()
focal_class.class_method_signature: Hub.getServiceImpls()
focal_class.full_signature: @Override public Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls()
focal_class.identifier: getServiceImpls
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<Class<? extends IFloodlightService>, IFloodlightService>
focal_class.signature: Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls()
focal_class.class_method_signature: Hub.getModuleDependencies()
focal_class.full_signature: @Override public Collection<Class<? extends IFloodlightService>> getModuleDependencies()
focal_class.identifier: getModuleDependencies
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<Class<? extends IFloodlightService>>
focal_class.signature: Collection<Class<? extends IFloodlightService>> getModuleDependencies()
focal_class.class_method_signature: Hub.init(FloodlightModuleContext context)
focal_class.full_signature: @Override public void init(FloodlightModuleContext context)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (FloodlightModuleContext context)
focal_class.return: void
focal_class.signature: void init(FloodlightModuleContext context)
focal_class.class_method_signature: Hub.startUp(FloodlightModuleContext context)
focal_class.full_signature: @Override public void startUp(FloodlightModuleContext context)
focal_class.identifier: startUp
focal_class.modifiers: @Override public
focal_class.parameters: (FloodlightModuleContext context)
focal_class.return: void
focal_class.signature: void startUp(FloodlightModuleContext context)
focal_method.body: public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
          OFPacketIn pi = (OFPacketIn) msg;
          OFPacketOut po = (OFPacketOut) floodlightProvider.getOFMessageFactory()
                  .getMessage(OFType.PACKET_OUT);
          po.setBufferId(pi.getBufferId())
              .setInPort(pi.getInPort());
  
          // set actions
          OFActionOutput action = new OFActionOutput()
              .setPort(OFPort.OFPP_FLOOD.getValue());
          po.setActions(Collections.singletonList((OFAction)action));
          po.setActionsLength((short) OFActionOutput.MINIMUM_LENGTH);
  
          // set data if is is included in the packetin
          if (pi.getBufferId() == OFPacketOut.BUFFER_ID_NONE) {
              byte[] packetData = pi.getPacketData();
              po.setLength(U16.t(OFPacketOut.MINIMUM_LENGTH
                      + po.getActionsLength() + packetData.length));
              po.setPacketData(packetData);
          } else {
              po.setLength(U16.t(OFPacketOut.MINIMUM_LENGTH
                      + po.getActionsLength()));
          }
          try {
              sw.write(po, cntx);
          } catch (IOException e) {
              log.error("Failure writing PacketOut", e);
          }
  
          return Command.CONTINUE;
      }
focal_method.class_method_signature: Hub.receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_method.full_signature: public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_method.identifier: receive
focal_method.invocations: getMessage getOFMessageFactory setInPort setBufferId getBufferId getInPort setPort getValue setActions singletonList setActionsLength getBufferId getPacketData setLength t getActionsLength setPacketData setLength t getActionsLength write error
focal_method.modifiers: public
focal_method.parameters: (IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_method.return: Command
focal_method.signature: Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)