*/
@Test
public void testNumericRuleId() throws ParseException
{
String value = null;
DitStructureRule ditStructureRule = null;
// null test
value = null;
try
{
parser.parseDITStructureRuleDescription( value );
fail( "Exception expected, null" );
}
catch ( ParseException pe )
{
// expected
}
// no ruleid
value = "( )";
try
{
parser.parseDITStructureRuleDescription( value );
fail( "Exception expected, no ruleid" );
}
catch ( ParseException pe )
{
// expected
}
// simple
value = "( 1 FORM 1.1 )";
ditStructureRule = parser.parseDITStructureRuleDescription( value );
assertEquals( 1, ditStructureRule.getRuleId() );
// simple
value = "( 1234567890 FORM 1.1 )";
ditStructureRule = parser.parseDITStructureRuleDescription( value );
assertEquals( 1234567890, ditStructureRule.getRuleId() );
// simple with spaces
value = "( 1234567890 FORM 1.1 )";
ditStructureRule = parser.parseDITStructureRuleDescription( value );
assertEquals( 1234567890, ditStructureRule.getRuleId() );
// non-numeric not allowed
value = "( test FORM 1.1 )";
try
{