On Feb 12, 2007, at 12:18 PM, Raymond Feng wrote:

Hi,

In the latest calculator sample, it demonstrates the usage of itest where we define a harness composite as follows:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0";
name="CalculatorTestHarnessComposite">
<include name="CalculatorComposite" scdlResource="META-INF/sca/ default.scdl"/>
   <component name="testComponent">
       <tuscany:junit class="calculator.CalculatorTestComponent"/>
<reference name="calculatorService">CalculatorServiceComponent</reference>
   </component>
</composite>

I think we might be able to further simplify this by introspecting the test cases to create such a harness composite. For example, we can create a Junit component if the base class is org.junit.TestCase and use autowire to resolve the references to the services being tested. Does it make sense?

Something like that, yep. We would need to distinguish unit tests from integration ones (which test plugins like surefire do through name patterns), and there's a question if the main composite should be <include>d or used as an implementation. But the less the user has to do the better.

--
Jeremy

FWIW and IIRC, 1.0 supports autowire for composites so adding @autowire="true" on the composite should be enough to remove all the reference definitions. I don't think that's implemented yet though.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to