Return-Path: Delivered-To: apmail-incubator-jackrabbit-commits-archive@www.apache.org Received: (qmail 35291 invoked from network); 29 Mar 2005 10:11:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Mar 2005 10:11:20 -0000 Received: (qmail 2656 invoked by uid 500); 29 Mar 2005 10:11:20 -0000 Mailing-List: contact jackrabbit-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-commits@incubator.apache.org Received: (qmail 2642 invoked by uid 500); 29 Mar 2005 10:11:20 -0000 Delivered-To: apmail-incubator-jackrabbit-cvs@incubator.apache.org Received: (qmail 2639 invoked by uid 99); 29 Mar 2005 10:11:20 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 29 Mar 2005 02:11:19 -0800 Received: (qmail 35273 invoked by uid 65534); 29 Mar 2005 10:11:18 -0000 Message-ID: <20050329101118.35268.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Tue, 29 Mar 2005 10:11:18 -0000 Subject: svn commit: r159361 - in incubator/jackrabbit/trunk: applications/test/ src/test/org/apache/jackrabbit/test/api/query/ To: jackrabbit-cvs@incubator.apache.org From: mreutegg@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mreutegg Date: Tue Mar 29 02:11:15 2005 New Revision: 159361 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D159361 Log: JCR-88: jcr:path is in QueryResult is only tested with SQL Added: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/quer= y/SQLJcrPathTest.java - copied, changed from r159360, incubator/jackrabbit/trunk/src/test/o= rg/apache/jackrabbit/test/api/query/JcrPathTest.java incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/quer= y/XPathJcrPathTest.java (with props) Removed: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/quer= y/JcrPathTest.java Modified: incubator/jackrabbit/trunk/applications/test/repositoryStubImpl.propert= ies incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/quer= y/TestAll.java Modified: incubator/jackrabbit/trunk/applications/test/repositoryStubImpl.p= roperties URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/applications/= test/repositoryStubImpl.properties?view=3Ddiff&r1=3D159360&r2=3D159361 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jackrabbit/trunk/applications/test/repositoryStubImpl.propert= ies (original) +++ incubator/jackrabbit/trunk/applications/test/repositoryStubImpl.propert= ies Tue Mar 29 02:11:15 2005 @@ -305,6 +305,9 @@ # Test class: XPathSyntaxTest javax.jcr.tck.XPathSyntaxTest.testroot=3D/testdata/query =20 +# Test class: XPathJcrPathTest +javax.jcr.tck.XPathJcrPathTest.testroot=3D/testdata + # Test class: SQLQueryLevel1Test javax.jcr.tck.SQLQueryLevel1Test.testroot=3D/testdata/query =20 @@ -320,8 +323,8 @@ # Test class: GetPropertyNamesTest javax.jcr.tck.GetPropertyNamesTest.testroot=3D/testdata =20 -# Test class: JcrPathTest -javax.jcr.tck.JcrPathTest.testroot=3D/testdata +# Test class: SQLJcrPathTest +javax.jcr.tck.SQLJcrPathTest.testroot=3D/testdata =20 # Test class: PredicatesTest javax.jcr.tck.PredicatesTest.testroot=3D/testdata Copied: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/= query/SQLJcrPathTest.java (from r159360, incubator/jackrabbit/trunk/src/tes= t/org/apache/jackrabbit/test/api/query/JcrPathTest.java) URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/= apache/jackrabbit/test/api/query/SQLJcrPathTest.java?view=3Ddiff&rev=3D1593= 61&p1=3Dincubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/= query/JcrPathTest.java&r1=3D159360&p2=3Dincubator/jackrabbit/trunk/src/test= /org/apache/jackrabbit/test/api/query/SQLJcrPathTest.java&r2=3D159361 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/quer= y/JcrPathTest.java (original) +++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/quer= y/SQLJcrPathTest.java Tue Mar 29 02:11:15 2005 @@ -33,7 +33,7 @@ * @executeClass org.apache.jackrabbit.test.api.query.JcrPathTest * @keywords sql */ -public class JcrPathTest extends AbstractQueryTest { +public class SQLJcrPathTest extends AbstractQueryTest { =20 /** A read-only session */ private Session session; Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/ap= i/query/TestAll.java URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/= apache/jackrabbit/test/api/query/TestAll.java?view=3Ddiff&r1=3D159360&r2=3D= 159361 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/quer= y/TestAll.java (original) +++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/quer= y/TestAll.java Tue Mar 29 02:11:15 2005 @@ -41,10 +41,12 @@ suite.addTestSuite(SQLOrderByTest.class); suite.addTestSuite(SQLQueryLevel2Test.class); suite.addTestSuite(SQLJoinTest.class); + suite.addTestSuite(SQLJcrPathTest.class); suite.addTestSuite(XPathPosIndexTest.class); suite.addTestSuite(XPathDocOrderTest.class); suite.addTestSuite(XPathOrderByTest.class); suite.addTestSuite(XPathQueryLevel2Test.class); + suite.addTestSuite(XPathJcrPathTest.class); =20 suite.addTestSuite(DerefQueryLevel1Test.class); suite.addTestSuite(ElementTest.class); @@ -55,7 +57,6 @@ suite.addTestSuite(GetStatementTest.class); suite.addTestSuite(GetSupportedQueryLanguagesTest.class); =20 - suite.addTestSuite(JcrPathTest.class); suite.addTestSuite(GetPropertyNamesTest.class); suite.addTestSuite(PredicatesTest.class); suite.addTestSuite(SimpleSelectionTest.class); Added: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/q= uery/XPathJcrPathTest.java URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/= apache/jackrabbit/test/api/query/XPathJcrPathTest.java?view=3Dauto&rev=3D15= 9361 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/quer= y/XPathJcrPathTest.java (added) +++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/quer= y/XPathJcrPathTest.java Tue Mar 29 02:11:15 2005 @@ -0,0 +1,89 @@ +/* + * Copyright 2004-2005 The Apache Software Foundation or its licensors, + * as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.test.api.query; + +import org.apache.jackrabbit.test.NotExecutableException; + +import javax.jcr.Session; +import javax.jcr.RepositoryException; +import javax.jcr.Repository; +import javax.jcr.query.Query; +import javax.jcr.query.QueryResult; + +/** + * Tests if the jcr:path property is returned at the correct position in t= he + * query result. + * + * @test + * @sources JcrPathTest.java + * @executeClass org.apache.jackrabbit.test.api.query.JcrPathTest + * @keywords level1 + */ +public class XPathJcrPathTest extends AbstractQueryTest { + + /** A read-only session */ + private Session session; + + /** + * Sets up the test cases + */ + protected void setUp() throws Exception { + isReadOnly =3D true; + super.setUp(); + session =3D helper.getReadOnlySession(); + testRootNode =3D session.getRootNode().getNode(testPath); + } + + /** + * Releases the session acquired in setUp(). + */ + protected void tearDown() throws Exception { + if (session !=3D null) { + session.logout(); + } + super.tearDown(); + } + + /** + * Verify that the jcr:path is the first property from the found prope= rty + * names, when explicitely declared in query statement. + * + * @throws NotExecutableException if the repository does not support t= he + * jcr:path property in the query resul= t=2E + */ + public void testJcrPath() throws RepositoryException, NotExecutableExc= eption { + String nodeTypeName =3D session.getRootNode().getPrimaryNodeType()= .getName(); + String queryStatement =3D "//element(*, " + nodeTypeName + ")/@" += jcrPath; + + // verify that jcr:path is supported + if (session.getRepository().getDescriptor(Repository.QUERY_JCRPATH= ) =3D=3D null) { + throw new NotExecutableException(jcrPath + " not supported"); + } + + // execute the search query + Query query =3D session.getWorkspace().getQueryManager().createQue= ry(queryStatement, Query.XPATH); + QueryResult result =3D query.execute(); + + String[] propNames =3D result.getPropertyNames(); + if (propNames.length > 0) { + // jcr:path should be the first column + assertEquals(jcrPath + " should be the first property", jcrPat= h, propNames[0]); + } + } + + +} Propchange: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/= api/query/XPathJcrPathTest.java ---------------------------------------------------------------------------= --- svn:eol-style =3D native