@Test public void test() throws TopologyNotConfigureException, EasyESBException { TopologyConfigurator topologyConfigurator = new TopologyConfigurator(chor); topologyConfigurator.configureTopology(); verify(esbMock1, times(2)).addNeighbour(esbMock2); verify(esbMock2, times(2)).addNeighbour(esbMock1); verify(esbMock2).addNeighbour(esbMock3); verify(esbMock3).addNeighbour(esbMock2); verify(esbMock3).addNeighbour(esbMock4); verify(esbMock4).addNeighbour(esbMock3); }
public void configureTopology() throws TopologyNotConfigureException { for (DeployableService service : chor.getDeployableServices()) { for (ServiceInstance instance : service.getInstances()) { EasyESBNode esbNode = getESBNode(instance); List<ServiceDependency> dependencies = service.getSpec().getDependencies(); if (dependencies != null) { for (ServiceDependency dependency : dependencies) { DeployableService providingService = chor.getDeployableServiceBySpecName(dependency .getServiceSpecName()); for (ServiceInstance providingInstance : providingService.getInstances()) { EasyESBNode neighbourEsbNode = getESBNode(providingInstance); try { esbNode.addNeighbour(neighbourEsbNode); neighbourEsbNode.addNeighbour(esbNode); } catch (EasyESBException e) { throw new TopologyNotConfigureException(); } } } } } } }
TopologyConfigurator { public void configureTopology() throws TopologyNotConfigureException { for (DeployableService service : chor.getDeployableServices()) { for (ServiceInstance instance : service.getInstances()) { EasyESBNode esbNode = getESBNode(instance); List<ServiceDependency> dependencies = service.getSpec().getDependencies(); if (dependencies != null) { for (ServiceDependency dependency : dependencies) { DeployableService providingService = chor.getDeployableServiceBySpecName(dependency .getServiceSpecName()); for (ServiceInstance providingInstance : providingService.getInstances()) { EasyESBNode neighbourEsbNode = getESBNode(providingInstance); try { esbNode.addNeighbour(neighbourEsbNode); neighbourEsbNode.addNeighbour(esbNode); } catch (EasyESBException e) { throw new TopologyNotConfigureException(); } } } } } } } }
TopologyConfigurator { public void configureTopology() throws TopologyNotConfigureException { for (DeployableService service : chor.getDeployableServices()) { for (ServiceInstance instance : service.getInstances()) { EasyESBNode esbNode = getESBNode(instance); List<ServiceDependency> dependencies = service.getSpec().getDependencies(); if (dependencies != null) { for (ServiceDependency dependency : dependencies) { DeployableService providingService = chor.getDeployableServiceBySpecName(dependency .getServiceSpecName()); for (ServiceInstance providingInstance : providingService.getInstances()) { EasyESBNode neighbourEsbNode = getESBNode(providingInstance); try { esbNode.addNeighbour(neighbourEsbNode); neighbourEsbNode.addNeighbour(esbNode); } catch (EasyESBException e) { throw new TopologyNotConfigureException(); } } } } } } } TopologyConfigurator(Choreography chor); }
TopologyConfigurator { public void configureTopology() throws TopologyNotConfigureException { for (DeployableService service : chor.getDeployableServices()) { for (ServiceInstance instance : service.getInstances()) { EasyESBNode esbNode = getESBNode(instance); List<ServiceDependency> dependencies = service.getSpec().getDependencies(); if (dependencies != null) { for (ServiceDependency dependency : dependencies) { DeployableService providingService = chor.getDeployableServiceBySpecName(dependency .getServiceSpecName()); for (ServiceInstance providingInstance : providingService.getInstances()) { EasyESBNode neighbourEsbNode = getESBNode(providingInstance); try { esbNode.addNeighbour(neighbourEsbNode); neighbourEsbNode.addNeighbour(esbNode); } catch (EasyESBException e) { throw new TopologyNotConfigureException(); } } } } } } } TopologyConfigurator(Choreography chor); void configureTopology(); }
TopologyConfigurator { public void configureTopology() throws TopologyNotConfigureException { for (DeployableService service : chor.getDeployableServices()) { for (ServiceInstance instance : service.getInstances()) { EasyESBNode esbNode = getESBNode(instance); List<ServiceDependency> dependencies = service.getSpec().getDependencies(); if (dependencies != null) { for (ServiceDependency dependency : dependencies) { DeployableService providingService = chor.getDeployableServiceBySpecName(dependency .getServiceSpecName()); for (ServiceInstance providingInstance : providingService.getInstances()) { EasyESBNode neighbourEsbNode = getESBNode(providingInstance); try { esbNode.addNeighbour(neighbourEsbNode); neighbourEsbNode.addNeighbour(esbNode); } catch (EasyESBException e) { throw new TopologyNotConfigureException(); } } } } } } } TopologyConfigurator(Choreography chor); void configureTopology();  }