KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > scenario > templates > MultipleBackendsRaidb1Template


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Nicolas Modrzyk
22  * Contributor(s): ______________________.
23  */

24
25 package org.objectweb.cjdbc.scenario.templates;
26
27 import org.objectweb.cjdbc.controller.core.Controller;
28 import org.objectweb.cjdbc.scenario.tools.components.ComponentInterface;
29
30
31 /**
32  * This class defines a Raidb1Template.
33  *
34  * This class extends the SimpleTemplate
35  *
36  * @author <a HREF="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modryzk</a>
37  * @version 1.0
38  */

39 public abstract class MultipleBackendsRaidb1Template extends SimpleRaidb1Template
40 {
41   protected ComponentInterface hm3 = null;
42   protected ComponentInterface hm4 = null;
43   protected ComponentInterface hm5 = null;
44   protected ComponentInterface hm6 = null;
45   protected ComponentInterface hm7 = null;
46   protected ComponentInterface hm8 = null;
47   protected ComponentInterface hm9 = null;
48   protected ComponentInterface hm10 = null;
49   
50   /**
51    * @see junit.framework.TestCase#setUp()
52    */

53   protected void setUp()
54   {
55     try
56     {
57       //Recovery log
58
hm.start("9000");
59       hm.loaddatabase("9000");
60       hm1 = hm.start("9001");
61       hm.loaddatabase("9001");
62       hm2 = hm.start("9002");
63       hm.loaddatabase("9002");
64       hm3 = hm.start("9003");
65       hm.loaddatabase("9003");
66       hm4 = hm.start("9004");
67       hm.loaddatabase("9004");
68       hm5 = hm.start("9005");
69       hm.loaddatabase("9005");
70       hm6 = hm.start("9006");
71       hm.loaddatabase("9006");
72       hm7 = hm.start("9007");
73       hm.loaddatabase("9007");
74       hm8 = hm.start("9008");
75       hm.loaddatabase("9008");
76       hm9 = hm.start("9009");
77       hm.loaddatabase("9009");
78       //hm10 = hm.start("9010");
79
//hm.loaddatabase("9010");
80

81       controller = (Controller) cm.start("25322").getProcess();
82       
83       cm.loaddatabase("25322","hsqldb-raidb1-multiple-backends.xml");
84       mainVdb = controller.getVirtualDatabase("myDB");
85       mainVdb.enableAllBackends();
86     }
87     catch (Exception JavaDoc e)
88     {
89       e.printStackTrace();
90       fail("Could not start controller");
91       tearDown();
92     }
93   }
94   
95   
96   /**
97    * @see junit.framework.TestCase#tearDown()
98    */

99   protected void tearDown()
100   {
101     super.tearDown();
102   }
103 }
104
Popular Tags