You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2012/12/05 17:35:01 UTC
[jira] [Commented] (OAK-484) QueryResultTest failing
[ https://issues.apache.org/jira/browse/OAK-484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510568#comment-13510568 ]
Thomas Mueller commented on OAK-484:
------------------------------------
Mostly fixed in revision 1417514.
There is one test that still fails, but I think it's a bug in the test: "order by" is not used but the test assumes the rows are returned in a specific order. Suggested patch:
{code}
--- src/test/java/org/apache/jackrabbit/core/query/QueryResultTest.java (revision 1401579)
+++ src/test/java/org/apache/jackrabbit/core/query/QueryResultTest.java (working copy)
@@ -104,7 +104,7 @@
public void testSkip() throws RepositoryException {
QueryManager qm = superuser.getWorkspace().getQueryManager();
for (int i = 0; i < 10; i++) {
- String stmt = testPath + "/*[@" + propertyName1 + " < 1000]";
+ String stmt = testPath + "/*[@" + propertyName1 + " < 1000] order by @" + propertyName1;
QueryResult result = qm.createQuery(stmt, Query.XPATH).execute();
for (int j = 0; j < INITIAL_NODE_NUM - i; j++) {
// skip to each node in the result
@@ -113,7 +113,7 @@
long propValue = it.nextNode().getProperty(propertyName1).getLong();
// expected = number of skipped nodes + number of deleted nodes
long expected = j + i;
- assertEquals("Wrong node after skip()", expected, propValue);
+ assertEquals("Wrong node after skip " + j, expected, propValue);
}
try {
NodeIterator it = result.getNodes();
{code}
> QueryResultTest failing
> -----------------------
>
> Key: OAK-484
> URL: https://issues.apache.org/jira/browse/OAK-484
> Project: Jackrabbit Oak
> Issue Type: Sub-task
> Components: jcr
> Reporter: Alex Parvulescu
>
> The {{QueryResultTest}} has some tests that are failing:
> {{testGetSize}} Wrong size of NodeIterator in result expected:<55> but was:<3>
> {{testGetSizeOrderByScore}} Wrong size of NodeIterator in result expected:<55> but was:<3>
> {{testIteratorNext}} Wrong size of NodeIterator in result expected:<55> but was:<3>
> {{testIteratorNextOrderByScore}} Wrong size of NodeIterator in result expected:<55> but was:<3>
> {{testSkip}} Wrong node after skip() expected:<0> but was:<1>
> {{testSkipOrderByProperty}} Wrong node after skip() expected:<2> but was:<10>
>
> Full trace here
> {code}
> org.apache.jackrabbit.core.query.QueryResultTest
> testGetSize(org.apache.jackrabbit.core.query.QueryResultTest)
> junit.framework.AssertionFailedError: Wrong size of NodeIterator in result expected:<55> but was:<3>
> at junit.framework.Assert.fail(Assert.java:50)
> at junit.framework.Assert.failNotEquals(Assert.java:287)
> at junit.framework.Assert.assertEquals(Assert.java:67)
> at junit.framework.Assert.assertEquals(Assert.java:134)
> at org.apache.jackrabbit.core.query.QueryResultTest.testGetSize(QueryResultTest.java:47)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at junit.framework.TestSuite.run(TestSuite.java:238)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at org.apache.jackrabbit.test.ConcurrentTestSuite.access$001(ConcurrentTestSuite.java:29)
> at org.apache.jackrabbit.test.ConcurrentTestSuite$2.run(ConcurrentTestSuite.java:67)
> at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Thread.java:662)
> testGetSizeOrderByScore(org.apache.jackrabbit.core.query.QueryResultTest)
> junit.framework.AssertionFailedError: Wrong size of NodeIterator in result expected:<55> but was:<3>
> at junit.framework.Assert.fail(Assert.java:50)
> at junit.framework.Assert.failNotEquals(Assert.java:287)
> at junit.framework.Assert.assertEquals(Assert.java:67)
> at junit.framework.Assert.assertEquals(Assert.java:134)
> at org.apache.jackrabbit.core.query.QueryResultTest.testGetSizeOrderByScore(QueryResultTest.java:60)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at junit.framework.TestSuite.run(TestSuite.java:238)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at org.apache.jackrabbit.test.ConcurrentTestSuite.access$001(ConcurrentTestSuite.java:29)
> at org.apache.jackrabbit.test.ConcurrentTestSuite$2.run(ConcurrentTestSuite.java:67)
> at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Thread.java:662)
> testIteratorNext(org.apache.jackrabbit.core.query.QueryResultTest)
> junit.framework.AssertionFailedError: Wrong size of NodeIterator in result expected:<55> but was:<3>
> at junit.framework.Assert.fail(Assert.java:50)
> at junit.framework.Assert.failNotEquals(Assert.java:287)
> at junit.framework.Assert.assertEquals(Assert.java:67)
> at junit.framework.Assert.assertEquals(Assert.java:199)
> at org.apache.jackrabbit.core.query.QueryResultTest.testIteratorNext(QueryResultTest.java:78)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at junit.framework.TestSuite.run(TestSuite.java:238)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at org.apache.jackrabbit.test.ConcurrentTestSuite.access$001(ConcurrentTestSuite.java:29)
> at org.apache.jackrabbit.test.ConcurrentTestSuite$2.run(ConcurrentTestSuite.java:67)
> at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Thread.java:662)
> testIteratorNextOrderByScore(org.apache.jackrabbit.core.query.QueryResultTest)
> junit.framework.AssertionFailedError: Wrong size of NodeIterator in result expected:<55> but was:<3>
> at junit.framework.Assert.fail(Assert.java:50)
> at junit.framework.Assert.failNotEquals(Assert.java:287)
> at junit.framework.Assert.assertEquals(Assert.java:67)
> at junit.framework.Assert.assertEquals(Assert.java:199)
> at org.apache.jackrabbit.core.query.QueryResultTest.testIteratorNextOrderByScore(QueryResultTest.java:96)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at junit.framework.TestSuite.run(TestSuite.java:238)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at org.apache.jackrabbit.test.ConcurrentTestSuite.access$001(ConcurrentTestSuite.java:29)
> at org.apache.jackrabbit.test.ConcurrentTestSuite$2.run(ConcurrentTestSuite.java:67)
> at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Thread.java:662)
> testSkip(org.apache.jackrabbit.core.query.QueryResultTest)
> junit.framework.AssertionFailedError: Wrong node after skip() expected:<0> but was:<1>
> at junit.framework.Assert.fail(Assert.java:50)
> at junit.framework.Assert.failNotEquals(Assert.java:287)
> at junit.framework.Assert.assertEquals(Assert.java:67)
> at junit.framework.Assert.assertEquals(Assert.java:134)
> at org.apache.jackrabbit.core.query.QueryResultTest.testSkip(QueryResultTest.java:116)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at junit.framework.TestSuite.run(TestSuite.java:238)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at org.apache.jackrabbit.test.ConcurrentTestSuite.access$001(ConcurrentTestSuite.java:29)
> at org.apache.jackrabbit.test.ConcurrentTestSuite$2.run(ConcurrentTestSuite.java:67)
> at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Thread.java:662)
> testSkipOrderByProperty(org.apache.jackrabbit.core.query.QueryResultTest)
> junit.framework.AssertionFailedError: Wrong node after skip() expected:<2> but was:<10>
> at junit.framework.Assert.fail(Assert.java:50)
> at junit.framework.Assert.failNotEquals(Assert.java:287)
> at junit.framework.Assert.assertEquals(Assert.java:67)
> at junit.framework.Assert.assertEquals(Assert.java:134)
> at org.apache.jackrabbit.core.query.QueryResultTest.testSkipOrderByProperty(QueryResultTest.java:144)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at junit.framework.TestSuite.run(TestSuite.java:238)
> at junit.framework.TestSuite.runTest(TestSuite.java:243)
> at org.apache.jackrabbit.test.ConcurrentTestSuite.access$001(ConcurrentTestSuite.java:29)
> at org.apache.jackrabbit.test.ConcurrentTestSuite$2.run(ConcurrentTestSuite.java:67)
> at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Thread.java:662)
> {code}
--
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