[snip]
Kit Plummer wrote:
Guillaume, I think we figured out how to build/install the latest
Tuscany, referencing it from the servicemix-sca pom.xml. I'm sure by
the time we have this stuff straight Tuscany will be at 1.0 - or so. ;}
On to the problem of getting up-to-date with Tuscany. The existing
test case instantiates a TuscanyRuntime, which doesn't appear to be
the way to do it anymore...
Jean-Sebastian, do you think we can just mimic the
sca/itest/interop-xsq-client/src/test/java/interop/ClientTestCase.java
to get a runtime environment?
Thanks for your effort, BTW.
Kit
interop-xsq-client is old stuff, not part of the build at the moment, I
just moved it out to an itest/old directory to make this more clear.
I'd suggest to start with these samples:
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calculator/
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/helloworld-ws-reference/
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/helloworld-ws-service/
Booting an SCA runtime and domain is much simpler now, here's the test
case from the calculator sample:
**
* This shows how to test the Calculator service component.
*/
public class CalculatorTestCase extends TestCase {
private CalculatorService calculatorService;
private SCADomain scaDomain;
protected void setUp() throws Exception {
scaDomain = SCADomain.newInstance("Calculator.composite");
calculatorService = scaDomain.getService(CalculatorService.class,
"CalculatorServiceComponent");
}
protected void tearDown() throws Exception {
scaDomain.close();
}
public void testCalculator() throws Exception {
// Calculate
assertEquals(calculatorService.add(3, 2), 5.0);
assertEquals(calculatorService.subtract(3, 2), 1.0);
assertEquals(calculatorService.multiply(3, 2), 6.0);
assertEquals(calculatorService.divide(3, 2), 1.5);
}
}
If SCADomain does not provide the level of flexibility you need, try
EmbeddedSCADomain.
A test case showing how to use it is there:
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/host-embedded/src/test/java/org/apache/tuscany/sca/host/embedded/impl/EmbeddedSCADomainTestCase.java
--
Jean-Sebastien