Search in sources :

Example 1 with InstallationListener

use of org.apache.sling.installer.api.event.InstallationListener in project sling by apache.

the class UpdateHandlerTest method getInstallerListenerBarrier.

private Barrier getInstallerListenerBarrier() {
    final Barrier b = new Barrier(2);
    final InstallationListener il = new InstallationListener() {

        public void onEvent(final InstallationEvent event) {
            if (event.getType() == InstallationEvent.TYPE.PROCESSED) {
                b.block();
            }
        }
    };
    b.reg = bundleContext.registerService(InstallationListener.class.getName(), il, null);
    return b;
}
Also used : InstallationListener(org.apache.sling.installer.api.event.InstallationListener) CyclicBarrier(java.util.concurrent.CyclicBarrier) InstallationEvent(org.apache.sling.installer.api.event.InstallationEvent)

Example 2 with InstallationListener

use of org.apache.sling.installer.api.event.InstallationListener in project sling by apache.

the class ConfigInstallTest method setUp.

@Before
public void setUp() {
    installationEvents = 0;
    setupInstaller();
    events.clear();
    serviceRegistrations.clear();
    serviceRegistrations.add(bundleContext.registerService(ConfigurationListener.class.getName(), this, null));
    final InstallationListener il = new InstallationListener() {

        @Override
        public void onEvent(InstallationEvent event) {
            installationEvents++;
        }
    };
    serviceRegistrations.add(bundleContext.registerService(InstallationListener.class.getName(), il, null));
}
Also used : InstallationListener(org.apache.sling.installer.api.event.InstallationListener) InstallationEvent(org.apache.sling.installer.api.event.InstallationEvent) Before(org.junit.Before)

Aggregations

InstallationEvent (org.apache.sling.installer.api.event.InstallationEvent)2 InstallationListener (org.apache.sling.installer.api.event.InstallationListener)2 CyclicBarrier (java.util.concurrent.CyclicBarrier)1 Before (org.junit.Before)1