You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by tr...@apache.org on 2014/08/12 17:44:04 UTC

svn commit: r1617510 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java

Author: tripod
Date: Tue Aug 12 15:44:04 2014
New Revision: 1617510

URL: http://svn.apache.org/r1617510
Log:
OAK-2024 Add test case

Added:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java

Added: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java?rev=1617510&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java (added)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java Tue Aug 12 15:44:04 2014
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.oak.jcr;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.JcrConstants;
+import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class MiscTest extends AbstractJCRTest {
+
+    @Ignore("OAK-2024")
+    @Test
+    public void testTraverseIndex() throws Exception {
+        AccessControlUtils.denyAllToEveryone(superuser, "/oak:index");
+        superuser.save();
+        Node index = superuser.getNode("/oak:index");
+        traverse(index);
+    }
+
+
+    private void traverse(Node node) throws RepositoryException {
+        System.out.println(node.getPath());
+        PropertyIterator iter = node.getProperties();
+        while (iter.hasNext()) {
+            Property p = iter.nextProperty();
+            System.out.println(p.getPath());
+            p.getDefinition();
+        }
+        NodeIterator niter = node.getNodes();
+        while (niter.hasNext()) {
+            traverse(niter.nextNode());
+        }
+    }
+}
\ No newline at end of file



Re: svn commit: r1617510 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java

Posted by Tobias Bocanegra <tr...@adobe.com>.
or use another base class...fixed problem in  r1617701

On Wed, Aug 13, 2014 at 12:21 PM, Michael Dürig <md...@apache.org> wrote:
>
>
> On 13.8.14 11:20 , Davide Giannella wrote:
>>
>> On 12/08/2014 17:44, tripod@apache.org wrote:
>>>
>>> Added:
>>>
>>> jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java
>>>
>>> ...
>>> +public class MiscTest extends AbstractJCRTest {
>>> +
>>> +    @Ignore("OAK-2024")
>>> +    @Test
>>> +    public void testTraverseIndex() throws Exception {
>>> +
>>
>> It seems to me that AbstractJCRTest uses Junit3 constructs and ignore
>> the @Ignore statements.
>>
>> The test is failing and breaking the build. The only quick solution I
>> have so far is to comment out the test method leaving the test signature
>> available otherwise JUnit3 will complain of a class with no tests in it.
>>
>
> I guess you could add it to the know.issue property [1].
>
> Michael
>
> [1] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-jcr/pom.xml#L35

Re: svn commit: r1617510 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java

Posted by Michael Dürig <md...@apache.org>.

On 13.8.14 11:20 , Davide Giannella wrote:
> On 12/08/2014 17:44, tripod@apache.org wrote:
>> Added:
>>      jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java
>>
>> ...
>> +public class MiscTest extends AbstractJCRTest {
>> +
>> +    @Ignore("OAK-2024")
>> +    @Test
>> +    public void testTraverseIndex() throws Exception {
>> +
> It seems to me that AbstractJCRTest uses Junit3 constructs and ignore
> the @Ignore statements.
>
> The test is failing and breaking the build. The only quick solution I
> have so far is to comment out the test method leaving the test signature
> available otherwise JUnit3 will complain of a class with no tests in it.
>

I guess you could add it to the know.issue property [1].

Michael

[1] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-jcr/pom.xml#L35

Re: svn commit: r1617510 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Wed, Aug 13, 2014 at 11:20 AM, Davide Giannella <da...@apache.org> wrote:
...
>> +public class MiscTest extends AbstractJCRTest {
...

FWIW, after writing tons of tests for Sling I've moved away from using
inheritance - composition and utility classes is much more convenient
IMO.

-Bertrand

Re: svn commit: r1617510 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java

Posted by Davide Giannella <da...@apache.org>.
On 12/08/2014 17:44, tripod@apache.org wrote:
> Added:
>     jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MiscTest.java
>
> ...
> +public class MiscTest extends AbstractJCRTest {
> +
> +    @Ignore("OAK-2024")
> +    @Test
> +    public void testTraverseIndex() throws Exception {
> +  
It seems to me that AbstractJCRTest uses Junit3 constructs and ignore
the @Ignore statements.

The test is failing and breaking the build. The only quick solution I
have so far is to comment out the test method leaving the test signature
available otherwise JUnit3 will complain of a class with no tests in it.

D.