@Test public void positive() throws Exception { IOFSwitch sw = createMock(IOFSwitch.class); setupSwitchMock(sw, dpId); swWriteAlwaysSuccess(sw); doneWithSetUp(sw); CompletableFuture<Optional<OFMessage>> future; OFPacketOut pktOut = makePacketOut(sw.getOFFactory(), 1); try (Session session = subject.open(context, sw)) { future = session.write(pktOut); } Assert.assertFalse(future.isDone()); List<OFMessage> swActualWrite = swWriteMessages.getValues(); Assert.assertEquals(2, swActualWrite.size()); Assert.assertEquals(pktOut, swActualWrite.get(0)); Assert.assertEquals(OFType.BARRIER_REQUEST, swActualWrite.get(1).getType()); completeSessions(sw); Assert.assertTrue(future.isDone()); Optional<OFMessage> response = future.get(); Assert.assertFalse(response.isPresent()); }
public Session open(IOFSwitch sw) { return open(new MessageContext(), sw); }
SessionService implements IService, IInputTranslator { public Session open(IOFSwitch sw) { return open(new MessageContext(), sw); } }
SessionService implements IService, IInputTranslator { public Session open(IOFSwitch sw) { return open(new MessageContext(), sw); }  }
SessionService implements IService, IInputTranslator { public Session open(IOFSwitch sw) { return open(new MessageContext(), sw); }  Session open(IOFSwitch sw); Session open(MessageContext context, IOFSwitch sw); @Override void setup(FloodlightModuleContext moduleContext); @Override Command makeCommand(CommandContext context, OfInput input); }
SessionService implements IService, IInputTranslator { public Session open(IOFSwitch sw) { return open(new MessageContext(), sw); }  Session open(IOFSwitch sw); Session open(MessageContext context, IOFSwitch sw); @Override void setup(FloodlightModuleContext moduleContext); @Override Command makeCommand(CommandContext context, OfInput input);  }