When a dependent module is part of the reactor build, maven eclipse plugin will add the module as a "src" dependency. That's what happens when you run mvn -Peclipse from trunk folder.

Thanks,
Raymond
--------------------------------------------------
From: "ant elder" <[email protected]>
Sent: Tuesday, November 24, 2009 11:27 AM
To: <[email protected]>
Subject: Re: svn commit: r719807 - /tuscany/java/sca/samples/calculator/src/test/java/calculator/CalculatorTestCase.java

Thats intersting, no i have:

 <classpathentry kind="var"
path="M2_REPO/org/apache/tuscany/sca/tuscany-deployment/2.0-SNAPSHOT/tuscany-deployment-2.0-SNAPSHOT.jar"/>

which i guess explains why i don't see them.

  ...ant

On Tue, Nov 24, 2009 at 7:21 PM, Raymond Feng <[email protected]> wrote:
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


Reply via email to