Package org.apache.tuscany.sca.node

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


     *
     * @see junit.framework.TestCase#setUp()
     */
    protected void setUp() throws Exception
    {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        _scaDomain = nodeFactory.createSCANode("test.composite",
                                               new SCAContribution("crawler", "./target/classes"));
        assertNotNull(_scaDomain);
        _scaDomain.start();
        _controller = ((SCAClient)_scaDomain).getService(CrawlerController.class, "CrawlerControllerComponent");
        assertNotNull(_controller);
View Full Code Here


       
        try {
           
            System.out.println("Setting up nodes");
                 
            SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
            nodeA = nodeFactory.createSCANode(new File("src/main/resources/nodeA/CompositeA.composite").toURL().toString(),
                                             new SCAContribution("TestContribution",
                                                                 new File("src/main/resources/nodeA").toURL().toString()));
           
    
            nodeB = nodeFactory.createSCANode(new File("src/main/resources/nodeB/CompositeB.composite").toURL().toString(),
                                             new SCAContribution("TestContribution",
                                                                 new File("src/main/resources/nodeB").toURL().toString()));
           
           
            nodeA.start();
View Full Code Here

    private static HelloWorldService service;

    @BeforeClass
    public static void init() throws Exception {
        try {
            SCANodeFactory factory = SCANodeFactory.newInstance();
            node = factory.createSCANodeFromClassLoader("helloworld.composite",
                                                        TokenAuthTestCase.class.getClassLoader());
            node.start();
           
            service = ((SCAClient)node).getService(HelloWorldService.class, "HelloWorldClientComponent");
        } catch (Exception ex) {
View Full Code Here

    private static ConversationalClient conversationalStatefulClientNonConversationalCallbackStatelessService;   

    @BeforeClass
    public static void setUp() throws Exception {
        try {
            SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
            node = nodeFactory.createSCANode(new File("src/main/resources/Conversational/conversational.composite").toURL().toString(),
                                             new SCAContribution("TestContribution",
                                                                 new File("src/main/resources/Conversational").toURL().toString()));
                   
            
            node.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

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

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

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

        public void start() {
            threadContextClassLoader = Thread.currentThread().getContextClassLoader();
            boolean started = false;
            try {
                Thread.currentThread().setContextClassLoader(runtimeClassLoader);
                SCANodeFactory factory = SCANodeFactory.newInstance();
                node = factory.createSCANodeFromClassLoader("DomainManager.composite", getClass().getClassLoader());
                node.start();

                // Set the domain manager's root directory
                DomainManagerConfiguration domainManagerConfiguration = ((SCAClient) node).getService(DomainManagerConfiguration.class, "DomainManagerConfigurationComponent");
                domainManagerConfiguration.setRootDirectory(rootDirectory);
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.