1 11 package org.eclipse.jdt.internal.junit.wizards; 12 13 import java.util.HashSet ; 14 15 import org.eclipse.core.runtime.CoreException; 16 17 import org.eclipse.jface.viewers.IStructuredContentProvider; 18 import org.eclipse.jface.viewers.Viewer; 19 20 import org.eclipse.jdt.core.IPackageFragment; 21 22 import org.eclipse.jdt.internal.junit.launcher.JUnit3TestFinder; 23 import org.eclipse.jdt.internal.junit.ui.JUnitPlugin; 24 25 public class SuiteClassesContentProvider implements IStructuredContentProvider { 26 27 public Object [] getElements(Object parent) { 28 if (! (parent instanceof IPackageFragment)) 29 return new Object [0]; 30 IPackageFragment pack= (IPackageFragment) parent; 31 if (! pack.exists()) 32 return new Object [0]; 33 try { 34 HashSet result= new HashSet (); 35 new JUnit3TestFinder().findTestsInContainer(pack, result, null); 36 return result.toArray(); 37 } catch (CoreException e) { 38 JUnitPlugin.log(e); 39 return new Object [0]; 40 } 41 } 42 43 public void dispose() { 44 } 45 46 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 47 } 48 } 49 | Popular Tags |