java/src/test JUnitTest.java,NONE,1.1
Kurt Huwig <[email protected]> Tue, 25 May 2004 06:47:36 +0000
| Newsgroups | gmane.comp.security.virus.openantivirus.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/openantivirus/java/src/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27359
Added Files:
JUnitTest.java
Log Message:
Added tests
--- NEW FILE: JUnitTest.java ---
/*
* JUnitTest
*
* This file is part of the project "iKu Java-Library"
* (c) 2003 iKu Systemhaus AG
* Am Römerkastell 4
* 66121 Saarbrücken
* GERMANY
*/
package test;
import junit.framework.*;
import junit.textui.*;
/**
* JUnit-Tests ohne viel Schnick-Schnack starten
*
* Design-Pattern-Role:
* @version $Id: JUnitTest.java,v 1.1 2004/05/25 06:47:34 kurti Exp $
* @author Kurt Huwig
*
*/
public class JUnitTest extends TestCase {
protected void start() {
try {
// sollte die Anwendung sich mit System.exit(0) beenden, müssen wir
// gegensteuern!
final Thread successfulExitParachute = new Thread(new Runnable() {
public void run() {
// oh ooh, nix wie raus hier!
Runtime.getRuntime().halt(1);
}
});
Runtime.getRuntime().addShutdownHook(successfulExitParachute);
final TestResult testResult =
new TestRunner().doRun(new TestSuite(getClass()));
// Anwendung hat sich nicht selbst beendet, also alles klar
Runtime.getRuntime().removeShutdownHook(successfulExitParachute);
if (!testResult.wasSuccessful()) {
System.exit(TestRunner.FAILURE_EXIT);
}
System.exit(TestRunner.SUCCESS_EXIT);
} catch(Exception e) {
e.printStackTrace();
System.exit(TestRunner.EXCEPTION_EXIT);
}
}
}
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click