View Javadoc
1   package org.melati.poem.test;
2   
3   import org.melati.poem.StringLengthValidationPoemException;
4   import org.melati.poem.StringPoemType;
5   
6   /**
7    * @author timp
8    * @since 21 Dec 2006
9    *
10   */
11  public class NotNullableSizedStringPoemTypeTest extends SizedAtomPoemTypeSpec<String> {
12  
13    public NotNullableSizedStringPoemTypeTest() {
14    }
15  
16    public NotNullableSizedStringPoemTypeTest(String name) {
17      super(name);
18    }
19  
20    void setObjectUnderTest() {
21      it = new StringPoemType(false, 20);
22    }
23  
24    public void testAssertValidRaw() {
25      super.testAssertValidRaw();
26      try {
27        it.assertValidRaw("123456789012345678901");
28        fail("Should have blown up");
29      } catch (StringLengthValidationPoemException e) { 
30        e = null;
31      }
32    }
33  
34  }