RuleSheetParserUtil { public static String getRuleName(final String ruleRow) { String testVal = ruleRow.toLowerCase(); final int left = testVal.indexOf( DefaultRuleSheetListener.RULE_TABLE_TAG ); return ruleRow.substring( left + DefaultRuleSheetListener.RULE_TABLE_TAG.length() ).trim(); } private  RuleSheetParserUtil(); static String getRuleName(final String ruleRow); static List<Import> getImportList(final List<String> importCells); static List<Global> getVariableList( final List<String> variableCells ); static boolean isStringMeaningTrue(String property); static String rc2name( int row, int col );  }
@Test public void testRuleName() { final String row = " RuleTable This is my rule name"; final String result = RuleSheetParserUtil.getRuleName( row ); assertEquals( "This is my rule name", result ); }
@Ignore @Test public void testInvalidRuleName() { final String row = "RuleTable This is my rule name (type class)"; try { final String result = RuleSheetParserUtil.getRuleName( row ); fail( "should have failed, but get result: " + result ); } catch ( final IllegalArgumentException e ) { assertNotNull( e.getMessage() ); } }