### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.junit Index: src/org/eclipse/jdt/junit/wizards/NewTestCaseWizardPageOne.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseWizardPageOne.java,v retrieving revision 1.33 diff -u -r1.33 NewTestCaseWizardPageOne.java --- src/org/eclipse/jdt/junit/wizards/NewTestCaseWizardPageOne.java 25 Jan 2010 10:57:57 -0000 1.33 +++ src/org/eclipse/jdt/junit/wizards/NewTestCaseWizardPageOne.java 10 May 2010 15:55:45 -0000 @@ -9,6 +9,7 @@ * IBM Corporation - initial API and implementation * Sebastian Davids, sdavids@gmx.de - bug 38507 * Sebastian Davids, sdavids@gmx.de - 113998 [JUnit] New Test Case Wizard: Class Under Test Dialog -- allow Enums + * Kris De Volder, kris.de.volder@gmail.com - Allow changing the default superclass in NewTestCaseWizardPageOne - https://bugs.eclipse.org/bugs/show_bug.cgi?id=312204 *******************************************************************************/ package org.eclipse.jdt.junit.wizards; @@ -290,7 +291,7 @@ if (fIsJunit4) { setSuperClass("java.lang.Object", false); //$NON-NLS-1$ } else { - setSuperClass(JUnitCorePlugin.TEST_SUPERCLASS_NAME, true); + setSuperClass(getJUnit3TestSuperclassName(), true); } handleFieldChanged(JUNIT4TOGGLE); } @@ -1173,4 +1174,18 @@ } } + /** + * Hook method that is called to determine the name of the superclass set for + * a JUnit 3 style test case. By default, the name of the JUnit 3 TestCase class is + * returned. Implementors can override this behaviour to return the name of a + * subclass instead. + * + * @return the fully qualified name of a subclass of the JUnit 3 TestCase class. + * + * @since 3.7 + */ + protected String getJUnit3TestSuperclassName() { + return JUnitCorePlugin.TEST_SUPERCLASS_NAME; + } + }