Package org.drools.assistant.info.drl

Examples of org.drools.assistant.info.drl.RuleBasicContentInfo


  }

  @Override
  public List<AssistantOption> execute(int offset) {
    this.offset = offset;
    RuleBasicContentInfo contentInfo = ((DRLRuleRefactorInfo)ruleRefactorInfo).getContentAt(offset);
    if (contentInfo==null)
      return this.options;
    if ((option = this.bindVariable(contentInfo))!=null)
      this.options.add(option);
    if ((option = this.fixImports(contentInfo))!=null)
View Full Code Here


  }

  public void testExecuteEngine() {
    info = (DRLRuleRefactorInfo) engine.parse();
    RuleBasicContentInfo content = info.getContentAt(123);
    Assert.assertEquals(true, content!=null);
  }
View Full Code Here

    Assert.assertEquals(true, content!=null);
  }

  public void testImport() {
    info = (DRLRuleRefactorInfo) engine.parse();
    RuleBasicContentInfo content = info.getContentAt(9);
    Assert.assertEquals(true, content!=null);
  }
View Full Code Here

    Assert.assertEquals(true, content!=null);
  }

  public void testNothingInteresting() {
    info = (DRLRuleRefactorInfo) engine.parse();
    RuleBasicContentInfo content = info.getContentAt(199);
    Assert.assertEquals(true, content==null);
  }
View Full Code Here

    Assert.assertEquals(true, content==null);
  }

  public void testInsideTheRuleName() {
    info = (DRLRuleRefactorInfo) engine.parse();
    RuleBasicContentInfo content = info.getContentAt(670);
    Assert.assertEquals(true, content==null);
  }
View Full Code Here

    Assert.assertEquals(true, content==null);
  }

  public void testInsideLHSRule() {
    info = (DRLRuleRefactorInfo) engine.parse();
    RuleBasicContentInfo content = info.getContentAt(790);
    Assert.assertEquals(true, content!=null);
  }
View Full Code Here

    Assert.assertEquals(true, content!=null);
  }

  public void testInsideRHSRule() {
    info = (DRLRuleRefactorInfo) engine.parse();
    RuleBasicContentInfo content = info.getContentAt(830);
    Assert.assertEquals(true, content!=null);
  }
View Full Code Here

    "\t\tSystem.out.println( myMessage );\n" +
    "\t\tm.setMessage( \"Bon Giorno\" );\n" +
    "end";
    engine = new DRLParserEngine(rule);
    info = (DRLRuleRefactorInfo) engine.parse();
    RuleBasicContentInfo content = info.getContentAt(173);

    Assert.assertEquals(true, content!=null);
    Assert.assertEquals(DRLContentTypeEnum.RULE_LHS_LINE, content.getType());
    Assert.assertEquals("rule \"Hello World\"", ((RuleLineContentInfo)content).getRule().getRuleName());
    Assert.assertEquals("\t\tPrueba()", content.getContent());

    content = info.getContentAt(343);
    Assert.assertEquals(true, content!=null);
    Assert.assertEquals(DRLContentTypeEnum.RULE_LHS_LINE, content.getType());
    Assert.assertEquals("rule \"GoodBye World\"", ((RuleLineContentInfo)content).getRule().getRuleName());
    Assert.assertEquals("\twhen", content.getContent());
  }
View Full Code Here

TOP

Related Classes of org.drools.assistant.info.drl.RuleBasicContentInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.