Kit Plummer
Advanced Programs
Raytheon Missile Systems
520.360.4729 (cell)
520.545.9346 (desk)
kitplummer (im)Thanks again Jean-Sebastian.
At this point I think Guillaume is correct - we need to look at the SE.
I'm _guessing_ that the current TucsanyRuntime class gets simplified,
or replaced by the use of EmbeddedSCADomain.
I'm tied up for the next few days - but, will hopefully get some free
time to dig a bit deeper...
Kit
Jean-Sebastien Delfino wrote:
[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