Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-ui-dev] Re: help running jdt junit tests

Hi John,

the trick is to launch the tests using JUnit Plug-in Test launcher. The
launcher makes sure that the Eclipse runtime is setup correctly. The
launcher works the same way as the normal JUnit launcher. Simply pick a
TestCase or a suite and run it.

HTH

Dirk


                                                                           
             John Kaplan                                                   
             <johnkaplantech@g                                             
             mail.com>                                                  To 
                                       Dirk Baeumer/Zurich/IBM@IBMCH       
             05/09/2005 10:41                                           cc 
             PM                        jdt-ui-dev@xxxxxxxxxxx              
                                                                   Subject 
                                       help running jdt junit tests        
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Dirk et al,

I'm trying to run the jdt junit tests so I can test my changes to the
NewTypeWizardPage and related classes as described in bugzilla bug 108071.
I'm running into roadblocks and wonder if you can give me any advice.

First, can the tests be run individually from Eclipse? Whenever I try the
tests fail immediately and the cause seems to be that the "ResourcesPlugin"
plug-in isn't being initialized. (The symptom is calls to
ResourcesPlugin.getWorkspace() throw a "workspace is closed" exception
because the internal "workspace" variable is null, and it gets initialized
in the "ResourcesPlugin.startup()" method.) Is there a formula for getting
plug-in dependencies to be initialized to run a junit test? I have also
tried running plug-in tests from the jdt tests directory, but these all
fail even sooner with the error:    "java.lang.IllegalArgumentException :
No Classloader found for plug-in org.eclipse.jdt.ui.tests."

I would much prefer to run the tests this way (meaning singly and directly
from Eclipse) if possible. It is more convenient for me for iterative
development.

I also tried running the "test.xml" ant script that is included in the jdt
tests package, but that is failing because of path problems. It seems to
want to have all the classes and tests in the same hierarchy under a single
"eclipse-home" directory, and not to have a default Eclipse install with
separate packages in an Eclipse development workspace. The latter is the
way I have it set up, and the way the PDE and CVS integrations to Eclipse
seem to steer you. Is it that you're not supposed to use Eclipse as an IDE
when you're developing Eclipse? Or is there some step in the process I'm
missing?
Please advise. Also, if this e-mail is better to be attached to the bug
rather than this e-mail list, let me know. I assume I'm not the only one in
the world who ever had these problems…

Thanks,
- John

Back to the top