001: /*
002: * Copyright 2004 (C) TJDO.
003: * All rights reserved.
004: *
005: * This software is distributed under the terms of the TJDO License version 1.0.
006: * See the terms of the TJDO License in the documentation provided with this software.
007: *
008: * $Id: BasicStorageTest.java,v 1.9 2004/03/22 04:58:13 jackknifebarber Exp $
009: */
010:
011: package com.triactive.jdo.test;
012:
013: import javax.jdo.PersistenceManager;
014: import org.apache.log4j.Category;
015:
016: /**
017: * Tests the basic storage and retrieval functionality of the
018: * PersistenceManager.
019: *
020: * @author <a href="mailto:mmartin5@austin.rr.com">Mike Martin</a>
021: * @version $Revision: 1.9 $
022: */
023:
024: public class BasicStorageTest extends StorageTestCase {
025: private static final Category LOG = Category
026: .getInstance(BasicStorageTest.class);
027:
028: private boolean schemaInitialized = false;
029:
030: /**
031: * Used by the JUnit framework to construct tests. Normally, programmers
032: * would never explicitly use this constructor.
033: *
034: * @param name Name of the <tt>TestCase</tt>.
035: */
036:
037: public BasicStorageTest(String name) {
038: super (name);
039: }
040:
041: protected void setUp() throws Exception {
042: super .setUp();
043:
044: if (!schemaInitialized) {
045: addClassesToSchema(new Class[] { Widget.class,
046: DateWidget.class, DecimalWidget.class,
047: FloatWidget.class, StringWidget.class,
048: BinaryWidget.class, CollectionWidget.class,
049: SetWidget.class, ElementWidget.class,
050: MapWidget.class, ValueWidget.class,
051: HashtableWidget.class, KeywordConflict.class,
052: AReallyObnoxiouslyLongWindedNamedObject.class });
053:
054: schemaInitialized = true;
055: }
056: }
057:
058: public void testStringWidgets() throws Exception {
059: runStorageTestFor(StringWidget.class);
060: }
061:
062: public void testBinaryWidgets() throws Exception {
063: runStorageTestFor(BinaryWidget.class);
064: }
065:
066: public void testDateWidgets() throws Exception {
067: runStorageTestFor(DateWidget.class);
068: }
069:
070: public void testDecimalWidgets() throws Exception {
071: runStorageTestFor(DecimalWidget.class);
072: }
073:
074: public void testFloatWidgets() throws Exception {
075: runStorageTestFor(FloatWidget.class);
076: }
077:
078: public void testCollectionWidgets() throws Exception {
079: runStorageTestFor(CollectionWidget.class);
080: }
081:
082: public void testSetWidgets() throws Exception {
083: runStorageTestFor(SetWidget.class);
084: }
085:
086: public void testMapWidgets() throws Exception {
087: runStorageTestFor(MapWidget.class);
088: }
089:
090: public void testHashtableWidgets() throws Exception {
091: runStorageTestFor(HashtableWidget.class);
092: }
093:
094: public void testClassUsingSQLKeywords() throws Exception {
095: runStorageTestFor(KeywordConflict.class);
096: }
097:
098: public void testClassWithLongName() throws Exception {
099: runStorageTestFor(AReallyObnoxiouslyLongWindedNamedObject.class);
100: }
101: }
|