jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1344777 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/ColumnTest.java
Date Thu, 31 May 2012 15:34:38 GMT
Author: thomasm
Date: Thu May 31 15:34:38 2012
New Revision: 1344777

URL: http://svn.apache.org/viewvc?rev=1344777&view=rev
Log:
JCR-3313 JCR TCK Test for expanding column names is too restrictive

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/ColumnTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/ColumnTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/ColumnTest.java?rev=1344777&r1=1344776&r2=1344777&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/ColumnTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/ColumnTest.java
Thu May 31 15:34:38 2012
@@ -20,6 +20,8 @@ import java.util.List;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
+import java.util.HashSet;
+import java.util.Set;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Node;
@@ -65,21 +67,21 @@ public class ColumnTest extends Abstract
         forQOMandSQL2(qom, new Callable() {
             public Object call(Query query) throws RepositoryException {
                 QueryResult result = query.execute();
-                List<String> names = new ArrayList<String>(Arrays.asList(result.getColumnNames()));
                 NodeTypeManager ntMgr = superuser.getWorkspace().getNodeTypeManager();
                 NodeType nt = ntMgr.getNodeType(testNodeType);
                 PropertyDefinition[] propDefs = nt.getPropertyDefinitions();
+                Set<String> names = new HashSet<String>();
                 for (int i = 0; i < propDefs.length; i++) {
                     PropertyDefinition propDef = propDefs[i];
                     if (!propDef.isMultiple() && !propDef.getName().equals("*"))
{
                         String columnName = SELECTOR_1 + "." + propDef.getName();
-                        assertTrue("Missing column: " + columnName,
-                                names.remove(columnName));
+                        names.add(columnName);
                     }
                 }
-                for (Iterator<String> it = names.iterator(); it.hasNext(); ) {
-                    fail(it.next() + " is not a property on node type " + testNodeType);
+                for (String columnName : result.getColumnNames()) {
+                    names.remove(columnName);
                 }
+                assertTrue("Missing required column(s): " + names, names.isEmpty());
                 return null;
             }
         });



Mime
View raw message