1 12 13 package org.eclipse.jdt.internal.junit4.runner; 14 15 import org.eclipse.jdt.internal.junit.runner.ITestLoader; 16 import org.eclipse.jdt.internal.junit.runner.ITestReference; 17 import org.eclipse.jdt.internal.junit.runner.RemoteTestRunner; 18 19 public class JUnit4TestLoader implements ITestLoader { 20 21 public ITestReference[] loadTests( 22 @SuppressWarnings ("unchecked") Class [] testClasses, String testName, 24 String [] failureNames, 25 RemoteTestRunner listener) { 26 27 ITestReference[] refs= new ITestReference[testClasses.length]; 28 for (int i= 0; i < testClasses.length; i++) { 29 Class <?> clazz= testClasses[i]; 30 ITestReference ref= createTest(clazz, testName); 31 refs[i]= ref; 32 } 33 return refs; 34 } 35 36 private ITestReference createTest(Class <?> clazz, String testName) { 37 if (clazz == null) 38 return null; 39 if (testName == null) 40 return new JUnit4TestClassReference(clazz); 41 return new JUnit4TestMethodReference(clazz, testName); 42 } 43 } 44 | Popular Tags |