1
2
3
4
5
6
7
8 package gov.noaa.eds.xapi.generic;
9
10 import junit.framework.*;
11 import java.util.Hashtable;
12 import org.xmldb.api.base.Configurable;
13
14 /***
15 *
16 * @author tns
17 */
18 public class GenericConfigurableTest extends TestCase {
19
20 private GenericConfigurable configurable = null;
21
22 public GenericConfigurableTest(String testName) {
23 super(testName);
24 }
25
26 protected void setUp() throws java.lang.Exception {
27 configurable = new GenericConfigurable();
28 }
29
30 protected void tearDown() throws java.lang.Exception {
31 }
32
33 public static junit.framework.Test suite() {
34 junit.framework.TestSuite suite = new junit.framework.TestSuite(GenericConfigurableTest.class);
35
36 return suite;
37 }
38
39 /***
40 * Test of getProperty method, of class gov.noaa.eds.xapi.generic.GenericConfigurable.
41 */
42 public void testGetInvalidProperty() {
43 System.out.println("testGetProperty");
44
45 String prop = configurable.getProperty("Undefined Property");
46 assertNull("Expected an unknown property to return null",prop);
47 }
48
49 public void testGetValidProperty(){
50 configurable.setProperty("name","value");
51 String prop = configurable.getProperty("name");
52 assertNotNull("Property was excpected to be defined",prop);
53 assertEquals("Unexpected property value returned","value",prop);
54 }
55
56 /***
57 * Test of setProperty method, of class gov.noaa.eds.xapi.generic.GenericConfigurable.
58 */
59 public void testSetProperty() {
60 System.out.println("testSetProperty");
61
62
63 configurable.setProperty("blah","ditty");
64 }
65
66
67
68
69 }