ClassLoader cl = NodeMemoryTestCase.class.getClassLoader();
SCANodeFactory nodeFactory;
SCANode node;
CalculatorService calculatorServiceB;
SubtractService subtractServiceC;
for(int i=0; i < 40; i++) {
nodeFactory = SCANodeFactory.newInstance();
node = nodeFactory.createSCANode("http://localhost:8200/node", null);
node.addContribution("nodeB", cl.getResource("nodeB/"));
node.addContribution("nodeC", cl.getResource("nodeC/"));
node.addToDomainLevelComposite(new QName("http://sample", "CalculatorB"));
node.addToDomainLevelComposite(new QName("http://sample", "CalculatorC"));
node.start();
calculatorServiceB = node.getDomain().getService(CalculatorService.class, "CalculatorServiceComponentB");
subtractServiceC = node.getDomain().getService(SubtractService.class, "SubtractServiceComponentC");
for(int j=0; j < 20; j++){
Assert.assertEquals(calculatorServiceB.subtract(3, 2), 1.0);
Assert.assertEquals(subtractServiceC.subtract(3, 2), 1.0);
}
node.destroy();
}