[ 
https://issues.apache.org/jira/browse/OAK-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13444797#comment-13444797
 ] 

Thomas Mueller commented on OAK-288:
------------------------------------

I'd like to keep the internal DSL style for those tests, as it has proven very 
useful to me (very easy to add tests, very easy to verify and change the 
expected results). 

I used the MicroKernel API because it is a stable API, while the oak-core API 
was not stable when I wrote the tests. Those tests are testing the parser and 
the internals of the query engine. The tests are useful even if the changes 
don't go though the CommitHook, as the tests are not really meant to test the 
CommitHook and index implementations. If we want the changes to go though the 
oak-core API instead of using the MicroKernel API directly, the MicroKernel API 
DSL could be replaced with a oak-core DSL. Or even simpler:

We could add a static node structure plus custom indexes (using the oak-core 
API) before executing the script. That way we could test index implementations 
that require the CommitHook to index data.

                
> QueryTests should use the NodeStore apis
> ----------------------------------------
>
>                 Key: OAK-288
>                 URL: https://issues.apache.org/jira/browse/OAK-288
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: Alex Parvulescu
>
> Currently the existing oak query tests come in form of a "script" file [0] 
> that contains 
>  - commit commands which will be executed directly against the mk.
>  - select commands
>  - expected results
> while this was good for fast prototyping we should refactor the tests to use 
> proper unit tests.
> Arguments for refactoring:
>  - overall java style unit tests, reduce the complexity of running this setup
>  - proper reporting unit test failures
>  - executing the commit commands directly against the mk breaks the 
> {{CommitHook}} mechanism because the commits will pass unnoticed
>  - proper separation of concerns - oak core should not directly reference the 
> mk, it should pass through exisiting apis like the {{NodeStore}}
> [0] 
> http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2.txt?view=markup

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to