Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344370 - [evaluator] inconsistent failures with respect tp the pivot evaluator
Summary: [evaluator] inconsistent failures with respect tp the pivot evaluator
Status: NEW
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard: Legacy
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-30 07:58 EDT by Ed Willink CLA
Modified: 2011-11-08 13:28 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2011-04-30 07:58:37 EDT
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().
Comment 1 Ed Willink CLA 2011-05-06 04:02:41 EDT
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()");
	}