Skip to content

Commit cacb2fd

Browse files
committed
BZ-1043395 - Invalid rules in jboss-bpm-example (Big App) - can't be opened/validated in Guider Rule Editor
1 parent c545fce commit cacb2fd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drools-workbench-models/drools-workbench-models-commons/src/test/java/org/drools/workbench/models/commons/backend/rule/RuleModelDRLPersistenceUnmarshallingTest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,26 @@ public void testEval() {
898898
assertEquals( "eval( true )", ( (FreeFormLine) m.lhs[ 0 ] ).getText() );
899899
}
900900

901+
@Test
902+
@Ignore("https://bugzilla.redhat.com/show_bug.cgi?id=1043395 - big data")
903+
public void testFreeFormLine() {
904+
String drl = "rule rule1\n"
905+
+ "when\n"
906+
+ "then\n"
907+
+ "int test = (int)(1-0.8);\n"
908+
+ "System.out.println( \"Hello Mario!\" );\n"
909+
+ "end";
910+
911+
RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl, dmo );
912+
913+
assertNotNull( m );
914+
assertEquals( 2, m.rhs.length );
915+
assertTrue( m.rhs[ 0 ] instanceof FreeFormLine );
916+
assertEquals( "int test = (int)(1-0.8);", ( (FreeFormLine) m.rhs[ 0 ] ).getText() );
917+
assertTrue( m.rhs[ 1 ] instanceof FreeFormLine );
918+
assertEquals( "System.out.println( \"Hello Mario!\" );", ( (FreeFormLine) m.rhs[ 1 ] ).getText() );
919+
}
920+
901921
@Test
902922
public void testNestedFieldExpressions() {
903923
String drl =

0 commit comments

Comments
 (0)