KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > ozoneDB > DxLib > AbstractTest


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id$
8

9 package test.ozoneDB.DxLib;
10
11 import test.OzoneTestCase;
12
13
14 /**
15  */

16 abstract class AbstractTest extends OzoneTestCase {
17
18     long start;
19     long stop;
20
21     public AbstractTest(String JavaDoc name) {
22         super(name);
23     }
24
25     /**
26      */

27     public void startTimer(String JavaDoc className, String JavaDoc testName) {
28         className = className.substring(className.lastIndexOf(".") + 1);
29         System.out.print(testName + ":" + className + " - ");
30         System.out.flush();
31
32         start = System.currentTimeMillis();
33     }
34
35
36     /**
37      */

38     public void stopTimer() {
39         stop = System.currentTimeMillis();
40         printTime();
41     }
42
43
44     /**
45      */

46     public void printTime() {
47         System.out.println("\t time: " + (stop - start) + " msec");
48     }
49
50
51     /**
52      */

53     public void error() {
54         fail("error");
55     }
56 }
57
Popular Tags