Package org.apache.tuscany.sca.node

Examples of org.apache.tuscany.sca.node.SCANodeFactory


           
            System.out.println("Setting up calculator nodes");
           
            ClassLoader cl = DomainInMemoryTestCase.class.getClassLoader();
           
            SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
           
            nodeA = nodeFactory.createSCANode("http://localhost:8085/nodeA", "http://localhost:9999");
            nodeA.addContribution("nodeA", cl.getResource("nodeA/"));
            nodeA.addToDomainLevelComposite(new QName("http://sample", "CalculatorA"));

           
            nodeB = nodeFactory.createSCANode("http://localhost:8086/nodeB", "http://localhost:9999");
            nodeB.addContribution("nodeB", cl.getResource("nodeB/"));
            nodeB.addToDomainLevelComposite(new QName("http://sample", "CalculatorB"));

           
            nodeC = nodeFactory.createSCANode("http://localhost:8087/nodeC", "http://localhost:9999");
            nodeC.addContribution("nodeC", cl.getResource("nodeC/"));
            nodeC.addToDomainLevelComposite(new QName("http://sample", "CalculatorC"));

           
            SCADomainFinder domainFinder = SCADomainFinder.newInstance();
View Full Code Here


        logger.log(Level.INFO, "SCA node starting");
       
        classLoader = new AddableURLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader());
        Thread.currentThread().setContextClassLoader(classLoader);
       
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        node = nodeFactory.createSCANode(nodeName, domainName);
        domain = node.getDomain();

        existingContributions = new HashMap<URL, Long>();
        URL[] contributions = getContributionJarURLs(repository);
        for (URL contribution : contributions) {
View Full Code Here

        SCANode node = null;
        try {
            String compositeFile = args[0];
            System.out.println("Composite: " + compositeFile);
           
            SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
            node = nodeFactory.createSCANode(null, "http://localhost:9999");

            ClassLoader classLoader = SCANodeLauncher.class.getClassLoader();
            URL contribution = SCAContributionUtil.findContributionFromResource(classLoader, compositeFile);
            node.addContribution(compositeFile, contribution);
           
View Full Code Here

           
            System.out.println("Setting up calculator nodes");
           
            ClassLoader cl = DomainDrivenTestCase.class.getClassLoader();
           
            SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
           
            nodeA = nodeFactory.createSCANode("http://localhost:8100/nodeA", "http://localhost:9999");          
            nodeB = nodeFactory.createSCANode("http://localhost:8200/nodeB", "http://localhost:9999");
            nodeC = nodeFactory.createSCANode("http://localhost:8300/nodeC", "http://localhost:9999");

            domain.addContribution("nodeA", cl.getResource("nodeA/"));
            domain.addContribution("nodeB", cl.getResource("nodeB/"));
            domain.addContribution("nodeC", cl.getResource("nodeC/"));
           
View Full Code Here

           
            System.out.println("Setting up calculator nodes");
           
            ClassLoader cl = NodeDrivenTestCase.class.getClassLoader();
           
            SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
           
            // sca-contribution.xml test
            nodeA = nodeFactory.createSCANode("http://localhost:8100/nodeA", "http://localhost:9999");
            nodeA.addContribution("nodeA", cl.getResource("nodeA/"));
            nodeA.addToDomainLevelComposite(new QName("http://sample", "CalculatorA"));

            // sca-deployables test
            nodeB = nodeFactory.createSCANode("http://localhost:8200/nodeB", "http://localhost:9999");
            nodeB.addContribution("nodeB", cl.getResource("nodeB/"));
            nodeB.addToDomainLevelComposite(new QName("http://sample", "CalculatorB"));

            // sca-deployables test
            nodeC = nodeFactory.createSCANode("http://localhost:8300/nodeC", "http://localhost:9999");
            nodeC.addContribution("nodeC", cl.getResource("nodeC/"));
            nodeC.addToDomainLevelComposite(new QName("http://sample", "CalculatorC"));
            nodeC.addToDomainLevelComposite(new QName("http://sample", "CalculatorC"));
           
            // start the domain
View Full Code Here

   
    //@Test
    public void testNodeMemoryUseage() throws Exception {  
       
        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();  
View Full Code Here

           
            System.out.println("Setting up nodes");
           
            cl = DomainAPITestCase.class.getClassLoader();
           
            SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
           
            nodeA = nodeFactory.createSCANode("http://localhost:8100/nodeA", "http://localhost:9999");          
            nodeB = nodeFactory.createSCANode("http://localhost:8200/nodeB", "http://localhost:9999");     
           
        } catch(Exception ex){
            ex.printStackTrace();
       
       
View Full Code Here

           
            System.out.println("Setting up nodes");
                 
            ClassLoader cl = CallableReferenceRemoteTestCase.class.getClassLoader();
           
            SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
           
            nodeA = nodeFactory.createSCANode("http://localhost:8100/nodeA", "http://localhost:9999");
            nodeA.addContribution("nodeA", cl.getResource("nodeA/"));
            nodeA.addToDomainLevelComposite(new QName("http://foo", "CompositeA"));

           
            nodeB = nodeFactory.createSCANode("http://localhost:8200/nodeB", "http://localhost:9999");
            nodeB.addContribution("nodeB", cl.getResource("nodeB/"));
            nodeB.addToDomainLevelComposite(new QName("http://foo", "CompositeB"));

            domain.start();
           
View Full Code Here

     * This method tests a proper destroy method. i.e., public, no arguments and
     * with void return type.
     */
    @Test
    public void atDestroyProper() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        SCANode node = nodeFactory.createSCANode(new File("src/main/resources/proper/AService.composite").toURL().toString(),
                new SCAContribution("TestContribution",
                                    new File("src/main/resources/proper").toURL().toString()));
        node.start();
        AService aService = ((SCAClient)node).getService(AService.class, "AComponent");
        Assert.assertEquals("Hello Pandu", aService.getGreetings("Pandu"));
View Full Code Here

     * This method tests that an exception is thrown when a protected method is
     * annotated with "@Destroy".
     */
    @Test
    public void atDestroyProtectedMethod() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        try {
            SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err1/AServiceErr1.composite").toURL().toString(),
                    new SCAContribution("TestContribution",
                                        new File("src/main/resources/err1").toURL().toString()));
            Assert.fail();
            node.stop();
        } catch(ServiceRuntimeException e) {
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.node.SCANodeFactory

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.