[ https://issues.apache.org/jira/browse/JCR-3313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Randall Hauch updated JCR-3313: ------------------------------- Description: The 'org.apache.jackrabbit.test.api.query.qom.ColumnTest.testExpandColumnsForNodeType()' test method issues the following query: SELECT s.* FROM [nt:unstructured] AS s and then proceeds to check that the columns in the results set. However, there is at least one and possibly two issues with the expectations in the test. Firstly, the test assumes that each column name include the selector alias (for example "s.jcr:primaryType"); this is not specified or required in the specification, and since only one selector is used, the column names technically do not need the selector. Secondly (and more critically), the test assumes that the result set *only* contains columns for the single-valued, non-residual property definitions for the selected node type. Clearly this is overly constraining, since Section 6.7.1 of the JSR-283 specification clearly allows an implementation to return additional columns (e.g., multi-valued property definitions). Here's the relevant parts of this section: A {{Query}} consists of: ... • A list of zero or more {{Column}}s to include in the tabular view of the query results. If no columns are specified, the columns available in the tabular view are implementation determined, but minimally include, for each selector, a column for each single-valued non-residual property of the selector's node type. In the test's query, no columns are specified for the selector 's', so the result set must to have AT A MINIMUM the columns for the single-valued non-residual property defined on the selector's node type, but an implementation CAN include columns for other properties defined on the selector's node type. An implementation is even allowed to include columns that do not map to properties defined on the selector's node type (e.g., pseudo-columns that don't really exist as properties). The test's query uses "nt:unstructured" for the test node type (if not overridden by the test environment), and in this case an implementation should be allowed to include the 'jcr:mixinTypes' multi-valued property. Therefore, the test is overly strict and should not fail when extra columns are included. The correct behavior is to test only that the result includes AT LEAST a column for each single-valued non-residual property on the selector's node type. was: The {{org.apache.jackrabbit.test.api.query.qom.ColumnTest.testExpandColumnsForNodeType()}} test method issues the following query: SELECT s.* FROM [nt:unstructured] AS s and then proceeds to check that the columns in the results set. However, there is at least one and possibly two issues with the expectations in the test. Firstly, the test assumes that each column name include the selector alias (for example "s.jcr:primaryType"); this is not specified or required in the specification, and since only one selector is used, the column names technically do not need the selector. Secondly (and more critically), the test assumes that the result set *only* contains columns for the single-valued, non-residual property definitions for the selected node type. Clearly this is overly constraining, since Section 6.7.1 of the JSR-283 specification clearly allows an implementation to return additional columns (e.g., multi-valued property definitions). Here's the relevant parts of this section: A {{Query}} consists of: ... • A list of zero or more {{Column}}s to include in the tabular view of the query results. If no columns are specified, the columns available in the tabular view are implementation determined, but minimally include, for each selector, a column for each single-valued non-residual property of the selector's node type. In the test's query, no columns are specified for the selector 's', so the result set must to have AT A MINIMUM the columns for the single-valued non-residual property defined on the selector's node type, but an implementation CAN include columns for other properties defined on the selector's node type. An implementation is even allowed to include columns that do not map to properties defined on the selector's node type (e.g., pseudo-columns that don't really exist as properties). The test's query uses "nt:unstructured" for the test node type (if not overridden by the test environment), and in this case an implementation should be allowed to include the 'jcr:mixinTypes' multi-valued property. Therefore, the test is overly strict and should not fail when extra columns are included. The correct behavior is to test only that the result includes AT LEAST a column for each single-valued non-residual property on the selector's node type. > JCR TCK Test for expanding column names is too restrictive > ---------------------------------------------------------- > > Key: JCR-3313 > URL: https://issues.apache.org/jira/browse/JCR-3313 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-jcr-tests, JCR 2.0 > Affects Versions: 2.4.1 > Reporter: Randall Hauch > > The > 'org.apache.jackrabbit.test.api.query.qom.ColumnTest.testExpandColumnsForNodeType()' > test method issues the following query: > SELECT s.* FROM [nt:unstructured] AS s > and then proceeds to check that the columns in the results set. However, > there is at least one and possibly two issues with the expectations in the > test. > Firstly, the test assumes that each column name include the selector alias > (for example "s.jcr:primaryType"); this is not specified or required in the > specification, and since only one selector is used, the column names > technically do not need the selector. > Secondly (and more critically), the test assumes that the result set *only* > contains columns for the single-valued, non-residual property definitions for > the selected node type. Clearly this is overly constraining, since Section > 6.7.1 of the JSR-283 specification clearly allows an implementation to return > additional columns (e.g., multi-valued property definitions). Here's the > relevant parts of this section: > A {{Query}} consists of: > ... > • A list of zero or more {{Column}}s to include in the tabular view of > the query results. > If no columns are specified, the columns available in the tabular view > are implementation > determined, but minimally include, for each selector, a column for each > single-valued > non-residual property of the selector's node type. > In the test's query, no columns are specified for the selector 's', so the > result set must to have AT A MINIMUM the columns for the single-valued > non-residual property defined on the selector's node type, but an > implementation CAN include columns for other properties defined on the > selector's node type. An implementation is even allowed to include columns > that do not map to properties defined on the selector's node type (e.g., > pseudo-columns that don't really exist as properties). > The test's query uses "nt:unstructured" for the test node type (if not > overridden by the test environment), and in this case an implementation > should be allowed to include the 'jcr:mixinTypes' multi-valued property. > Therefore, the test is overly strict and should not fail when extra columns > are included. The correct behavior is to test only that the result includes > AT LEAST a column for each single-valued non-residual property on the > selector's node type. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira