@Test public void testNoConfigurations() throws IOException, InvalidSyntaxException { TopologyEvent event = Mockito.mock(TopologyEvent.class); TopologyView view = Mockito.mock(TopologyView.class); Mockito.when(event.getNewView()).thenReturn(view); ConfigurationAdmin configAdmin = Mockito.mock(ConfigurationAdmin.class); Mockito.when(configAdmin.listConfigurations(Mockito.any())).thenReturn(null); ForwardAgentEndpointSynchronization sync = new ForwardAgentEndpointSynchronization(configAdmin, new ForwardAgentEndpointSynchronizationConfig() { @Override public Class<? extends Annotation> annotationType() { return null; } @Override public String agentTarget() { return null; } }); sync.handleTopologyEvent(event); assertFalse(false); }
@Override public void handleTopologyEvent(TopologyEvent event) { Set<InstanceDescription> renderers = event.getNewView().findInstances(id -> INSTANCE_TYPE.RENDERER.toString() .equals(id.getProperty(PublicationPropertyProvider.INSTANCE_TYPE))); updateInstances(renderers); }
ForwardAgentEndpointSynchronization implements TopologyEventListener { @Override public void handleTopologyEvent(TopologyEvent event) { Set<InstanceDescription> renderers = event.getNewView().findInstances(id -> INSTANCE_TYPE.RENDERER.toString() .equals(id.getProperty(PublicationPropertyProvider.INSTANCE_TYPE))); updateInstances(renderers); } }
ForwardAgentEndpointSynchronization implements TopologyEventListener { @Override public void handleTopologyEvent(TopologyEvent event) { Set<InstanceDescription> renderers = event.getNewView().findInstances(id -> INSTANCE_TYPE.RENDERER.toString() .equals(id.getProperty(PublicationPropertyProvider.INSTANCE_TYPE))); updateInstances(renderers); } @Activate  ForwardAgentEndpointSynchronization(@Reference ConfigurationAdmin configAdmin,
            ForwardAgentEndpointSynchronizationConfig config); }
ForwardAgentEndpointSynchronization implements TopologyEventListener { @Override public void handleTopologyEvent(TopologyEvent event) { Set<InstanceDescription> renderers = event.getNewView().findInstances(id -> INSTANCE_TYPE.RENDERER.toString() .equals(id.getProperty(PublicationPropertyProvider.INSTANCE_TYPE))); updateInstances(renderers); } @Activate  ForwardAgentEndpointSynchronization(@Reference ConfigurationAdmin configAdmin,
            ForwardAgentEndpointSynchronizationConfig config); @Override void handleTopologyEvent(TopologyEvent event); }
ForwardAgentEndpointSynchronization implements TopologyEventListener { @Override public void handleTopologyEvent(TopologyEvent event) { Set<InstanceDescription> renderers = event.getNewView().findInstances(id -> INSTANCE_TYPE.RENDERER.toString() .equals(id.getProperty(PublicationPropertyProvider.INSTANCE_TYPE))); updateInstances(renderers); } @Activate  ForwardAgentEndpointSynchronization(@Reference ConfigurationAdmin configAdmin,
            ForwardAgentEndpointSynchronizationConfig config); @Override void handleTopologyEvent(TopologyEvent event); static final String ENDPOINT_PROPERTY; }