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

Summary: broken classpath in for tests
Product: apisupport Reporter: pzajac <pzajac>
Component: ProjectAssignee: pzajac <pzajac>
Status: VERIFIED FIXED    
Severity: blocker CC: jglick, jskrivanek, jtulach
Priority: P2    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 105621    
Bug Blocks: 54161    
Attachments: patch with fix
patch with fix (correct MIME type)
test failure

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