Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] Where to store JUnit tests so that they are not exportable

Please excuse me if this isn't the correct forum - hints on where to post are greatly appreciated!
 
I have several 'projects' that follow the Jakarta convention of multiple source directories based on intent as so:
 
project-x/
  src/
    java/  <-- contains production source
    test/  <-- contains unit test source
 
When setting them up in Eclipse I am definitely able to create multiple source directories and map things appropriately. Even JUnit test execution works fine. However, I do not wish other projects to be able to depend on a project's unit test source since when it is built only the code in src/java makes it into the .jar.
 
project-x/
  <classpathentry kind="src" path="src/java"/>
  <classpathentry kind="src" path="src/test"/>
 
project-y/
  <classpathentry kind="src" path="/project-x"/>  <-- gets src/java and src/test from project-x in its classpath!
 
So what I am looking for is the ability to *not* export a project's source directory, yet have certain tooling such as JUnit be able to recognize code contained therein as so:
 
project-x/
  <classpathentry kind="src" path="src/java"/>
  <classpathentry kind="src" path="src/test" exported="false"/> <-- New feature?
 
project-y/
  <classpathentry kind="src" path="/project-x"/>  <-- *only* sees src/java from project-x in its classpath!
 
Thanks!
-Naresh
 

Naresh Sikha
Senior Staff, Technology Solutions
Charles Schwab & Co., Inc.
215 Fremont Street / SF215FMT-06-274
San Francisco, CA 94105-2306
W: 415-667-8071
E: naresh.sikha@xxxxxxxxxx
WARNING: All email sent to this address will be received by the Charles Schwab & Co., Inc. corporate email system and is subject to archival and review by someone other than the recipient.

 

Back to the top