@Test public void testOnSessionInitiated() throws Exception { Mockito.when(dataBroker.registerDataTreeChangeListener( Matchers.<DataTreeIdentifier<IseSourceConfig>>any(), Matchers.<GbpIseConfigListener>any())).thenReturn(registration); whenNew(SgtToEpgGeneratorImpl.class).withAnyArguments().thenReturn(generator1); whenNew(SgtToEPTemplateGeneratorImpl.class).withAnyArguments().thenReturn(generator2); whenNew(GbpIseSgtHarvesterImpl.class).withArguments(generator1, generator2).thenReturn(harvester); whenNew(GbpIseConfigListenerImpl.class).withAnyArguments().thenReturn(listener); whenNew(EPPolicyTemplateProviderIseImpl.class).withNoArguments().thenReturn(templateProvider); provider.onSessionInitiated(providerContext); Mockito.verify(templateProviderRegistry).registerTemplateProvider(templateProvider); verifyNew(SgtToEpgGeneratorImpl.class).withArguments(dataBroker); verifyNew(SgtToEPTemplateGeneratorImpl.class).withArguments(dataBroker); verifyNew(GbpIseSgtHarvesterImpl.class).withArguments(generator1, generator2); verifyNew(GbpIseConfigListenerImpl.class).withArguments(dataBroker, harvester, templateProvider); provider.close(); Mockito.verify(registration).close(); }
@Override public void onSessionInitiated(final BindingAwareBroker.ProviderContext providerContext) { LOG.info("Starting GbpIseAdapterProvider .."); final EPPolicyTemplateProviderFacade templateProviderFacade = new EPPolicyTemplateProviderIseImpl(); epPolicyTemplateProviderRegistration = sxpEpProvider.getEPPolicyTemplateProviderRegistry() .registerTemplateProvider(templateProviderFacade); final SgtInfoProcessor epgGenerator = new SgtToEpgGeneratorImpl(dataBroker); final SgtInfoProcessor templateGenerator = new SgtToEPTemplateGeneratorImpl(dataBroker); final GbpIseSgtHarvester gbpIseSgtHarvester = new GbpIseSgtHarvesterImpl(epgGenerator, templateGenerator); final GbpIseConfigListenerImpl gbpIseConfigListener = new GbpIseConfigListenerImpl( dataBroker, gbpIseSgtHarvester, templateProviderFacade); templateProviderFacade.setIseSgtHarvester(gbpIseSgtHarvester); final DataTreeIdentifier<IseSourceConfig> dataTreePath = new DataTreeIdentifier<>( LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(GbpSxpIseAdapter.class).child(IseSourceConfig.class)); registration = dataBroker.registerDataTreeChangeListener(dataTreePath, gbpIseConfigListener); LOG.info("Started"); }
GbpIseAdapterProvider implements AutoCloseable, BindingAwareProvider { @Override public void onSessionInitiated(final BindingAwareBroker.ProviderContext providerContext) { LOG.info("Starting GbpIseAdapterProvider .."); final EPPolicyTemplateProviderFacade templateProviderFacade = new EPPolicyTemplateProviderIseImpl(); epPolicyTemplateProviderRegistration = sxpEpProvider.getEPPolicyTemplateProviderRegistry() .registerTemplateProvider(templateProviderFacade); final SgtInfoProcessor epgGenerator = new SgtToEpgGeneratorImpl(dataBroker); final SgtInfoProcessor templateGenerator = new SgtToEPTemplateGeneratorImpl(dataBroker); final GbpIseSgtHarvester gbpIseSgtHarvester = new GbpIseSgtHarvesterImpl(epgGenerator, templateGenerator); final GbpIseConfigListenerImpl gbpIseConfigListener = new GbpIseConfigListenerImpl( dataBroker, gbpIseSgtHarvester, templateProviderFacade); templateProviderFacade.setIseSgtHarvester(gbpIseSgtHarvester); final DataTreeIdentifier<IseSourceConfig> dataTreePath = new DataTreeIdentifier<>( LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(GbpSxpIseAdapter.class).child(IseSourceConfig.class)); registration = dataBroker.registerDataTreeChangeListener(dataTreePath, gbpIseConfigListener); LOG.info("Started"); } }
GbpIseAdapterProvider implements AutoCloseable, BindingAwareProvider { @Override public void onSessionInitiated(final BindingAwareBroker.ProviderContext providerContext) { LOG.info("Starting GbpIseAdapterProvider .."); final EPPolicyTemplateProviderFacade templateProviderFacade = new EPPolicyTemplateProviderIseImpl(); epPolicyTemplateProviderRegistration = sxpEpProvider.getEPPolicyTemplateProviderRegistry() .registerTemplateProvider(templateProviderFacade); final SgtInfoProcessor epgGenerator = new SgtToEpgGeneratorImpl(dataBroker); final SgtInfoProcessor templateGenerator = new SgtToEPTemplateGeneratorImpl(dataBroker); final GbpIseSgtHarvester gbpIseSgtHarvester = new GbpIseSgtHarvesterImpl(epgGenerator, templateGenerator); final GbpIseConfigListenerImpl gbpIseConfigListener = new GbpIseConfigListenerImpl( dataBroker, gbpIseSgtHarvester, templateProviderFacade); templateProviderFacade.setIseSgtHarvester(gbpIseSgtHarvester); final DataTreeIdentifier<IseSourceConfig> dataTreePath = new DataTreeIdentifier<>( LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(GbpSxpIseAdapter.class).child(IseSourceConfig.class)); registration = dataBroker.registerDataTreeChangeListener(dataTreePath, gbpIseConfigListener); LOG.info("Started"); } GbpIseAdapterProvider(final DataBroker dataBroker, final BindingAwareBroker broker,
                                 final SxpEpProviderProvider sxpEpProvider); }
