You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2017/10/08 14:23:00 UTC

[jira] [Commented] (JCRVLT-211) DefaultProjectTest.package_contains_correct_files fails with incorrect order of files below META-INF/vault

    [ https://issues.apache.org/jira/browse/JCRVLT-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16196128#comment-16196128 ] 

Konrad Windszus commented on JCRVLT-211:
----------------------------------------

The reason is the call to {{ContentPackageArchiver.addDirectory(...)}} in https://github.com/apache/jackrabbit-filevault-package-maven-plugin/blob/trunk/plugin/src/main/java/org/apache/jackrabbit/filevault/maven/packaging/VaultMojo.java#L413. This internally uses the DirectoryScanner.scan() from Plexus Utils. This uses {{java.io.File.list()}} in its {{scandir}} method. The javadoc of list explicitly states the following

bq. There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order. 
(https://docs.oracle.com/javase/7/docs/api/java/io/File.html#list()).

Therefore the order should only be checked with a granularity of the filter entries but not below within this IT.

> DefaultProjectTest.package_contains_correct_files fails with incorrect order of files below META-INF/vault
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: JCRVLT-211
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-211
>             Project: Jackrabbit FileVault
>          Issue Type: Bug
>          Components: package maven plugin
>    Affects Versions: package-maven-plugin-1.0.0
>            Reporter: Konrad Windszus
>
> For me the IT at https://github.com/apache/jackrabbit-filevault-package-maven-plugin/blob/trunk/it/src/test/java/org/apache/jackrabbit/filevault/maven/packaging/DefaultProjectTest.java#L65 fails with the following error message:
> {code}
> Running org.apache.jackrabbit.filevault.maven.packaging.DefaultProjectTest
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.442 sec <<< FAILURE! - in org.apache.jackrabbit.filevault.maven.packaging.DefaultProjectTest
> package_contains_correct_files(org.apache.jackrabbit.filevault.maven.packaging.DefaultProjectTest)  Time elapsed: 2.442 sec  <<< FAILURE!
> org.junit.ComparisonFailure: 
> File List expected:<...ult/
> META-INF/vault/[config.xml
> META-INF/vault/filter.xml
> META-INF/vault/properties.xml
> META-INF/vault/settings.xml
> jcr_root/
> jcr_root/apps/
> jcr_root/apps/wcm/
> jcr_root/apps/wcm/core/
> jcr_root/apps/wcm/core/content/
> jcr_root/apps/wcm/core/content/.content.xml
> jcr_root/apps/wcm/core/content/siteadmin.xml
> jcr_root/_rep_policy.xml
> jcr_root/etc/
> jcr_root/etc/designs/
> jcr_root/etc/designs/some-thirdparty-libs/
> jcr_root/etc/designs/some-thirdparty-libs/clientlibs/
> jcr_root/etc/designs/some-thirdparty-libs/clientlibs/thirdparty-common/
> jcr_root/etc/designs/some-thirdparty-libs/.content.xml
> jcr_root/etc/designs/some-thirdparty-libs/clientlibs/thirdparty-common/.content.xml
> jcr_root/etc/designs/some-thirdparty-libs/clientlibs/thirdparty-common/js.txt
> jcr_root/etc/cloudservices/
> jcr_root/etc/cloudservices/ooyala/
> jcr_root/etc/cloudservices/ooyala/.content.xml
> jcr_root/etc/cloudservices/.content.xml
> jcr_root/apps/wcm/.content.xml
> jcr_root/apps/wcm/core]/.content.xml
> META-I...> but was:<...ult/
> META-INF/vault/[settings.xml
> META-INF/vault/properties.xml
> META-INF/vault/config.xml
> META-INF/vault/filter.xml
> jcr_root/
> jcr_root/apps/
> jcr_root/apps/wcm/
> jcr_root/apps/wcm/core/
> jcr_root/apps/wcm/core/content/
> jcr_root/apps/wcm/core/content/.content.xml
> jcr_root/apps/wcm/core/content/siteadmin.xml
> jcr_root/_rep_policy.xml
> jcr_root/etc/
> jcr_root/etc/designs/
> jcr_root/etc/designs/some-thirdparty-libs/
> jcr_root/etc/designs/some-thirdparty-libs/clientlibs/
> jcr_root/etc/designs/some-thirdparty-libs/clientlibs/thirdparty-common/
> jcr_root/etc/designs/some-thirdparty-libs/clientlibs/thirdparty-common/js.txt
> jcr_root/etc/designs/some-thirdparty-libs/clientlibs/thirdparty-common/.content.xml
> jcr_root/etc/designs/some-thirdparty-libs/.content.xml
> jcr_root/etc/cloudservices/
> jcr_root/etc/cloudservices/ooyala/
> jcr_root/etc/cloudservices/ooyala/.content.xml
> jcr_root/etc/cloudservices/.content.xml
> jcr_root/apps/wcm/core/.content.xml
> jcr_root/apps/wcm]/.content.xml
> META-I...>
> 	at org.apache.jackrabbit.filevault.maven.packaging.DefaultProjectTest.package_contains_correct_files(DefaultProjectTest.java:65)
> {code}
> All other ITs succeed.
> My Maven data is as follows:
> {code}
> Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
> Maven home: /usr/local/Cellar/maven/3.5.0/libexec
> Java version: 1.8.0_144, vendor: Oracle Corporation
> Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "10.13", arch: "x86_64", family: "mac"
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)