From: <jbo...@li...> - 2006-04-24 02:48:27
|
Author: mic...@jb... Date: 2006-04-23 22:48:23 -0400 (Sun, 23 Apr 2006) New Revision: 3932 Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java Log: JBRULES-236 - tighter tests for error line numbers Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java =================================================================== --- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java 2006-04-24 02:26:27 UTC (rev 3931) +++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/IntegrationCases.java 2006-04-24 02:48:23 UTC (rev 3932) @@ -573,10 +573,18 @@ assertNotNull( ruleErr.getDescr() ); assertTrue( ruleErr.getLine() != -1 ); + assertEquals(3, builder.getErrors().length); + //check that its getting it from the ruleDescr assertEquals( ruleErr.getLine(), ruleErr.getDescr().getLine() ); - assertTrue( builder.getErrors().length > 0 ); + //check the absolute error line number (there are more). + assertEquals(11, ruleErr.getLine()); + + //now check the RHS, not being too specific yet, as long as it has the rules line number, not zero + RuleError rhs = (RuleError) builder.getErrors()[2]; + assertTrue(rhs.getLine() > 7); //not being too specific - may need to change this when we rework the error reporting + } public void testErrorsParser() throws Exception { |