use of org.drools.template.model.DRLOutput in project drools by kiegroup.
the class RuleWorksheetParseTest method testMetadata.
@Test
public void testMetadata() {
makeRuleSet();
makeRuleTable();
makeRow(11, "C", "A", "@", "@");
makeRow(12, "foo: Foo", "foo");
makeRow(13, "attr == $param", "goaway($param)", "Author($param)", "Version($1-$2)");
makeRow(15, "1", "1", "J.W.Goethe", "3,14");
makeRow(16, "2", "2", "", "");
listener.finishSheet();
Package p = listener.getRuleSet();
DRLOutput dout = new DRLOutput();
p.renderDRL(dout);
String drl = dout.getDRL();
assertTrue(drl.contains("@Author(J.W.Goethe)"));
assertTrue(drl.contains("@Version(3-14)"));
assertFalse(drl.contains("@Author()"));
assertFalse(drl.contains("@Version(-)"));
}
use of org.drools.template.model.DRLOutput in project drools by kiegroup.
the class RuleWorksheetParseTest method testPackageAttributeRendering.
/**
* Check correct rendering of package level attributes
*/
@Test
public void testPackageAttributeRendering() {
makeRuleSet();
makeAttribute("NO-LOOP", "true");
makeAttribute("agenda-group", "agroup");
makeRuleTable();
makeRow(11, "C", "A", "P");
makeRow(12, "foo:Foo", "foo");
makeRow(13, "attr == $param", "x($param)");
makeRow(15, "1", "1", "100");
listener.finishSheet();
Package p = listener.getRuleSet();
DRLOutput dout = new DRLOutput();
p.renderDRL(dout);
String drl = dout.getDRL();
// System.out.println( drl );
assertTrue(drl.contains("no-loop true"));
assertTrue(drl.contains("agenda-group \"agroup\""));
}
Aggregations