use of org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext in project openflowplugin by opendaylight.
the class SalIntegrationTest method handshakeAndNodeUpdate.
/**
* test basic integration with OFLib running the handshake
*
* @throws Exception
*/
@Test
public void handshakeAndNodeUpdate() throws Exception {
final TestInventoryListener listener = new TestInventoryListener();
BindingAwareConsumer openflowConsumer = new BindingAwareConsumer() {
@Override
public void onSessionInitialized(ConsumerContext session) {
session.getSALService(NotificationService.class).registerNotificationListener(listener);
}
};
ConsumerContext consumerReg = broker.registerConsumer(openflowConsumer, ctx);
assertNotNull(consumerReg);
LOG.debug("handshake integration test");
LOG.debug("openflowPluginProvider: " + openflowPluginProvider);
switchSim.setSecuredClient(false);
ScenarioHandler scenario = new ScenarioHandler(ScenarioFactory.createHandshakeScenarioVBM(ScenarioFactory.VERSION_BITMAP_13, (short) 0, ScenarioFactory.VERSION_BITMAP_10_13, true));
switchSim.setScenarioHandler(scenario);
scenarioPool.execute(switchSim);
finalCheck = new Runnable() {
@Override
public void run() {
// FIXME: Enable the test -- It's requires EntityOnwershipService hook to the test
// assertEquals(1, listener.nodeUpdated.size());
assertEquals(0, listener.nodeUpdated.size());
// assertNotNull(listener.nodeUpdated.get(0));
}
};
}
use of org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext in project controller by opendaylight.
the class BindingContextUtils method createConsumerContextAndInitialize.
public static ConsumerContext createConsumerContextAndInitialize(BindingAwareConsumer consumer, ClassToInstanceMap<BindingAwareService> serviceProvider) {
ConsumerContext context = createConsumerContext(consumer, serviceProvider);
consumer.onSessionInitialized(context);
return context;
}
Aggregations