Package calculator

Examples of calculator.SubtractService


       
        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();
        }
       
View Full Code Here

TOP

Related Classes of calculator.SubtractService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.