Search in sources :

Example 1 with BundleStartTask

use of org.apache.sling.installer.core.impl.tasks.BundleStartTask in project sling by apache.

the class TaskOrderingTest method testMultipleConfigAndBundles.

@org.junit.Test
public void testMultipleConfigAndBundles() throws Exception {
    int testIndex = 1;
    final InstallTask[] tasksInOrder = { new BundleInstallTask(getRegisteredResource("test:someURIa.nothing"), null), new BundleInstallTask(getRegisteredResource("test:someURIb.nothing"), null), new RefreshBundlesTask(null), new BundleStartTask(null, 0, null) };
    taskSet.clear();
    for (int i = tasksInOrder.length - 1; i >= 0; i--) {
        taskSet.add(tasksInOrder[i]);
    }
    assertOrder(testIndex++, taskSet, tasksInOrder);
    taskSet.clear();
    for (int i = 0; i < tasksInOrder.length; i++) {
        taskSet.add(tasksInOrder[i]);
    }
    assertOrder(testIndex++, taskSet, tasksInOrder);
}
Also used : BundleInstallTask(org.apache.sling.installer.core.impl.tasks.BundleInstallTask) BundleStartTask(org.apache.sling.installer.core.impl.tasks.BundleStartTask) InstallTask(org.apache.sling.installer.api.tasks.InstallTask) BundleInstallTask(org.apache.sling.installer.core.impl.tasks.BundleInstallTask) RefreshBundlesTask(org.apache.sling.installer.core.impl.tasks.RefreshBundlesTask)

Example 2 with BundleStartTask

use of org.apache.sling.installer.core.impl.tasks.BundleStartTask in project sling by apache.

the class TaskOrderingTest method testBasicOrdering.

@org.junit.Test
public void testBasicOrdering() throws Exception {
    int testIndex = 1;
    final InstallTask[] tasksInOrder = { new BundleRemoveTask(getRegisteredResource("test:url"), null), new BundleInstallTask(getRegisteredResource("test:url"), null), new BundleUpdateTask(getRegisteredResource("test:url"), null), new RefreshBundlesTask(null), new BundleStartTask(null, 0, null) };
    taskSet.clear();
    taskSet.add(tasksInOrder[4]);
    taskSet.add(tasksInOrder[3]);
    taskSet.add(tasksInOrder[2]);
    taskSet.add(tasksInOrder[1]);
    taskSet.add(tasksInOrder[0]);
    assertOrder(testIndex++, taskSet, tasksInOrder);
    taskSet.clear();
    taskSet.add(tasksInOrder[0]);
    taskSet.add(tasksInOrder[1]);
    taskSet.add(tasksInOrder[2]);
    taskSet.add(tasksInOrder[3]);
    taskSet.add(tasksInOrder[4]);
    assertOrder(testIndex++, taskSet, tasksInOrder);
    taskSet.clear();
    taskSet.add(tasksInOrder[3]);
    taskSet.add(tasksInOrder[2]);
    taskSet.add(tasksInOrder[0]);
    taskSet.add(tasksInOrder[4]);
    taskSet.add(tasksInOrder[1]);
    assertOrder(testIndex++, taskSet, tasksInOrder);
    taskSet.clear();
    taskSet.add(tasksInOrder[4]);
    taskSet.add(tasksInOrder[0]);
    taskSet.add(tasksInOrder[2]);
    taskSet.add(tasksInOrder[3]);
    taskSet.add(tasksInOrder[1]);
    assertOrder(testIndex++, taskSet, tasksInOrder);
}
Also used : BundleInstallTask(org.apache.sling.installer.core.impl.tasks.BundleInstallTask) BundleUpdateTask(org.apache.sling.installer.core.impl.tasks.BundleUpdateTask) BundleStartTask(org.apache.sling.installer.core.impl.tasks.BundleStartTask) BundleRemoveTask(org.apache.sling.installer.core.impl.tasks.BundleRemoveTask) InstallTask(org.apache.sling.installer.api.tasks.InstallTask) BundleInstallTask(org.apache.sling.installer.core.impl.tasks.BundleInstallTask) RefreshBundlesTask(org.apache.sling.installer.core.impl.tasks.RefreshBundlesTask)

