This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 80704 - broken classpath in for tests
Summary: broken classpath in for tests
Status: VERIFIED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: pzajac
URL:
Keywords:
Depends on: 105621
Blocks: 54161
  Show dependency tree
 
Reported: 2006-07-20 10:28 UTC by pzajac
Modified: 2007-06-04 18:06 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch with fix (21.96 KB, application/octet-stream)
2006-07-20 10:30 UTC, pzajac
Details
patch with fix (correct MIME type) (21.96 KB, patch)
2006-07-20 10:31 UTC, pzajac
Details | Diff
test failure (748 bytes, text/plain)
2006-07-20 10:33 UTC, pzajac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pzajac 2006-07-20 10:28:40 UTC
Integration from testdep_54161 broke classpath provider for tests. The test
classpath was migrated to project.xml. I will atach patch with with fix. There
are few differencies in classpath computation. The new version allows to compute
transitive exectution classpath for modules. Therefore tests can have more
modules on classpath. 
I also fixed few tests in ClassPathProviderImplTest. 

testBuildClassPath tests is still failing. I don't where is the problem. I will
also attach stacktrace with failure.
Comment 1 pzajac 2006-07-20 10:30:27 UTC
Created attachment 32037 [details]
patch with fix
Comment 2 pzajac 2006-07-20 10:31:52 UTC
Created attachment 32038 [details]
patch with fix (correct MIME type)
Comment 3 pzajac 2006-07-20 10:33:39 UTC
Created attachment 32040 [details]
test failure
Comment 4 Jesse Glick 2006-07-20 15:30:43 UTC
Your patch.


TestClasspath fields should probably be private final, and add a meaningful
constructor for them.


Re. ClassPathProviderImplTest.testBuildClassPath: not sure offhand (seems I
cannot even compile apisupport/project tests at the moment due to #54161?); can
insert

assertEquals(prj, FileOwnerQuery.getOwner(jarRoot)

first to check that this at least is working. Should then be running this code
from CPPI:

if (FileUtil.getArchiveFile(file) != null &&
        FileUtil.toFile(FileUtil.getArchiveFile(file)).equals(moduleJar) &&
        file.equals(FileUtil.getArchiveRoot(FileUtil.getArchiveFile(file)))) {
    if (ClassPath.EXECUTE.equals(type)) {
        // ...
Comment 5 pzajac 2006-07-20 16:28:21 UTC
> re (seems I
cannot even compile apisupport/project tests at the moment due to #54161?)

I migrated project dependencies only for project from master-config. Apisupport
is migrated on my machine by fix-test-dependencies. It have to work for nb
project without test-dependecies. I look at it. 

>The failed tests
>     
488:       FileObject jarRoot = FileUtil.getArchiveRoot(jarFO)
jarRoot is null

>>Your patch. TestClasspath fields should probably be private final, and add a
meaningful constructor for them.

Done, can I integrate it?
Comment 6 pzajac 2006-07-20 17:27:35 UTC
The tests failed because I forgot to add test.unit.run.cp.extra on test runtime
classpath. Few non modularized libraries are defined in test.unit.run.cp.extra.  
Comment 7 Jesse Glick 2006-07-21 07:09:18 UTC
Go ahead.
Comment 8 pzajac 2006-07-21 13:27:41 UTC
fixed

Date: 2006/07/21 01:52:22

Added:
  
apisupport/project/src/org/netbeans/modules/apisupport/project/universe/TestModuleDependency.java

Modified:
   apisupport/project/src/org/netbeans/modules/apisupport/project/Evaluator.java

Log:
 #80704 parsing test classpath from project.xml

Date: 2006/07/21 05:05:55

Modified:
  
apisupport/project/test/unit/src/org/netbeans/modules/apisupport/project/queries/ClassPathProviderImplTest.java

Log:
 new test dependecies can resolve dependency recursively, there more modules can
be on classpath

Comment 9 pzajac 2006-11-23 16:55:23 UTC
v