GbpIseAdapterProvider implements AutoCloseable, BindingAwareProvider { @Override public void onSessionInitiated(final BindingAwareBroker.ProviderContext providerContext) { LOG.info("Starting GbpIseAdapterProvider .."); final EPPolicyTemplateProviderFacade templateProviderFacade = new EPPolicyTemplateProviderIseImpl(); epPolicyTemplateProviderRegistration = sxpEpProvider.getEPPolicyTemplateProviderRegistry() .registerTemplateProvider(templateProviderFacade); final SgtInfoProcessor epgGenerator = new SgtToEpgGeneratorImpl(dataBroker); final SgtInfoProcessor templateGenerator = new SgtToEPTemplateGeneratorImpl(dataBroker); final GbpIseSgtHarvester gbpIseSgtHarvester = new GbpIseSgtHarvesterImpl(epgGenerator, templateGenerator); final GbpIseConfigListenerImpl gbpIseConfigListener = new GbpIseConfigListenerImpl( dataBroker, gbpIseSgtHarvester, templateProviderFacade); templateProviderFacade.setIseSgtHarvester(gbpIseSgtHarvester); final DataTreeIdentifier<IseSourceConfig> dataTreePath = new DataTreeIdentifier<>( LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(GbpSxpIseAdapter.class).child(IseSourceConfig.class)); registration = dataBroker.registerDataTreeChangeListener(dataTreePath, gbpIseConfigListener); LOG.info("Started"); } GbpIseAdapterProvider(final DataBroker dataBroker, final BindingAwareBroker broker,
                                 final SxpEpProviderProvider sxpEpProvider); @Override void close(); @Override void onSessionInitiated(final BindingAwareBroker.ProviderContext providerContext); }
GbpIseAdapterProvider implements AutoCloseable, BindingAwareProvider { @Override public void onSessionInitiated(final BindingAwareBroker.ProviderContext providerContext) { LOG.info("Starting GbpIseAdapterProvider .."); final EPPolicyTemplateProviderFacade templateProviderFacade = new EPPolicyTemplateProviderIseImpl(); epPolicyTemplateProviderRegistration = sxpEpProvider.getEPPolicyTemplateProviderRegistry() .registerTemplateProvider(templateProviderFacade); final SgtInfoProcessor epgGenerator = new SgtToEpgGeneratorImpl(dataBroker); final SgtInfoProcessor templateGenerator = new SgtToEPTemplateGeneratorImpl(dataBroker); final GbpIseSgtHarvester gbpIseSgtHarvester = new GbpIseSgtHarvesterImpl(epgGenerator, templateGenerator); final GbpIseConfigListenerImpl gbpIseConfigListener = new GbpIseConfigListenerImpl( dataBroker, gbpIseSgtHarvester, templateProviderFacade); templateProviderFacade.setIseSgtHarvester(gbpIseSgtHarvester); final DataTreeIdentifier<IseSourceConfig> dataTreePath = new DataTreeIdentifier<>( LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.create(GbpSxpIseAdapter.class).child(IseSourceConfig.class)); registration = dataBroker.registerDataTreeChangeListener(dataTreePath, gbpIseConfigListener); LOG.info("Started"); } GbpIseAdapterProvider(final DataBroker dataBroker, final BindingAwareBroker broker,
                                 final SxpEpProviderProvider sxpEpProvider); @Override void close(); @Override void onSessionInitiated(final BindingAwareBroker.ProviderContext providerContext);  }