|
[
Permlink
| « Hide
]
Craig Russell added a comment - 22/Mar/06 11:18 AM
I agree that the test is invalid. There is nothing else of value in the test, so I propose to drop the test from the TCK.
I agree we should drop the test from the TCK.
It might make sense to have a negative test case with a query calling a mutating method such as Collection.add. Calling a mutating method is not allowed in JDOQL. I also think that this test should be dropped. A negative test might cause a new problem - how the implementation can check if a method is mutating in the general case? I think we already have enough byte code processing in the enhancer.
I think a word about why we used the term "mutating method" is in order here.
The expert group did not want to allow the user and implementation to use query as a back door to a generalized UPDATE facility, so we said specifically that mutating methods were not allowed, even in vendor extensions. That said, there are only a small number of standard mutating methods that return a value, and hence even could be used in a filter. So I think we are safe in dropping this test and we can debate the value of a new test later on if someone wants to raise the issue again. On a second thought, maybe the test should be preserved as a negative test but refer to non existing methods? In this case an implementation that supports additional method as an extension should still throw an exception.
Can this be resolved for maintenance release 1? Simply by discarding the test or by switching to non existing methods?
Attached you find a patch for review. I changed the test to call methods Collection.add and Collection.remove that are known to be mutating.
Thanks. A tiny comment - the import in line 24 (import org.apache.jdo.tck.JDO_Test) is not needed.
Cleaned up the imports and checked in the patch into the trunk and into branch 2.0.1 (see revision 453263).
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||