/*
* Using the Tuscany Node API to load a contribution.
* Using the Tuscany Node API to get a local service proxy
*/
public void launchImplementationScriptCalculator(){
Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/implementation-script/calculator-contribution/target/sample-implementation-script-calculator-contribution.jar"));
node.start();
CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
// TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
double result = calculator.add(3, 2);
System.out.println("3 + 2 = " + result);
if (result != 5.0){
throw new SampleLauncherException();
}
node.stop();
}