View Javadoc
1   /**
2    * 
3    */
4   package org.melati.poem.test;
5   
6   import org.melati.poem.DoublePoemType;
7   import org.melati.poem.ParsingPoemException;
8   import org.melati.poem.SQLPoemType;
9   
10  /**
11   * @author timp
12   * @since 21 Dec 2006
13   *
14   */
15  public class NotNullableDoublePoemTypeTest extends SQLPoemTypeSpec<Double> {
16  
17    /**
18     * 
19     */
20    public NotNullableDoublePoemTypeTest() {
21    }
22  
23    /**
24     * @param name
25     */
26    public NotNullableDoublePoemTypeTest(String name) {
27      super(name);
28    }
29  
30    /**
31     * {@inheritDoc}
32     * @see org.melati.poem.test.SQLPoemTypeSpec#setObjectUnderTest()
33     */
34    void setObjectUnderTest() {
35      it = new DoublePoemType(false);
36    }
37  
38    /**
39     * Test method for {@link org.melati.poem.SQLType#quotedRaw(java.lang.Object)}.
40     */
41    public void testQuotedRaw() {
42      assertEquals(((SQLPoemType<Double>)it).sqlDefaultValue(getDb().getDbms()) , 
43          ((SQLPoemType<Double>)it).quotedRaw(((SQLPoemType<Double>)it).rawOfString(((SQLPoemType<Double>)it).sqlDefaultValue(getDb().getDbms()))));
44  
45    }
46  
47    public void testRawOfString() {
48      super.testRawOfString();
49      try{
50        it.rawOfString("kk");
51        fail("Should have blown up");
52      } catch (ParsingPoemException e) {
53        e = null;
54      }
55      
56    }
57    
58  }