KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > scenario > raidb1 > driver > CreateTableScenario


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.raidb1.driver;
26
27 import java.sql.Connection JavaDoc;
28
29 import org.objectweb.cjdbc.scenario.templates.Raidb1Template;
30 import org.objectweb.cjdbc.scenario.tools.testlet.AbstractTestLet;
31 import org.objectweb.cjdbc.scenario.tools.testlet.CreateTableTestLet;
32
33 /**
34  * Test that after creating a table we can successfully retrieve this table
35  * from the schema
36  *
37  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk</a>
38  * @version 1.0
39  */

40 public class CreateTableScenario extends Raidb1Template
41 {
42   /**
43    * Test schema update with case insensitive
44    *
45    * @throws Exception if fails
46    */

47   public void testCreateTableCaseInSensitive() throws Exception JavaDoc
48   {
49     Connection JavaDoc con = getCJDBCConnection();
50     CreateTableTestLet let = new CreateTableTestLet(con);
51     let.set(AbstractTestLet.VIRTUAL_DATABASE,mainVdb);
52     let.set(AbstractTestLet.TABLE_NAME,"uSsAmi");
53     let.set(AbstractTestLet.IGNORE_CASE,"true");
54     let.execute();
55   }
56   
57   /**
58    * Test schema update with case sensitiveness
59    *
60    * @throws Exception if fails
61    */

62   public void testCreateTableCaseSensitive() throws Exception JavaDoc
63   {
64     Connection JavaDoc con = getCJDBCConnection();
65     CreateTableTestLet let = new CreateTableTestLet(con);
66     let.set(AbstractTestLet.VIRTUAL_DATABASE,mainVdb);
67     let.set(AbstractTestLet.TABLE_NAME,"uSsAmi");
68     let.set(AbstractTestLet.IGNORE_CASE,"false");
69     let.execute();
70   }
71   
72   /**
73    * Iterate over multiple creation of table
74    *
75    * @throws Exception if fails
76    */

77   public void testCreateTableRepeated() throws Exception JavaDoc
78   {
79     Connection JavaDoc con = getCJDBCConnection();
80     CreateTableTestLet let = new CreateTableTestLet(con);
81     let.set(AbstractTestLet.VIRTUAL_DATABASE,mainVdb);
82     let.set(AbstractTestLet.TABLE_NAME,"uSsAmi");
83     let.set(AbstractTestLet.IGNORE_CASE,"false");
84     let.set(AbstractTestLet.ITERATION,"100");
85     let.execute();
86   }
87 }
88
Popular Tags