results = ColumnHelper.removeHibernateValidatorSpecialTags(" ");
assertTrue(results.length == 0);
}
public void test() {
Column c = new Column(null,Types.VARCHAR,"VARCHAR","username",3,30,true,false,false,false,"default value","remarks");
assertEquals(ColumnHelper.getHibernateValidatorExpression(c),"@Length(max=3)");
c = new Column(null,Types.VARCHAR,"VARCHAR","username",0,30,true,false,false,false,"default value","remarks");
assertEquals(ColumnHelper.getHibernateValidatorExpression(c),"");
c = new Column(null,Types.VARCHAR,"VARCHAR","username",0,30,false,false,false,false,"default value","remarks");
assertEquals(ColumnHelper.getHibernateValidatorExpression(c),"@NotBlank ");
c = new Column(null,Types.VARCHAR,"VARCHAR","email",0,30,false,false,false,false,"default value","remarks");
assertEquals(ColumnHelper.getHibernateValidatorExpression(c),"@NotBlank @Email");
c = new Column(null,Types.TINYINT,"byte","email",0,30,false,false,false,false,"default value","remarks");
assertEquals(ColumnHelper.getHibernateValidatorExpression(c),"@NotNull @Email @Max(127)");
c = new Column(null,Types.SMALLINT,"short","email",0,30,false,false,false,false,"default value","remarks");
assertEquals(ColumnHelper.getHibernateValidatorExpression(c),"@NotNull @Email @Max(32767)");
}