KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > genimen > djeneric > test > AllTests


1 /*
2  * Created on 28-feb-03
3  *
4  * To change this generated comment go to
5  * Window>Preferences>Java>Code Generation>Code Template
6  */

7 package com.genimen.djeneric.test;
8
9 import junit.extensions.TestSetup;
10 import junit.framework.Test;
11 import junit.framework.TestSuite;
12
13 import com.genimen.djeneric.util.DjLogger;
14
15 /**
16  * @author Wido Riezebos
17  */

18 public class AllTests
19 {
20
21   public static Test suite()
22   {
23
24     TestSuite suite = new TestSuite("Tests for Djeneric");
25
26     //$JUnit-BEGIN$
27
suite.addTest(new TestSuite(TestCreateSession.class));
28     suite.addTest(new TestSuite(TestSqlParser.class));
29     suite.addTest(new TestSuite(TestPersistency.class));
30     //$JUnit-END$
31

32     TestSetup wrapper = new TestSetup(suite)
33     {
34
35       protected void setUp()
36       {
37         oneTimeSetUp();
38       }
39
40       protected void tearDown()
41       {
42         oneTimeTearDown();
43       }
44     };
45
46     return wrapper;
47   }
48
49   public static void oneTimeSetUp()
50   {
51     StartHypersonic.main(null);
52   }
53
54   public static void oneTimeTearDown()
55   {
56     StopHypersonic.main(null);
57     while (StartHypersonic.isRunning())
58       try
59       {
60         Thread.sleep(500);
61       }
62       catch (InterruptedException JavaDoc e)
63       {
64         DjLogger.log(e);
65       }
66     System.out.println("Hypersonic properly shut down..");
67   }
68 }
Popular Tags