Menu

#652 "Test Project" error when loading classes in packages

4: Serious
closed-fixed
9
2008-03-14
2008-03-14
No

Important note:
Bug seen in version 20080312-1948 revision 4395.
Bug does not occur in version 20080124-1942

If you test your code using the "Test Project" button, the following error is generated whenever it attempts to load a class that is in any package other than the default package:

"Testing works only on valid class files"
"The class file for subDir/MyClass2 in source file C:\[etc, etc]\src\subDir\MyClass2 cannot be loaded.
When DrJava tries to load it the following error is generated:
java.lang.NoClassDefFoundError: Illegal name: subDir/MyClass2"

Above, the class MyClass2 is in the subDir package, *but is not instantiated during testing*.

The actual testing appears to successfully complete however.

Also, testing each test file individually by hand, will result in all test files completing succefully with no errors shown.

The attached code contains a simple example that shows the above error. It also includes two more test files that can be used to show that the error also occurs under similar constraints.

Discussion

  • Stephen Wong

    Stephen Wong - 2008-03-14

    Demo code with 3 different unit test files (only one is in project)

     
  • Dan Smith

    Dan Smith - 2008-03-14

    Logged In: YES
    user_id=1060117
    Originator: NO

    Fixed with rev 4403. Class names were being extracted from class files with slashed names ("foo/bar/Class") rather than dotted names ("foo.bar.Class").

     
  • Dan Smith

    Dan Smith - 2008-03-14
    • assigned_to: nobody --> dlsmith
    • status: open --> closed-fixed
     

Log in to post a comment.