KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > zeus > binding > ContainerPropertyTest


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  */

19 package org.enhydra.zeus.binding;
20
21 import java.util.BitSet JavaDoc;
22 import java.util.Vector JavaDoc;
23
24 import junit.framework.Test;
25 import junit.framework.TestCase;
26 import junit.framework.TestSuite;
27
28 /**
29  * <p>
30  * This is a test case for the <code>{@link ContainerProperty}</code> class.
31  * </p><p>
32  * Even though <code>ContainerProperty</code> implements both
33  * <code>{@link Property}</code> and <code>{@link Container}</code>,
34  * <code>ContainerPropertyTest</code> will only provide a concrete
35  * <code>{@link AbstractContainerTest}</code>.
36  * <code>{@link AtomicPropertyTest}</code> already provides a concrete
37  * <code>{@link AbstractPropertyTest}</code>.
38  * </p>
39  *
40  * @author Robert Sese
41  * @author Brett McLaughlin
42  */

43 public class ContainerPropertyTest extends AbstractContainerTest {
44
45     /**
46      * The modifiers (i.e. public, volatile, etc) for the test
47      * ContainerProperty.
48      */

49     private BitSet JavaDoc modifiers;
50
51     /** The test ContainerProperty. */
52     private ContainerProperty containerProperty;
53
54
55     /**
56      * Creates a new Container object that will be used to test Container level
57      * methods.
58      *
59      * @return a Container object to test with.
60      */

61     protected Container createContainer() {
62         return new ContainerProperty("",
63                                      "my_xml_name",
64                                      "my_type_uri",
65                                      "my_xml_type");
66     }
67
68     /**
69      * Constructs an ContainerPropertyTest with the given name.
70      */

71     public ContainerPropertyTest(String JavaDoc name) {
72         super(name);
73     }
74
75     /**
76      * Returns the test suite for this test case.
77      *
78      * @return the TestSuite for ContainerProperty test.
79      */

80     public static Test suite() {
81         return new TestSuite(ContainerPropertyTest.class);
82     }
83
84     /**
85      * Establishes the test fixture.
86      */

87     protected void setUp() {
88         modifiers = new BitSet JavaDoc();
89         modifiers.set(Property.ACCESS_PRIVATE);
90         modifiers.set(Property.SOURCE_ATTLIST);
91
92         containerProperty = new ContainerProperty("",
93                                                   "my_xml_name",
94                                                   "my_type_uri",
95                                                   "my_xml_type");
96     }
97
98     /**
99      * Releases any resources.
100      */

101     protected void tearDown() {
102         modifiers = null;
103         containerProperty = null;
104     }
105
106     /**
107      * Tests a valid construction.
108      */

109     public void testConstructor1() {
110         ContainerProperty c
111             = new ContainerProperty("xml_name_uri",
112                                     "xml_name",
113                                     "xml_type_uri",
114                                     "xml_type",
115                                     modifiers);
116         assertTrue("Constructor failure", c != null);
117     }
118
119     /**
120      * Tests a valid construction.
121      */

122     public void testConstructor3() {
123         ContainerProperty c
124             = new ContainerProperty("xml_name_uri",
125                                     "xml_name",
126                                     "xml_type_uri",
127                                     "xml_type");
128         assertTrue("Constructor failure", c != null);
129     }
130     
131 }
132
133
Popular Tags