Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 289348 - Adding a test asset to a new artifact does not set the CLASSPATH general property correctly.
Summary: Adding a test asset to a new artifact does not set the CLASSPATH general prop...
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard: bvt
Keywords:
Depends on:
Blocks: 211751
  Show dependency tree
 
Reported: 2009-09-14 09:12 EDT by Paul Slauenwhite CLA
Modified: 2016-05-05 10:32 EDT (History)
2 users (show)

See Also:


Attachments
Test plug-ins. (27.36 KB, application/zip)
2009-09-14 09:12 EDT, Paul Slauenwhite CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2009-09-14 09:12:23 EDT
Created attachment 147097 [details]
Test plug-ins.

Test execution corrupts classpath.

In the attached projects, when executing /a/a1.testsuite, the referenced test
suite in project b cannot access code referenced on its classpath in the
plug-in's manifest.  In this case, the code that plug-in b is referencing in
its generated JUnit test class is in org.eclipse.hyades.test.core, referenced
by org.eclipse.hyades.test.tools.core (referenced by both projects).  During
execution of the TPTP JUnit test, the classpaths of the plug-ins are corrupted.
Comment 1 Paul Slauenwhite CLA 2009-09-14 09:21:44 EDT
Requires a new test case.

Requires adding /org.eclipse.hyades.test.core.tests/junit/util/Test.Util.EMFUtil.Test.testsuite to /org.eclipse.hyades.test.core.tests/junit/AllTests.testsuite.
Comment 2 Paul Slauenwhite CLA 2009-09-15 07:57:08 EDT
After a preliminary investigation, the org.eclipse.hyades.test.core plug-in is not on the classpath for the artifact (manually or automatically created).  It appears that adding a test asset to a new artifact does not set the CLASSPATH general property correctly.  For more information, see org.eclipse.hyades.test.core.util.ArtifactUtil.calculateClasspath(TPFTestSuite, CFGArtifact).  

In addition, when adding a folder to a test plug-in's classpath, the folder is periodically not added to the artifact when adding a test asset from the test plug-in's  to the artifact.  For example, run /org.eclipse.hyades.tests/BVT/AllBVTJUnitTests.testsuite without a deployment.  

Work-around: Manually create a deployment/artifact/location and add the missing entries as CLASSPATH general properties to the artifact.

(In reply to comment #1)
> Requires a new test case.
> 
> Requires adding
> /org.eclipse.hyades.test.core.tests/junit/util/Test.Util.EMFUtil.Test.testsuite
> to /org.eclipse.hyades.test.core.tests/junit/AllTests.testsuite.

Done.  Leveraged the work-around to resolve the issue with the BVTs.
Comment 3 Paul Slauenwhite CLA 2009-09-15 15:43:04 EDT
After additional debugging, the dependencies were not added to the artifact's CLASSPATH general property since they were not reexported.  When test suites references test suites/cases located in another plug-in
project, the dependencies must be reexported in the referenced plug-in
project's manifest (see
http://help.eclipse.org/galileo/topic/org.eclipse.pde.doc.user/guide/tools/editors/manifest_editor/dependencies.htm)
when running the referencing test suite.  

Corrected the offending test plug-in the the Test Project test bucket.
Comment 4 Paul Slauenwhite CLA 2009-09-15 15:43:36 EDT
Opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=289521 to update the Test Project documentation on deployments.
Comment 5 Paul Slauenwhite CLA 2009-09-21 10:23:59 EDT
Closing.