Example 3 with BundleStartTask

use of org.apache.sling.installer.core.impl.tasks.BundleStartTask in project sling by apache.

the class TaskOrderingTest method testMultipleRefreshAndStart.

@org.junit.Test
public void testMultipleRefreshAndStart() throws Exception {
    int testIndex = 1;
    final InstallTask[] tasksInOrder = { new BundleRemoveTask(getRegisteredResource("test:url"), null), new RefreshBundlesTask(null), new BundleStartTask(null, 0, null), new BundleStartTask(null, 1, null) };
    taskSet.clear();
    taskSet.add(tasksInOrder[3]);
    taskSet.add(tasksInOrder[3]);
    taskSet.add(new RefreshBundlesTask(null));
    taskSet.add(tasksInOrder[2]);
    taskSet.add(tasksInOrder[2]);
    taskSet.add(tasksInOrder[1]);
    taskSet.add(new RefreshBundlesTask(null));
    taskSet.add(new RefreshBundlesTask(null));
    taskSet.add(tasksInOrder[0]);
    taskSet.add(tasksInOrder[3]);
    taskSet.add(new RefreshBundlesTask(null));
    taskSet.add(tasksInOrder[3]);
    taskSet.add(tasksInOrder[2]);
    taskSet.add(new RefreshBundlesTask(null));
    taskSet.add(tasksInOrder[2]);
    taskSet.add(tasksInOrder[1]);
    taskSet.add(new RefreshBundlesTask(null));
    taskSet.add(tasksInOrder[1]);
    taskSet.add(new RefreshBundlesTask(null));
    assertOrder(testIndex++, taskSet, tasksInOrder);
}
Also used : BundleStartTask(org.apache.sling.installer.core.impl.tasks.BundleStartTask) BundleRemoveTask(org.apache.sling.installer.core.impl.tasks.BundleRemoveTask) InstallTask(org.apache.sling.installer.api.tasks.InstallTask) BundleInstallTask(org.apache.sling.installer.core.impl.tasks.BundleInstallTask) RefreshBundlesTask(org.apache.sling.installer.core.impl.tasks.RefreshBundlesTask)

Example 4 with BundleStartTask

use of org.apache.sling.installer.core.impl.tasks.BundleStartTask in project sling by apache.

the class TaskOrderingTest method testBundleStartOrder.

@org.junit.Test
public void testBundleStartOrder() {
    int testIndex = 1;
    final InstallTask[] tasksInOrder = { new BundleStartTask(null, 0, null), new BundleStartTask(null, 1, null), new BundleStartTask(null, 5, null), new BundleStartTask(null, 11, null), new BundleStartTask(null, 51, null) };
    taskSet.clear();
    for (int i = tasksInOrder.length - 1; i >= 0; i--) {
        taskSet.add(tasksInOrder[i]);
    }
    assertOrder(testIndex++, taskSet, tasksInOrder);
    taskSet.clear();
    for (int i = 0; i < tasksInOrder.length; i++) {
        taskSet.add(tasksInOrder[i]);
    }
    assertOrder(testIndex++, taskSet, tasksInOrder);
}
Also used : BundleStartTask(org.apache.sling.installer.core.impl.tasks.BundleStartTask) InstallTask(org.apache.sling.installer.api.tasks.InstallTask) BundleInstallTask(org.apache.sling.installer.core.impl.tasks.BundleInstallTask)

Aggregations

InstallTask (org.apache.sling.installer.api.tasks.InstallTask)4 BundleInstallTask (org.apache.sling.installer.core.impl.tasks.BundleInstallTask)4 BundleStartTask (org.apache.sling.installer.core.impl.tasks.BundleStartTask)4 RefreshBundlesTask (org.apache.sling.installer.core.impl.tasks.RefreshBundlesTask)3 BundleRemoveTask (org.apache.sling.installer.core.impl.tasks.BundleRemoveTask)2 BundleUpdateTask (org.apache.sling.installer.core.impl.tasks.BundleUpdateTask)1