01: /*
02: * Copyright 2002 (C) TJDO.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the TJDO License version 1.0.
06: * See the terms of the TJDO License in the documentation provided with this software.
07: *
08: * $Id: ClassMetaDataTest.java,v 1.4 2003/10/27 00:38:29 jackknifebarber Exp $
09: */
10:
11: package com.triactive.jdo.model.test;
12:
13: import com.triactive.jdo.model.*;
14: import com.triactive.jdo.model.test.widgets.*;
15: import junit.framework.TestCase;
16:
17: /**
18: * Tests the functionality of the metadata for persistence-capable classes.
19: *
20: * @author <a href="mailto:mmartin5@austin.rr.com">Mike Martin</a>
21: * @version $Revision: 1.4 $
22: */
23:
24: public class ClassMetaDataTest extends TestCase {
25: /**
26: * Used by the JUnit framework to construct tests. Normally, programmers
27: * would never explicitly use this constructor.
28: *
29: * @param name Name of the <tt>TestCase</tt>.
30: */
31:
32: public ClassMetaDataTest(String name) {
33: super (name);
34: }
35:
36: /**
37: * Tests the loading of XML metadata for a single class.
38: */
39:
40: public void testLoadingMetaDataForOneClass() {
41: Widget.assertValidMetaData(
42: ClassMetaData.forClass(Widget.class), this );
43: }
44:
45: /**
46: * Tests the loading of XML metadata for a whole package.
47: */
48:
49: public void testLoadingMetaDataForAPackage() {
50: BinaryWidget.assertValidMetaData(ClassMetaData
51: .forClass(BinaryWidget.class), this );
52:
53: DateWidget.assertValidMetaData(ClassMetaData
54: .forClass(DateWidget.class), this );
55:
56: FloatWidget.assertValidMetaData(ClassMetaData
57: .forClass(FloatWidget.class), this );
58:
59: SelfReferencingWidget.assertValidMetaData(ClassMetaData
60: .forClass(SelfReferencingWidget.class), this);
61: }
62: }
|