Bug 35933 JUnit package test runner doesn't find empty tests [JUnit]
The JUnit package test runner doesn't run TestCases that don't contain any test* methods themselves (but instead only inherit them). Consider the following example: public class SimpleTest extends TestCase { public void testParser() { Parser p = getParser(); assert(...); } protected Parser getParser() { return new SimpleParser(); } } // Not executed, unless a dummy test method is inserted! public class ExtendedTest extends SimpleTest { protected Parser getParser() { return new ExtendedParser(); } }
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/launcher/JUnitMainTab.java
acceptedClasses= new Class[] { IJavaModel.class, IPackageFragmentRoot.class, IJavaProject.class, IPackageFragment.class };
		ViewerFilter filter= new TypedViewerFilter(acceptedClasses) {
			public boolean select(Viewer viewer, Object parent, Object element) {
				return super.select(viewer, parent, element);
			}
		};		
		StandardJavaElementContentProvider provider= new StandardJavaElementContentProvider();
		ILabelProvider labelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT); 
		ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), labelProvider, provider);
		dialog.setValidator(validator);
		dialog.setSorter(new JavaElementSorter());
		dialog.setTitle(JUnitMessages.getString("JUnitMainTab.folderdialog.title"));  
		dialog.setMessage(JUnitMessages.getString("JUnitMainTab.folderdialog.message"));  
		dialog.addFilter(filter);
		dialog.setInput(JavaCore.create(getWorkspaceRoot()));
		dialog.setInitialSelection(initElement);
		dialog.setAllowMultiple(false);
		
		if (dialog.open() == Window.OK) {
			Object element= dialog.getFirstResult();
			return (IJavaElement)element;
		}
		return null;
	}
	
	private String getPresentationName(IJavaElement element) {
		return fJavaElementLabelProvider.getText(element);
	}
}