You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2015/01/06 07:54:34 UTC

[jira] [Commented] (SLING-4283) Use config from builder in testing application

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

Chetan Mehrotra commented on SLING-4283:
----------------------------------------

Maven Launchpad Plugin does have support for extracting the zipped config and use it as part of Sling launch [1]. To make use of that following dependency needs to be added

{code:xml}
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.launchpad</artifactId>
            <version>8-SNAPSHOT</version>
            <type>partialbundlelist</type>
            <classifier>bundlelist</classifier>
        </dependency>
{code}

This triggers unpacking of the config files to {{target/tmpConfigDir}}. However current logic does not handle subdirectory in config folder [2] (also see comment at handleConfigSubpath in [2]) due to which these config files are not picked up.

{code:title=BundleListContentProvider.java|linenumbers=true|firstline=224}
    private Iterator<String> handleConfigSubpath(String path) {
        // We don't handle config subpaths for now, but do not 
        // warn if we're asked for the children of a file, just
        // return empty in that case
        final File f = getConfigFile(path);
        if(!f.exists()) {
            getLog().warn("BundleListContentProvider cannot get children of config path: " + path);
        }
        return EMPTY_STRING_LIST.iterator();
    }
{code}

Looking at the code it appears that sub directories can easily be support by changing the login in [2] to not filter out directories and fix the logic in {{handleConfigSubpath}} . Sling launchpad would then do the required traversal

[~bdelacretaz] [~cziegeler] Thoughts?

Another workaround would be to set {{sling.fileinstall.dir}} in testing/src/test/config/sling.properties and then using maven, unpack the config in that folder

Or another shortterm workaround is to copy the required config files. Currently we have anyway copied the SegmentNodeStore service config so we can add few more and fix the issue in Launchpad plugin going forward!

[1] https://github.com/apache/sling/blob/trunk/tooling/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java#L289-300
[2] https://github.com/apache/sling/blob/trunk/tooling/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java#L72-93

> Use config from builder in testing application
> ----------------------------------------------
>
>                 Key: SLING-4283
>                 URL: https://issues.apache.org/jira/browse/SLING-4283
>             Project: Sling
>          Issue Type: Sub-task
>          Components: Testing
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: Launchpad Testing 7
>
>
> The testing application does not use the config present in {{org.apache.sling.launchpad}}. This cause test failures when running with Oak as required configuration is not installed [1]
> As a fix the testing module should use the config from launchpad module
> [1] http://markmail.org/thread/xfljme3swaexpcvw



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)