summaryrefslogtreecommitdiffstats
path: root/java/sca-contrib/itest/binding-sca-jms/service/src/test/java/itest/MyServiceTestCase.java
blob: cb79ae050ad43c5f2a219a571ebe4fc870a989e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package itest;



import junit.framework.Assert;

import org.apache.tuscany.sca.node.SCAClient;
import org.apache.tuscany.sca.node.SCANode;
import org.apache.tuscany.sca.node.SCANodeFactory;
import org.junit.Test;

/**
 * Runs a distributed domain in a single VM by using and in memory 
 * implementation of the distributed domain
 */
public class MyServiceTestCase {

    @Test
    public void testCalculator() throws Exception {       
        
        SCANode node = SCANodeFactory.newInstance().createSCANodeFromClassLoader("MyService.composite", null);
        try {

            node.start();

            MyService service = ((SCAClient)node).getService(MyService.class, "MyServiceComponent");

            Assert.assertEquals("Hello petra", service.sayHello("petra"));

        } finally {
            node.stop();
        }
    }
}