| org.drools.DroolsTestCase org.drools.rule.LogicTransformerTest
testCloneable | public void testCloneable()(Code) | | |
testEliminateEmptyBranchesAndDuplications | public void testEliminateEmptyBranchesAndDuplications() throws InvalidRuleException(Code) | | |
testExistOrTransformation | public void testExistOrTransformation() throws InvalidPatternException(Code) | | This data structure is now valid (Exists (OR (A B) ) )
Exists
|
or
/ \
a b
Should become:
Or
/ \
Exists Exists
| |
a b
|
testMultipleOrAndOrTransformation | public void testMultipleOrAndOrTransformation() throws InvalidPatternException(Code) | | (a||b)&&c
And
/|\ \__
_/ | \_ \_
/ | \ \
or | or not
/ \ | / \ |
a b c d e f
Should become (a&&c)||(b&&c)
/\
_/ \_
/ \
_/| |\_
__/ | | \__
__/ | | \__
/ | | \
and and and and
/||\ /||\ /||\ /||\
a cd Not a ce Not b cd Not b ce Not
| | | |
f f f f
|
testNotOrTransformation | public void testNotOrTransformation() throws InvalidPatternException(Code) | | This data structure is now valid
(Not (OR (A B) ) )
Not
|
or
/ \
a b
Should become:
And
/ \
Not Not
| |
a b
|
testProcessTree | public void testProcessTree() throws IOException, ClassNotFoundException, InvalidPatternException(Code) | |
_/|\_
__/ | \__
/ | \
__/ | \__
/ | \
And and Not
/ | \ / \ |
a And d e Or i
/ \ / \
b Not h Exists
| |
Not g
|
c
It is important to ensure that the order of
the elements is not changed after transformation
Or
_/ \__
__/ \___
/ \__
__/ \__
/ \__
/ \__
| \
And And
/| | | | | \ /| | | | | \
a b Not d e h Not a b Not d e Exists Not
| | | | |
Not i Not g i
| |
c c
throws: IOException - throws: ClassNotFoundException - |
testSingleOrAndOrTransformation | public void testSingleOrAndOrTransformation() throws InvalidPatternException(Code) | | (a||b)&&c
and
/ \
or c
/ \
a b
Should become (a&&c)||(b&&c)
or
/ \
/ \
/ \
and and
/ \ / \
a c b c
|
|
|