Community
Participate
Working Groups
After fixing Bug 342644, the following tests from the pivot test suite (https://bugs.eclipse.org/bugs/attachment.cgi?id=194348) that fail for the mature code could be addressed. assertQueryResults(null, "Sequence{1..5}", "Sequence{1..4}->including(5)"); assertQueryInvalid(null, "OrderedSet{'a'}->insertAt(2, 'a')"); assertQueryResults(null, "OrderedSet{'b'}", "OrderedSet{'a', 'b', 'c'} - Set{'c', 'a'}"); assertQueryEquals(null, 9.0, "Set{4, 4.0, 5.0}->sum()"); assertQueryFalse(null, "Bag{1} = 1"); assertQueryResults(null, "Bag{'a', 'b'}", "Bag{'a', 'b', 'a'}->intersection(Bag{'a', 'b', 'c'})"); assertQueryEquals(null, 2, "Sequence{1, 2}->max()"); assertQueryEquals(null, 1, "Sequence{1, 2}->min()"); assertQueryTrue(null, "Bag{1} <> 1"); assertQueryFalse(null, "* = -1"); assertQueryTrue(null, "* <> -1"); assertQueryEquals(null, "t", "'test'.at(1)"); assertQueryEquals(null, new String[] {}, "''.characters()"); assertQueryFalse(null, "'test'.equalsIgnoreCase('se')"); assertQueryEquals(null, 1, "'test'.indexOf('t')"); assertQueryEquals(null, "concatenationTest", "'concatenation' + 'Test'"); assertQueryEquals(null, "4", "'4'.toLowerCase()"); assertQueryEquals(null, "4", "'4'.toUpperCase()"); and toString().
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()"); }