1 11 package org.eclipse.pde.internal.junit.runtime; 12 13 import java.util.Locale ; 14 15 import org.eclipse.core.runtime.Platform; 16 17 import org.eclipse.jdt.internal.junit.runner.RemoteTestRunner; 18 19 22 public class LegacyRemotePluginTestRunner extends RemoteTestRunner { 23 24 private String fTestPluginName; 25 26 34 35 public static void main(String [] args) { 36 LegacyRemotePluginTestRunner testRunner= new LegacyRemotePluginTestRunner(); 37 testRunner.init(args); 38 testRunner.run(); 39 } 40 41 45 protected ClassLoader getClassLoader() { 46 if (Platform.getPluginRegistry().getPluginDescriptor(fTestPluginName) != null) 47 return Platform 48 .getPluginRegistry() 49 .getPluginDescriptor(fTestPluginName) 50 .getPluginClassLoader(); 51 throw new IllegalArgumentException ("No Classloader found for plug-in " + fTestPluginName); } 53 54 protected void init(String [] args) { 55 defaultInit(args); 56 setTestPluginName(args); 57 } 58 59 protected void setTestPluginName(String [] args) { 60 for (int i = 0; i < args.length; i++) { 61 if (args[i].toLowerCase(Locale.ENGLISH).equals("-testpluginname")) { if (i < args.length - 1) 63 fTestPluginName = args[i + 1]; 64 return; 65 } 66 } 67 throw new IllegalArgumentException ("Parameter -testpluginnname not specified."); } 69 } 70 | Popular Tags |