| Summary: | [evaluator] inconsistent failures with respect tp the pivot evaluator | ||
|---|---|---|---|
| Product: | [Modeling] OCL | Reporter: | Ed Willink <ed> |
| Component: | Core | Assignee: | OCL Inbox <mdt-ocl-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.1.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | Legacy | ||
|
Description
Ed Willink
Just written some tests for implicit oclAsSet for the pivot evaluator. The three ->oclIsUndefined() tests give "Cannot find operation" for the mature code and in the case of invalid->oclIsUndefined(), which made me think hard, complained that the operation was not found on Set(OclInvalid).
/**
* Tests the implicit oclAsSet() operator.
*/
public void test_oclAsSet_implicit() {
assertExpressionResults("Set{true}", "true->select(true)");
assertExpressionResults("Set{true}", "Set{true}->select(true)");
assertExpressionResults("Set{}", "null->select(true)");
assertExpressionResults("Set{}", "Set{}->select(true)");
assertExpressionResults("Set{null}", "Set{null}->select(true)");
assertResultInvalid("invalid->select(true)");
//
assertExpressionResults("false", "true.oclIsUndefined()");
assertExpressionResults("false", "true->oclIsUndefined()"); // Set{true}
assertExpressionResults("true", "null.oclIsUndefined()");
assertExpressionResults("false", "null->oclIsUndefined()"); // Set{}
assertExpressionResults("true", "invalid.oclIsUndefined()");
assertExpressionResults("true", "invalid->oclIsUndefined()"); // invalid
//
assertQueryEquals(null, 4, "'1234'.size()");
assertQueryEquals(null, 1, "'1234'->size()");
}
|