@Test(timeout=10*1000) public void testCheckRuleHeaderLocationDetermination_dialect3() { String input = "rule MyRule \n" + " dialect "; DRLParser parser = getParser(input); parser.enableEditorInterface(); try { parser.compilationUnit(); } catch (Exception ex) { } DroolsToken token = getLastTokenOnList(parser.getEditorInterface().get( 0).getContent()); assertEquals("dialect", token.getText().toLowerCase()); assertEquals(DroolsEditorType.KEYWORD, token.getEditorType()); assertEquals(Location.LOCATION_RULE_HEADER_KEYWORD, getLastIntegerValue(parser.getEditorInterface().get(0) .getContent())); }
@Test(timeout=10*1000) public void testCheckRuleHeaderLocationDetermination2() { String input = "rule MyRule \n" + " salience 12 activation-group \"my"; DRLParser parser = getParser(input); parser.enableEditorInterface(); try { parser.compilationUnit(); } catch (Exception ex) { } DroolsToken token = getLastTokenOnList(parser.getEditorInterface().get( 0).getContent()); assertEquals("group", token.getText().toLowerCase()); assertEquals(DroolsEditorType.KEYWORD, token.getEditorType()); assertEquals(Location.LOCATION_RULE_HEADER_KEYWORD, getLastIntegerValue(parser.getEditorInterface().get(0) .getContent())); }
@Test(timeout=10*1000) public void testCheckRuleHeaderLocationDetermination_dialect4() { String input = "rule MyRule \n" + " dialect \""; DRLParser parser = getParser(input); parser.enableEditorInterface(); try { parser.compilationUnit(); } catch (Exception ex) { } DroolsToken token = getLastTokenOnList(parser.getEditorInterface().get( 0).getContent()); assertEquals("dialect", token.getText().toLowerCase()); assertEquals(DroolsEditorType.KEYWORD, token.getEditorType()); assertEquals(Location.LOCATION_RULE_HEADER_KEYWORD, getLastIntegerValue(parser.getEditorInterface().get(0) .getContent())); }