Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Programmatically opening Junit test case creation wizard
Programmatically opening Junit test case creation wizard [message #251400] Thu, 14 February 2008 01:15 Go to next message
Eclipse UserFriend
Originally posted by: abinashsahu.hsbc.co.in

I want to open the "unit test case creation wizard" programmatically to
create a test case in eclipse but when i try with the following code it
gives me Null pointer exception.

Code:

NewTestCaseCreationWizard wizard=new NewTestCaseCreationWizard();
wizard.init(workbench,new StructuredSelection());
WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.create();
dialog.open();

Exception :

java.lang.NullPointerException
at
org.eclipse.jdt.internal.junit.ui.JUnitPlugin.getImageDescri ptor(JUnitPlugin.java:162)
at
org.eclipse.jdt.internal.junit.wizards.NewTestCaseCreationWi zard.initializeDefaultPageImageDescriptor(NewTestCaseCreatio nWizard.java:37)
at org.eclipse.jdt.internal.junit.wizards.JUnitWizard.
(JUnitWizard.java:52)
at org.eclipse.jdt.internal.junit.wizards.NewTestCaseCreationWi zard.
(NewTestCaseCreationWizard.java:31)
at
com.hsbc.es.cheatsheet.cdm.lab.reqresprocessing.action.Creat eJUnitTestCase.run(CreateJUnitTestCase.java:53)

When I try the same for NewClassCreationWizard it works fine.
Please advice what could be the problem.

Thanks and Regards
Abinash.
Re: Programmatically opening Junit test case creation wizard [message #251432 is a reply to message #251400] Thu, 14 February 2008 18:31 Go to previous message
Eclipse UserFriend
The org.eclipse.jdt.junit plugin isn't started correctly.
I assume that some required plugin is missing.

Snjeza

Abinash wrote:
> I want to open the "unit test case creation wizard" programmatically to
> create a test case in eclipse but when i try with the following code it
> gives me Null pointer exception.
>
> Code:
>
> NewTestCaseCreationWizard wizard=new NewTestCaseCreationWizard();
> wizard.init(workbench,new StructuredSelection());
> WizardDialog dialog = new WizardDialog(shell, wizard);
> dialog.create();
> dialog.open();
>
> Exception :
>
> java.lang.NullPointerException
> at
> org.eclipse.jdt.internal.junit.ui.JUnitPlugin.getImageDescri ptor(JUnitPlugin.java:162)
>
> at
> org.eclipse.jdt.internal.junit.wizards.NewTestCaseCreationWi zard.initializeDefaultPageImageDescriptor(NewTestCaseCreatio nWizard.java:37)
>
> at org.eclipse.jdt.internal.junit.wizards.JUnitWizard.
> (JUnitWizard.java:52)
> at org.eclipse.jdt.internal.junit.wizards.NewTestCaseCreationWi zard.
> (NewTestCaseCreationWizard.java:31)
> at
> com.hsbc.es.cheatsheet.cdm.lab.reqresprocessing.action.Creat eJUnitTestCase.run(CreateJUnitTestCase.java:53)
>
>
> When I try the same for NewClassCreationWizard it works fine.
> Please advice what could be the problem.
>
> Thanks and Regards
> Abinash.
>
Previous Topic:file paths for debugging vs production
Next Topic:Handling the configuration of a classpath container
Goto Forum:
  


Current Time: Wed Apr 23 02:13:10 EDT 2025

Powered by FUDForum. Page generated in 0.04531 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top