Do you have tuscany-deployment shown as a project or jar in the .classpath
of sample-calculator? The test resources/classes are only visible when
tuscany-deployment is a src entry in the .classpath, such as:
<classpathentry kind="src" path="/tuscany-deployment"/>
I confirm that the sample-calculator can see hello.deployer.HelloWorld by
adding the following code to the test case.
Class cls = Class.forName("hello.deployer.HelloWorld");
Thanks,
Raymond
--------------------------------------------------
From: "ant elder" <[email protected]>
Sent: Tuesday, November 24, 2009 11:09 AM
To: <[email protected]>
Subject: Re: svn commit: r719807 -
/tuscany/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java
On Tue, Nov 24, 2009 at 6:28 PM, Raymond Feng <[email protected]> wrote:
I have explained how Eclipse builds up the classpath to run a test case.
Let
me try again.
1) The generated .classpath for each project contains entries for all
maven
dependencies with different scopes (compile/runtime/test/provide/system).
The .classpath cannot tell the maven scope of an dependency.
2) Taking an example: there are two projects A and B. A depends on B. A
has
a test resource META-INF/sca-contribution.xml (say R1) and B also has a
test
resource META-INF/sca-contribution.xml (R2). R1 is visible on A's
.classpath
while R2 is visible on B's .classpath.
3) When we run a test case from A inside Eclipse, Eclipse creates a JUnit
Run Profile with a classpath that combines entries from both A and B's
.classpath. As a result, the test case will see both R1 and R2.
Really? Its easy to try - the deployment module has a test class
hello.deployer.HelloWorld, thats not visible to the calculator sample
in my environment, is it in yours? It could inadvertently get used if
it was which would be a be a bit confusing wouldn't it?
...ant