View Javadoc
1   package org.melati.poem.test;
2   
3   import org.melati.poem.Database;
4   import org.melati.poem.PoemTypeFactory;
5   
6   /**
7    * @author timp
8    * @since 29 Jan 2007
9    *
10   */
11  public class PoemTypeFactoryTest extends PoemTestCase {
12  
13    public PoemTypeFactoryTest(String name) {
14      super(name);
15    }
16  
17    protected void setUp() throws Exception {
18      super.setUp();
19    }
20  
21    protected void tearDown() throws Exception {
22      super.tearDown();
23    }
24  
25    /**
26     * Test method for {@link org.melati.poem.PoemTypeFactory#PoemTypeFactory(int)}.
27     */
28    public void testPoemTypeFactory() {
29      
30    }
31  
32    /**
33     * Test method for {@link org.melati.poem.PoemTypeFactory#getCode()}.
34     */
35    public void testGetCode() {
36      
37    }
38  
39    /**
40     * Test method for {@link org.melati.poem.PoemTypeFactory#getName()}.
41     */
42    public void testGetName() {
43      
44    }
45  
46    /**
47     * Test method for {@link org.melati.poem.PoemTypeFactory#getDisplayName()}.
48     */
49    public void testGetDisplayName() {
50      assertEquals("TROID", PoemTypeFactory.TROID.getName());
51      assertEquals("DELETED", PoemTypeFactory.DELETED.getName());
52      assertEquals("TYPE", PoemTypeFactory.TYPE.getName());
53      assertEquals("BOOLEAN", PoemTypeFactory.BOOLEAN.getName());
54      assertEquals("INTEGER", PoemTypeFactory.INTEGER.getName());
55      assertEquals("DOUBLE", PoemTypeFactory.DOUBLE.getName());
56      assertEquals("STRING", PoemTypeFactory.STRING.getName());
57      assertEquals("DATE", PoemTypeFactory.DATE.getName());
58      assertEquals("PASSWORD", PoemTypeFactory.PASSWORD.getName());
59      assertEquals("TIMESTAMP", PoemTypeFactory.TIMESTAMP.getName());
60      assertEquals("DISPLAYLEVEL", PoemTypeFactory.DISPLAYLEVEL.getName());
61      assertEquals("SEARCHABILITY", PoemTypeFactory.SEARCHABILITY.getName());
62      assertEquals("BINARY", PoemTypeFactory.BINARY.getName());
63      assertEquals("LONG", PoemTypeFactory.LONG.getName());
64      assertEquals("INTEGRITYFIX", PoemTypeFactory.INTEGRITYFIX.getName());
65      assertEquals("BIGDECIMAL", PoemTypeFactory.BIGDECIMAL.getName());    
66    }
67  
68    /**
69     * Test method for {@link org.melati.poem.PoemTypeFactory#getDescription()}.
70     */
71    public void testGetDescription() {
72      assertEquals("...", PoemTypeFactory.TROID.getDescription());
73      assertEquals("...", PoemTypeFactory.DELETED.getDescription());
74      assertEquals("...", PoemTypeFactory.TYPE.getDescription());
75      assertEquals("...", PoemTypeFactory.BOOLEAN.getDescription());
76      assertEquals("...", PoemTypeFactory.INTEGER.getDescription());
77      assertEquals("...", PoemTypeFactory.DOUBLE.getDescription());
78      assertEquals("...", PoemTypeFactory.STRING.getDescription());
79      assertEquals("...", PoemTypeFactory.DATE.getDescription());
80      assertEquals("...", PoemTypeFactory.PASSWORD.getDescription());
81      assertEquals("...", PoemTypeFactory.TIMESTAMP.getDescription());
82      assertEquals("...", PoemTypeFactory.DISPLAYLEVEL.getDescription());
83      assertEquals("...", PoemTypeFactory.SEARCHABILITY.getDescription());
84      assertEquals("...", PoemTypeFactory.BINARY.getDescription());
85      assertEquals("...", PoemTypeFactory.LONG.getDescription());
86      assertEquals("...", PoemTypeFactory.INTEGRITYFIX.getDescription());
87      assertEquals("...", PoemTypeFactory.BIGDECIMAL.getDescription());
88    }
89  
90    /**
91     * Test method for {@link org.melati.poem.PoemTypeFactory#
92     * forCode(org.melati.poem.Database, int)}.
93     */
94    public void testForCode() {
95      Database db = getDb();
96      PoemTypeFactory userType = PoemTypeFactory.forCode(db,0);
97      assertEquals("User", userType.getDisplayName());
98      assertEquals("A registered User of the database", userType.getDescription());
99    }
100 
101 }