KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > junit > runner > RemoteTestRunner


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  * Sebastian Davids: sdavids@gmx.de bug 26754
11  *******************************************************************************/

12 package org.eclipse.jdt.internal.junit.runner;
13
14 import java.io.BufferedReader JavaDoc;
15 import java.io.BufferedWriter JavaDoc;
16 import java.io.File JavaDoc;
17 import java.io.FileReader JavaDoc;
18 import java.io.IOException JavaDoc;
19 import java.io.InputStreamReader JavaDoc;
20 import java.io.OutputStreamWriter JavaDoc;
21 import java.io.PrintWriter JavaDoc;
22 import java.io.StringWriter JavaDoc;
23 import java.io.UnsupportedEncodingException JavaDoc;
24 import java.net.Socket JavaDoc;
25 import java.util.Vector JavaDoc;
26
27 import org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader;
28
29 /**
30  * A TestRunner that reports results via a socket connection.
31  * See MessageIds for more information about the protocol.
32  */

33 public class RemoteTestRunner implements MessageSender, IVisitsTestTrees {
34     /**
35      * Holder for information for a rerun request
36      */

37     private static class RerunRequest {
38         String JavaDoc fRerunClassName;
39         String JavaDoc fRerunTestName;
40         int fRerunTestId;
41         
42         public RerunRequest(int testId, String JavaDoc className, String JavaDoc testName) {
43             fRerunTestId= testId;
44             fRerunClassName= className;
45             fRerunTestName= testName;
46         }
47
48     }
49
50     public static final String JavaDoc RERAN_FAILURE = "FAILURE"; //$NON-NLS-1$
51

52     public static final String JavaDoc RERAN_ERROR = "ERROR"; //$NON-NLS-1$
53

54     public static final String JavaDoc RERAN_OK = "OK"; //$NON-NLS-1$
55

56     /**
57      * The name of the test classes to be executed
58      */

59     private String JavaDoc[] fTestClassNames;
60     /**
61      * The name of the test (argument -test)
62      */

63     private String JavaDoc fTestName;
64     /**
65      * The current test result
66      */

67     private TestExecution fExecution;
68
69     /**
70      * The version expected by the client
71      */

72     private String JavaDoc fVersion= ""; //$NON-NLS-1$
73

74     /**
75      * The client socket.
76      */

77     private Socket JavaDoc fClientSocket;
78     /**
79      * Print writer for sending messages
80      */

81     private PrintWriter JavaDoc fWriter;
82     /**
83      * Reader for incoming messages
84      */

85     private BufferedReader JavaDoc fReader;
86     /**
87      * Host to connect to, default is the localhost
88      */

89     private String JavaDoc fHost= ""; //$NON-NLS-1$
90
/**
91      * Port to connect to.
92      */

93     private int fPort= -1;
94     /**
95      * Is the debug mode enabled?
96      */

97     private boolean fDebugMode= false;
98     /**
99      * Keep the test run server alive after a test run has finished.
100      * This allows to rerun tests.
101      */

102     private boolean fKeepAlive= false;
103     /**
104      * Has the server been stopped
105      */

106     private boolean fStopped= false;
107     /**
108      * Queue of rerun requests.
109      */

110     private Vector JavaDoc fRerunRequests= new Vector JavaDoc(10);
111     /**
112      * Thread reading from the socket
113      */

114     private ReaderThread fReaderThread;
115
116     private String JavaDoc fRerunTest;
117     
118     private final TestIdMap fIds = new TestIdMap();
119
120     private String JavaDoc[] fFailureNames;
121         
122     private ITestLoader fLoader;
123
124     private MessageSender fSender;
125
126     private boolean fConsoleMode = false;
127
128     /**
129      * Reader thread that processes messages from the client.
130      */

131     private class ReaderThread extends Thread JavaDoc {
132         public ReaderThread() {
133             super("ReaderThread"); //$NON-NLS-1$
134
}
135
136         public void run(){
137             try {
138                 String JavaDoc message= null;
139                 while (true) {
140                     if ((message= fReader.readLine()) != null) {
141                         
142                         if (message.startsWith(MessageIds.TEST_STOP)){
143                             fStopped= true;
144                             RemoteTestRunner.this.stop();
145                             synchronized(RemoteTestRunner.this) {
146                                 RemoteTestRunner.this.notifyAll();
147                             }
148                             break;
149                         }
150                         
151                         else if (message.startsWith(MessageIds.TEST_RERUN)) {
152                             String JavaDoc arg= message.substring(MessageIds.MSG_HEADER_LENGTH);
153                             //format: testId className testName
154
int c0= arg.indexOf(' ');
155                             int c1= arg.indexOf(' ', c0+1);
156                             String JavaDoc s= arg.substring(0, c0);
157                             int testId= Integer.parseInt(s);
158                             String JavaDoc className= arg.substring(c0+1, c1);
159                             String JavaDoc testName= arg.substring(c1+1, arg.length());
160                             synchronized(RemoteTestRunner.this) {
161                                 fRerunRequests.add(new RerunRequest(testId, className, testName));
162                                 RemoteTestRunner.this.notifyAll();
163                             }
164                         }
165                     }
166                 }
167             } catch (Exception JavaDoc e) {
168                 RemoteTestRunner.this.stop();
169             }
170         }
171     }
172     
173     public RemoteTestRunner() {
174         setMessageSender(this);
175     }
176
177     public void setMessageSender(MessageSender sender) {
178         fSender = sender;
179     }
180
181     /**
182      * The main entry point.
183      * Parameters<pre>
184      * -classnames: the name of the test suite class
185      * -testfilename: the name of a file containing classnames of test suites
186      * -test: the test method name (format classname testname)
187      * -host: the host to connect to default local host
188      * -port: the port to connect to, mandatory argument
189      * -keepalive: keep the process alive after a test run
190      * </pre>
191      */

192     public static void main(String JavaDoc[] args) {
193         try {
194             RemoteTestRunner testRunServer= new RemoteTestRunner();
195             testRunServer.init(args);
196             testRunServer.run();
197         } catch (Throwable JavaDoc e) {
198             e.printStackTrace(); // don't allow System.exit(0) to swallow exceptions
199
} finally {
200             // fix for 14434
201
System.exit(0);
202         }
203     }
204     
205     /**
206      * Parse command line arguments. Hook for subclasses to process
207      * additional arguments.
208      */

209     protected void init(String JavaDoc[] args) {
210         defaultInit(args);
211     }
212     
213     /**
214      * The class loader to be used for loading tests.
215      * Subclasses may override to use another class loader.
216      */

217     protected ClassLoader JavaDoc getTestClassLoader() {
218         return getClass().getClassLoader();
219     }
220     
221     /**
222      * Process the default arguments.
223      */

224     protected final void defaultInit(String JavaDoc[] args) {
225         for(int i= 0; i < args.length; i++) {
226             if(args[i].toLowerCase().equals("-classnames") || args[i].toLowerCase().equals("-classname")){ //$NON-NLS-1$ //$NON-NLS-2$
227
Vector JavaDoc list= new Vector JavaDoc();
228                 for (int j= i+1; j < args.length; j++) {
229                     if (args[j].startsWith("-")) //$NON-NLS-1$
230
break;
231                     list.add(args[j]);
232                 }
233                 fTestClassNames= (String JavaDoc[]) list.toArray(new String JavaDoc[list.size()]);
234             }
235             else if(args[i].toLowerCase().equals("-test")) { //$NON-NLS-1$
236
String JavaDoc testName= args[i+1];
237                 int p= testName.indexOf(':');
238                 if (p == -1)
239                     throw new IllegalArgumentException JavaDoc("Testname not separated by \'%\'"); //$NON-NLS-1$
240
fTestName= testName.substring(p+1);
241                 fTestClassNames= new String JavaDoc[]{ testName.substring(0, p) };
242                 i++;
243             }
244             else if(args[i].toLowerCase().equals("-testnamefile")) { //$NON-NLS-1$
245
String JavaDoc testNameFile= args[i+1];
246                 try {
247                     readTestNames(testNameFile);
248                 } catch (IOException JavaDoc e) {
249                     throw new IllegalArgumentException JavaDoc("Cannot read testname file."); //$NON-NLS-1$
250
}
251                 i++;
252             
253             } else if(args[i].toLowerCase().equals("-testfailures")) { //$NON-NLS-1$
254
String JavaDoc testFailuresFile= args[i+1];
255                 try {
256                     readFailureNames(testFailuresFile);
257                 } catch (IOException JavaDoc e) {
258                     throw new IllegalArgumentException JavaDoc("Cannot read testfailures file."); //$NON-NLS-1$
259
}
260                 i++;
261             
262             } else if(args[i].toLowerCase().equals("-port")) { //$NON-NLS-1$
263
fPort= Integer.parseInt(args[i+1]);
264                 i++;
265             }
266             else if(args[i].toLowerCase().equals("-host")) { //$NON-NLS-1$
267
fHost= args[i+1];
268                 i++;
269             }
270             else if(args[i].toLowerCase().equals("-rerun")) { //$NON-NLS-1$
271
fRerunTest= args[i+1];
272                 i++;
273             }
274             else if(args[i].toLowerCase().equals("-keepalive")) { //$NON-NLS-1$
275
fKeepAlive= true;
276             }
277             else if(args[i].toLowerCase().equals("-debugging") || args[i].toLowerCase().equals("-debug")){ //$NON-NLS-1$ //$NON-NLS-2$
278
fDebugMode= true;
279             }
280             else if(args[i].toLowerCase().equals("-version")){ //$NON-NLS-1$
281
fVersion= args[i+1];
282                 i++;
283             } else if (args[i].toLowerCase().equals("-junitconsole")) { //$NON-NLS-1$
284
fConsoleMode = true;
285             } else if (args[i].toLowerCase().equals("-testloaderclass")) { //$NON-NLS-1$
286
String JavaDoc className = args[i + 1];
287                 createLoader(className);
288                 i++;
289             }
290         }
291
292         if (getTestLoader() == null)
293             initDefaultLoader();
294
295         if(fTestClassNames == null || fTestClassNames.length == 0)
296             throw new IllegalArgumentException JavaDoc(JUnitMessages.getString("RemoteTestRunner.error.classnamemissing")); //$NON-NLS-1$
297

298         if (fPort == -1)
299             throw new IllegalArgumentException JavaDoc(JUnitMessages.getString("RemoteTestRunner.error.portmissing")); //$NON-NLS-1$
300
if (fDebugMode)
301             System.out.println("keepalive "+fKeepAlive); //$NON-NLS-1$
302
}
303
304     public void initDefaultLoader() {
305         createLoader(JUnit3TestLoader.class.getName());
306     }
307
308     public void createLoader(String JavaDoc className) {
309         setLoader(createRawTestLoader(className));
310     }
311
312     protected ITestLoader createRawTestLoader(String JavaDoc className) {
313         try {
314             return (ITestLoader) loadTestLoaderClass(className).newInstance();
315         } catch (Exception JavaDoc e) {
316             StringWriter JavaDoc trace= new StringWriter JavaDoc();
317             e.printStackTrace(new PrintWriter JavaDoc(trace));
318             String JavaDoc message= JUnitMessages.getFormattedString("RemoteTestRunner.error.invalidloader", new Object JavaDoc[] {className, trace.toString()}); //$NON-NLS-1$
319
throw new IllegalArgumentException JavaDoc(message);
320         }
321     }
322
323     protected Class JavaDoc loadTestLoaderClass(String JavaDoc className) throws ClassNotFoundException JavaDoc {
324         return Class.forName(className);
325     }
326
327     public void setLoader(ITestLoader newInstance) {
328         fLoader = newInstance;
329     }
330
331     private void readTestNames(String JavaDoc testNameFile) throws IOException JavaDoc {
332         BufferedReader JavaDoc br= new BufferedReader JavaDoc(new FileReader JavaDoc(new File JavaDoc(testNameFile)));
333         try {
334             String JavaDoc line;
335             Vector JavaDoc list= new Vector JavaDoc();
336             while ((line= br.readLine()) != null) {
337                 list.add(line);
338             }
339             fTestClassNames= (String JavaDoc[]) list.toArray(new String JavaDoc[list.size()]);
340         }
341         finally {
342             br.close();
343         }
344         if (fDebugMode) {
345             System.out.println("Tests:"); //$NON-NLS-1$
346
for (int i= 0; i < fTestClassNames.length; i++) {
347                 System.out.println(" "+fTestClassNames[i]); //$NON-NLS-1$
348
}
349         }
350     }
351
352     private void readFailureNames(String JavaDoc testFailureFile) throws IOException JavaDoc {
353         BufferedReader JavaDoc br= new BufferedReader JavaDoc(new FileReader JavaDoc(new File JavaDoc(testFailureFile)));
354         try {
355             String JavaDoc line;
356             Vector JavaDoc list= new Vector JavaDoc();
357             while ((line= br.readLine()) != null) {
358                 list.add(line);
359             }
360             fFailureNames= (String JavaDoc[]) list.toArray(new String JavaDoc[list.size()]);
361         }
362         finally {
363             br.close();
364         }
365         if (fDebugMode) {
366             System.out.println("Failures:"); //$NON-NLS-1$
367
for (int i= 0; i < fFailureNames.length; i++) {
368                 System.out.println(" "+fFailureNames[i]); //$NON-NLS-1$
369
}
370         }
371     }
372
373     /**
374      * Connects to the remote ports and runs the tests.
375      */

376     protected void run() {
377         if (!connect())
378             return;
379         if (fRerunTest != null) {
380             rerunTest(new RerunRequest(Integer.parseInt(fRerunTest), fTestClassNames[0], fTestName));
381             return;
382         }
383
384         FirstRunExecutionListener listener= firstRunExecutionListener();
385         fExecution= new TestExecution(listener, getClassifier());
386         runTests(fExecution);
387         if (fKeepAlive)
388             waitForReruns();
389             
390         shutDown();
391         
392     }
393         
394     public FirstRunExecutionListener firstRunExecutionListener() {
395         return new FirstRunExecutionListener(fSender, fIds);
396     }
397
398     /**
399      * Waits for rerun requests until an explicit stop request
400      */

401     private synchronized void waitForReruns() {
402         while (!fStopped) {
403             try {
404                 wait();
405                 if (!fStopped && fRerunRequests.size() > 0) {
406                     RerunRequest r= (RerunRequest)fRerunRequests.remove(0);
407                     rerunTest(r);
408                 }
409             } catch (InterruptedException JavaDoc e) {
410             }
411         }
412     }
413     
414     public void runFailed(String JavaDoc message, Exception JavaDoc exception) {
415         //TODO: remove System.err.println?
416
System.err.println(message);
417         if (exception != null)
418             exception.printStackTrace(System.err);
419     }
420             
421     protected Class JavaDoc[] loadClasses(String JavaDoc[] testClassNames) {
422         Vector JavaDoc classes= new Vector JavaDoc();
423         for (int i = 0; i < testClassNames.length; i++) {
424             String JavaDoc name = testClassNames[i];
425             Class JavaDoc clazz = loadClass(name, this);
426             if (clazz != null) {
427                 classes.add(clazz);
428             }
429         }
430         return (Class JavaDoc[]) classes.toArray(new Class JavaDoc[classes.size()]);
431     }
432     
433     protected void notifyListenersOfTestEnd(TestExecution execution,
434             long testStartTime) {
435         if (execution == null || execution.shouldStop())
436             notifyTestRunStopped(System.currentTimeMillis() - testStartTime);
437         else
438             notifyTestRunEnded(System.currentTimeMillis() - testStartTime);
439     }
440
441     /**
442      * Runs a set of tests.
443      */

444     public void runTests(String JavaDoc[] testClassNames, String JavaDoc testName, TestExecution execution) {
445         ITestReference[] suites= fLoader.loadTests(loadClasses(testClassNames), testName, fFailureNames, this);
446         
447         // count all testMethods and inform ITestRunListeners
448
int count= countTests(suites);
449         
450         notifyTestRunStarted(count);
451         
452         if (count == 0) {
453             notifyTestRunEnded(0);
454             return;
455         }
456         
457         sendTrees(suites);
458
459         long testStartTime= System.currentTimeMillis();
460         execution.run(suites);
461         notifyListenersOfTestEnd(execution, testStartTime);
462     }
463     
464     private void sendTrees(ITestReference[] suites) {
465         long startTime = System.currentTimeMillis();
466         if (fDebugMode)
467             System.out.print("start send tree..."); //$NON-NLS-1$
468
for (int i = 0; i < suites.length; i++) {
469             suites[i].sendTree(this);
470             }
471         if (fDebugMode)
472             System.out.println("done send tree - time(ms): " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$
473
}
474     
475     private int countTests(ITestReference[] tests) {
476         int count= 0;
477         for (int i= 0; i < tests.length; i++) {
478             ITestReference test= tests[i];
479             if (test != null)
480                 count= count + test.countTestCases();
481         }
482         return count;
483     }
484     
485     /**
486      * Reruns a test as defined by the fully qualified class name and
487      * the name of the test.
488      */

489     public void rerunTest(RerunRequest r) {
490         final Class JavaDoc[] classes= loadClasses(new String JavaDoc[] { r.fRerunClassName });
491         ITestReference rerunTest1= fLoader.loadTests(classes, r.fRerunTestName, null, this)[0];
492         RerunExecutionListener service= rerunExecutionListener();
493
494         TestExecution execution= new TestExecution(service, getClassifier());
495         ITestReference[] suites= new ITestReference[] { rerunTest1 };
496         execution.run(suites);
497
498         notifyRerunComplete(r, service.getStatus());
499     }
500
501     public RerunExecutionListener rerunExecutionListener() {
502         return new RerunExecutionListener(fSender, fIds);
503     }
504
505     protected IClassifiesThrowables getClassifier() {
506         return new DefaultClassifier(fVersion);
507     }
508
509     public void visitTreeEntry(ITestIdentifier id, boolean b, int i) {
510         notifyTestTreeEntry(getTestId(id) + ',' + escapeComma(id.getName()) + ',' + b + ',' + i);
511     }
512
513     private String JavaDoc escapeComma(String JavaDoc s) {
514         if ((s.indexOf(',') < 0) && (s.indexOf('\\') < 0))
515             return s;
516         StringBuffer JavaDoc sb= new StringBuffer JavaDoc(s.length()+10);
517         for (int i= 0; i < s.length(); i++) {
518             char c= s.charAt(i);
519             if (c == ',')
520                 sb.append("\\,"); //$NON-NLS-1$
521
else if (c == '\\')
522                 sb.append("\\\\"); //$NON-NLS-1$
523
else
524                 sb.append(c);
525         }
526         return sb.toString();
527     }
528
529     // WANT: work in bug fixes since RC2?
530
private String JavaDoc getTestId(ITestIdentifier id) {
531         return fIds.getTestId(id);
532     }
533
534     /**
535      * Stop the current test run.
536      */

537     protected void stop() {
538         if (fExecution != null) {
539             fExecution.stop();
540         }
541     }
542     
543     /**
544      * Connect to the remote test listener.
545      */

546     protected boolean connect() {
547         if (fConsoleMode) {
548             fClientSocket = null;
549             fWriter = new PrintWriter JavaDoc(System.out);
550             fReader = new BufferedReader JavaDoc(new InputStreamReader JavaDoc(System.in));
551             fReaderThread= new ReaderThread();
552             fReaderThread.start();
553             return true;
554         }
555         if (fDebugMode)
556             System.out.println("RemoteTestRunner: trying to connect" + fHost + ":" + fPort); //$NON-NLS-1$ //$NON-NLS-2$
557
Exception JavaDoc exception= null;
558         for (int i= 1; i < 20; i++) {
559             try{
560                 fClientSocket= new Socket JavaDoc(fHost, fPort);
561                 try {
562                     fWriter= new PrintWriter JavaDoc(new BufferedWriter JavaDoc(new OutputStreamWriter JavaDoc(fClientSocket.getOutputStream(), "UTF-8")), false/*true*/); //$NON-NLS-1$
563
} catch (UnsupportedEncodingException JavaDoc e1) {
564                     fWriter= new PrintWriter JavaDoc(new BufferedWriter JavaDoc(new OutputStreamWriter JavaDoc(fClientSocket.getOutputStream())), false/*true*/);
565                 }
566                 try {
567                     fReader= new BufferedReader JavaDoc(new InputStreamReader JavaDoc(fClientSocket.getInputStream(), "UTF-8")); //$NON-NLS-1$
568
} catch (UnsupportedEncodingException JavaDoc e1) {
569                     fReader= new BufferedReader JavaDoc(new InputStreamReader JavaDoc(fClientSocket.getInputStream()));
570                 }
571                 fReaderThread= new ReaderThread();
572                 fReaderThread.start();
573                 return true;
574             } catch(IOException JavaDoc e){
575                 exception= e;
576             }
577             try {
578                 Thread.sleep(2000);
579             } catch(InterruptedException JavaDoc e) {
580             }
581         }
582         runFailed(JUnitMessages.getFormattedString("RemoteTestRunner.error.connect", new String JavaDoc[]{fHost, Integer.toString(fPort)} ), exception); //$NON-NLS-1$
583
return false;
584     }
585
586     /**
587      * Shutsdown the connection to the remote test listener.
588      */

589     private void shutDown() {
590         if (fWriter != null) {
591             fWriter.close();
592             fWriter= null;
593         }
594         try {
595             if (fReaderThread != null) {
596                 // interrupt reader thread so that we don't block on close
597
// on a lock held by the BufferedReader
598
// fix for bug: 38955
599
fReaderThread.interrupt();
600             }
601             if (fReader != null) {
602                 fReader.close();
603                 fReader= null;
604             }
605         } catch(IOException JavaDoc e) {
606             if (fDebugMode)
607                 e.printStackTrace();
608         }
609         
610         try {
611             if (fClientSocket != null) {
612                 fClientSocket.close();
613                 fClientSocket= null;
614             }
615         } catch(IOException JavaDoc e) {
616             if (fDebugMode)
617                 e.printStackTrace();
618         }
619     }
620
621     /*
622      * @see org.eclipse.jdt.internal.junit.runner.MessageSender#sendMessage(java.lang.String)
623      */

624     public void sendMessage(String JavaDoc msg) {
625         if(fWriter == null)
626             return;
627         fWriter.println(msg);
628 // if (!fConsoleMode)
629
// System.out.println(msg);
630
}
631
632     protected void notifyTestRunStarted(int testCount) {
633         fSender.sendMessage(MessageIds.TEST_RUN_START + testCount + " " + "v2"); //$NON-NLS-1$ //$NON-NLS-2$
634
}
635
636     private void notifyTestRunEnded(long elapsedTime) {
637         fSender.sendMessage(MessageIds.TEST_RUN_END + elapsedTime);
638         fSender.flush();
639         //shutDown();
640
}
641
642     protected void notifyTestRunStopped(long elapsedTime) {
643         fSender.sendMessage(MessageIds.TEST_STOPPED + elapsedTime);
644         fSender.flush();
645         //shutDown();
646
}
647
648     protected void notifyTestTreeEntry(String JavaDoc treeEntry) {
649         fSender.sendMessage(MessageIds.TEST_TREE + treeEntry);
650     }
651
652     /*
653      * @see org.eclipse.jdt.internal.junit.runner.RerunCompletionListener#notifyRerunComplete(org.eclipse.jdt.internal.junit.runner.RerunRequest,
654      * java.lang.String)
655      */

656     public void notifyRerunComplete(RerunRequest r, String JavaDoc status) {
657         if (fPort != -1) {
658             fSender.sendMessage(MessageIds.TEST_RERAN + r.fRerunTestId + " " + r.fRerunClassName + " " + r.fRerunTestName + " " + status); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
659
fSender.flush();
660         }
661     }
662     
663     public void flush() {
664         fWriter.flush();
665     }
666     
667     /*
668      * (non-Javadoc)
669      *
670      * @see org.eclipse.jdt.internal.junit.runner.TestRunner#runTests(org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.TestExecution)
671      */

672     public void runTests(TestExecution execution) {
673         runTests(fTestClassNames, fTestName, execution);
674         }
675             
676     public ITestLoader getTestLoader() {
677         return fLoader;
678     }
679     
680     public Class JavaDoc loadClass(String JavaDoc className, RemoteTestRunner listener) {
681         Class JavaDoc clazz= null;
682         try {
683             clazz= getTestClassLoader().loadClass(className);
684         } catch (ClassNotFoundException JavaDoc e) {
685             listener.runFailed(JUnitMessages.getFormattedString("RemoteTestRunner.error.classnotfound", className), e); //$NON-NLS-1$
686
}
687         return clazz;
688     }
689 }
690
Popular Tags