KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > test > BasicStorageTest


1 /*
2  * Copyright 2004 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: BasicStorageTest.java,v 1.9 2004/03/22 04:58:13 jackknifebarber Exp $
9  */

10
11 package com.triactive.jdo.test;
12
13 import javax.jdo.PersistenceManager;
14 import org.apache.log4j.Category;
15
16
17 /**
18  * Tests the basic storage and retrieval functionality of the
19  * PersistenceManager.
20  *
21  * @author <a HREF="mailto:mmartin5@austin.rr.com">Mike Martin</a>
22  * @version $Revision: 1.9 $
23  */

24
25 public class BasicStorageTest extends StorageTestCase
26 {
27     private static final Category LOG = Category.getInstance(BasicStorageTest.class);
28
29     private boolean schemaInitialized = false;
30
31
32     /**
33      * Used by the JUnit framework to construct tests. Normally, programmers
34      * would never explicitly use this constructor.
35      *
36      * @param name Name of the <tt>TestCase</tt>.
37      */

38
39     public BasicStorageTest(String JavaDoc name)
40     {
41         super(name);
42     }
43
44
45     protected void setUp() throws Exception JavaDoc
46     {
47         super.setUp();
48
49         if (!schemaInitialized)
50         {
51             addClassesToSchema(new Class JavaDoc[]
52                 {
53                     Widget.class,
54                     DateWidget.class,
55                     DecimalWidget.class,
56                     FloatWidget.class,
57                     StringWidget.class,
58                     BinaryWidget.class,
59                     CollectionWidget.class,
60                     SetWidget.class,
61                     ElementWidget.class,
62                     MapWidget.class,
63                     ValueWidget.class,
64                     HashtableWidget.class,
65                     KeywordConflict.class,
66                     AReallyObnoxiouslyLongWindedNamedObject.class
67                 }
68             );
69
70             schemaInitialized = true;
71         }
72     }
73
74
75     public void testStringWidgets() throws Exception JavaDoc
76     {
77         runStorageTestFor(StringWidget.class);
78     }
79
80     public void testBinaryWidgets() throws Exception JavaDoc
81     {
82         runStorageTestFor(BinaryWidget.class);
83     }
84
85     public void testDateWidgets() throws Exception JavaDoc
86     {
87         runStorageTestFor(DateWidget.class);
88     }
89
90     public void testDecimalWidgets() throws Exception JavaDoc
91     {
92         runStorageTestFor(DecimalWidget.class);
93     }
94
95     public void testFloatWidgets() throws Exception JavaDoc
96     {
97         runStorageTestFor(FloatWidget.class);
98     }
99
100     public void testCollectionWidgets() throws Exception JavaDoc
101     {
102         runStorageTestFor(CollectionWidget.class);
103     }
104
105     public void testSetWidgets() throws Exception JavaDoc
106     {
107         runStorageTestFor(SetWidget.class);
108     }
109
110     public void testMapWidgets() throws Exception JavaDoc
111     {
112         runStorageTestFor(MapWidget.class);
113     }
114
115     public void testHashtableWidgets() throws Exception JavaDoc
116     {
117         runStorageTestFor(HashtableWidget.class);
118     }
119
120     public void testClassUsingSQLKeywords() throws Exception JavaDoc
121     {
122         runStorageTestFor(KeywordConflict.class);
123     }
124
125     public void testClassWithLongName() throws Exception JavaDoc
126     {
127         runStorageTestFor(AReallyObnoxiouslyLongWindedNamedObject.class);
128     }
129 }
130
Popular Tags