[
https://issues.apache.org/jira/browse/SLING-4249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stefan Seifert reopened SLING-4249:
-----------------------------------
hmm, this is not so easy. we're talking to the webconsole via the REST API
here, so we cannot directly influence which code path is called there without
changing the webconsole.
bertrand is correct - the action "refreshPackages" just calls
{{getPackageAdmin().refreshPackages( null );}} which is asynchronously. the
same applies when the parameter "refreshPackages" is passed additionally to the
"install" action as proposed by konrad.
we could change the webconsole to support an additional parameter like
"waitForCompletion" with a listener following carstens approach. the
installation of bundles is done asynchronously as well, this is solved in the
test tool by polling via the REST API until the bundle is installed. i assume
we cannot follow the same path for refresh packages because there is no REST
API call that helps detecting whether refresh packages was completed or not.
so, should we enhance the webconsole for this usecase? an alternative approach
would be to insert a fixed delay time after the refreshPackages command, but
this is a fragile hack - if the delay is too short it may fail, if it's too
long it delays the integration test unnecessary long.
> Testing Tools: Refresh Packages should be called after installing or
> uninstalling bundles
> -----------------------------------------------------------------------------------------
>
> Key: SLING-4249
> URL: https://issues.apache.org/jira/browse/SLING-4249
> Project: Sling
> Issue Type: Bug
> Components: Testing
> Affects Versions: org.apache.sling.testing.tools 1.0.8
> Reporter: Stefan Seifert
> Assignee: Stefan Seifert
> Fix For: org.apache.sling.testing.tools 1.0.10
>
>
> for integration tests additional bundles can be installed using the
> WebconsoleClient in sling testing tools project. if bundles already exists
> they are uninstalled before new bundles are installed.
> but in this case it may happen that depending are still wired to the old
> uninstalled bundle. thus always a "refreshPackages" command should be called
> when all bundles are installed/uninstalled.
> see also
> http://felix.apache.org/documentation/tutorials-examples-and-presentations/apache-felix-osgi-faq.html#when-i-update-my-bundle-why-are-my-bundles-old-classes-still-being-used
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)