KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > model > test > ClassMetaDataTest


1 /*
2  * Copyright 2002 (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: ClassMetaDataTest.java,v 1.4 2003/10/27 00:38:29 jackknifebarber Exp $
9  */

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 /**
19  * Tests the functionality of the metadata for persistence-capable classes.
20  *
21  * @author <a HREF="mailto:mmartin5@austin.rr.com">Mike Martin</a>
22  * @version $Revision: 1.4 $
23  */

24
25 public class ClassMetaDataTest extends TestCase
26 {
27     /**
28      * Used by the JUnit framework to construct tests. Normally, programmers
29      * would never explicitly use this constructor.
30      *
31      * @param name Name of the <tt>TestCase</tt>.
32      */

33
34     public ClassMetaDataTest(String JavaDoc name)
35     {
36         super(name);
37     }
38
39
40     /**
41      * Tests the loading of XML metadata for a single class.
42      */

43
44     public void testLoadingMetaDataForOneClass()
45     {
46         Widget.assertValidMetaData(ClassMetaData.forClass(Widget.class), this);
47     }
48
49
50     /**
51      * Tests the loading of XML metadata for a whole package.
52      */

53
54     public void testLoadingMetaDataForAPackage()
55     {
56         BinaryWidget.assertValidMetaData(ClassMetaData.forClass(BinaryWidget.class), this);
57
58         DateWidget.assertValidMetaData(ClassMetaData.forClass(DateWidget.class), this);
59
60         FloatWidget.assertValidMetaData(ClassMetaData.forClass(FloatWidget.class), this);
61
62         SelfReferencingWidget.assertValidMetaData(ClassMetaData.forClass(SelfReferencingWidget.class), this);
63     }
64 }
65
Popular Tags