@Test public void shouldCastContextToSampleChor() throws ContextNotSentException { SampleChoreography sample = new SampleChoreography(); Choreography chor = sample.getChoreography(); ContextSender sender = mock(ContextSender.class); ContextSenderFactory.testing = true; ContextSenderFactory.senderForTesting = sender; ContextCaster caster = new ContextCaster(chor); caster.cast(); for (DeployableServiceSpec spec : chor.getChoreographySpec().getDeployableServiceSpecs()) { String consumerUri = sample.getUri(spec.getName()); if (spec.getDependencies() != null) { for (ServiceDependency dep : spec.getDependencies()) { String providerName = dep.getServiceSpecName(); String providerUri = sample.getUri(providerName); verify(sender).sendContext(consumerUri, sample.getRole(), providerName, Collections.singletonList(providerUri)); } } } }
public void cast() { if (!inputOK()) { logger.warn("No deployed services found. Not going to cast context."); return; } int nThreads = getNThreads(); this.executor = Executors.newFixedThreadPool(nThreads); logger.info("Passing context to deployed services on choreograghy " + chor.getId()); for (Service consumer : chor.getServices()) { castContextsToConsumer(consumer); } waitContextCasting(); }
ContextCaster { public void cast() { if (!inputOK()) { logger.warn("No deployed services found. Not going to cast context."); return; } int nThreads = getNThreads(); this.executor = Executors.newFixedThreadPool(nThreads); logger.info("Passing context to deployed services on choreograghy " + chor.getId()); for (Service consumer : chor.getServices()) { castContextsToConsumer(consumer); } waitContextCasting(); } }
ContextCaster { public void cast() { if (!inputOK()) { logger.warn("No deployed services found. Not going to cast context."); return; } int nThreads = getNThreads(); this.executor = Executors.newFixedThreadPool(nThreads); logger.info("Passing context to deployed services on choreograghy " + chor.getId()); for (Service consumer : chor.getServices()) { castContextsToConsumer(consumer); } waitContextCasting(); } ContextCaster(Choreography chor); }
ContextCaster { public void cast() { if (!inputOK()) { logger.warn("No deployed services found. Not going to cast context."); return; } int nThreads = getNThreads(); this.executor = Executors.newFixedThreadPool(nThreads); logger.info("Passing context to deployed services on choreograghy " + chor.getId()); for (Service consumer : chor.getServices()) { castContextsToConsumer(consumer); } waitContextCasting(); } ContextCaster(Choreography chor); void cast(); }
ContextCaster { public void cast() { if (!inputOK()) { logger.warn("No deployed services found. Not going to cast context."); return; } int nThreads = getNThreads(); this.executor = Executors.newFixedThreadPool(nThreads); logger.info("Passing context to deployed services on choreograghy " + chor.getId()); for (Service consumer : chor.getServices()) { castContextsToConsumer(consumer); } waitContextCasting(); } ContextCaster(Choreography chor); void cast();  }