Package org.apache.sling.installer.core.impl

Examples of org.apache.sling.installer.core.impl.MockBundleResource


  }

  @Test
  public void testSingleBundleNew() throws IOException {
    final TaskResource [] r = {
            new MockBundleResource(SN, "1.0")
    };
        final MockBundleTaskCreator c = new MockBundleTaskCreator();
    final SortedSet<InstallTask> s = getTasks(r, c);
    assertEquals("Expected one task", 1, s.size());
    assertTrue("Expected a BundleInstallTask", s.first() instanceof BundleInstallTask);
View Full Code Here


  }

  @Test
    public void testSingleBundleAlreadyInstalled() throws IOException {
        final TaskResource [] r = {
                new MockBundleResource(SN, "1.0")
        };

        {
            final MockBundleTaskCreator c = new MockBundleTaskCreator();
            c.addBundleInfo(SN, "1.0", Bundle.ACTIVE);
View Full Code Here

    }

    @Test
    public void testBundleUpgrade() throws IOException {
        final TaskResource [] r = {
                new MockBundleResource(SN, "1.1")
        };

        {
            final MockBundleTaskCreator c = new MockBundleTaskCreator();
            c.addBundleInfo(SN, "1.0", Bundle.ACTIVE);
View Full Code Here

    }

    @Test
    public void testBundleUpgradeBothRegistered() throws IOException {
        final TaskResource [] r = {
                new MockBundleResource(SN, "1.1"),
                new MockBundleResource(SN, "1.0")
        };

        {
            final MockBundleTaskCreator c = new MockBundleTaskCreator();
            c.addBundleInfo(SN, "1.0", Bundle.ACTIVE);
View Full Code Here

    }

    @Test
    public void testBundleUpgradeBothRegisteredReversed() throws IOException {
        final TaskResource [] r = {
                new MockBundleResource(SN, "1.0"),
                new MockBundleResource(SN, "1.1")
        };

        {
            final MockBundleTaskCreator c = new MockBundleTaskCreator();
            c.addBundleInfo(SN, "1.0", Bundle.ACTIVE);
View Full Code Here

    public void testBundleUpgradeSnapshot() throws IOException {
        // Need to use OSGi-compliant version number, in bundles
        // bnd and other tools generate correct numbers.
        final String v = "2.0.7.SNAPSHOT";
        final TaskResource [] r = {
                new MockBundleResource(SN, v)
        };

        {
            final MockBundleTaskCreator c = new MockBundleTaskCreator();
            c.addBundleInfo(SN, v, Bundle.ACTIVE);
View Full Code Here

    @Test
    public void testBundleRemoveSingle() throws IOException {
        final String version = "1.0";
        final MockBundleResource [] r = {
                new MockBundleResource(SN, version)
        };
        r[0].setState(ResourceState.UNINSTALL);

        {
            final MockBundleTaskCreator c = new MockBundleTaskCreator();
View Full Code Here

    }

    @Test
    public void testBundleRemoveMultiple() throws IOException {
        final MockBundleResource [] r = {
                new MockBundleResource(SN, "1.0"),
                new MockBundleResource(SN, "1.1"),
                new MockBundleResource(SN, "2.0")
        };
        for(MockBundleResource x : r) {
            x.setState(ResourceState.UNINSTALL);
        }
View Full Code Here

    }

    @Test
    public void testDowngradeOfRemovedResource() throws IOException {
        final MockBundleResource [] r = {
                new MockBundleResource(SN, "1.0.0"),
                new MockBundleResource(SN, "1.1.0"),
        };

        // Simulate V1.1 installed but resource is gone -> downgrade to 1.0
        r[1].setState(ResourceState.UNINSTALL);
View Full Code Here

TOP

Related Classes of org.apache.sling.installer.core.impl.MockBundleResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.