Examples of DeploymentPackageBuilder


Examples of org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder

     * FELIX-4409/4410/4463 - test the installation of an invalid deployment package.
     */
    @Test
    public void testInstallInvalidDeploymentPackageFail() throws Exception
    {
        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        // incluse two different versions of the same bundle (with the same BSN), this is *not* allowed per the DA spec...
        dpBuilder
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundleapi1", "bundleapi1", "1.0.0")))
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundleapi2", "bundleapi2", "2.0.0")));

        try
        {
            installDeploymentPackage(dpBuilder);
            fail("DeploymentException expected!");
View Full Code Here

Examples of org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder

     * FELIX-1835 - test whether we can install bundles with a non-root path inside the DP.
     */
    @Test
    public void testInstallBundlesWithPathsOk() throws Exception
    {
        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        // incluse two different versions of the same bundle (with the same BSN), this is *not* allowed per the DA spec...
        dpBuilder
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundleapi1", "bundleapi1", "1.0.0")).setFilename("bundles/bundleapi1.jar"))
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundleimpl1", "bundleimpl1", "1.0.0")).setFilename("bundles/bundleimpl1.jar"));

        DeploymentPackage dp = installDeploymentPackage(dpBuilder);
        assertNotNull(dp);

        BundleInfo[] bundleInfos = dp.getBundleInfos();
View Full Code Here

Examples of org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder

     * Tests that adding the dependency for a bundle in an update package causes the depending bundle to be resolved and started.
     */
    @Test
    public void testInstallBundleWithDependencyInPackageUpdateOk() throws Exception
    {
        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        // missing bundle1 as dependency...
        dpBuilder.add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle2")));

        DeploymentPackage dp1 = installDeploymentPackage(dpBuilder);
        assertNotNull("No deployment package returned?!", dp1);

        awaitRefreshPackagesEvent();

        Bundle bundle = dp1.getBundle(getSymbolicName("bundle2"));
        assertNotNull("Failed to obtain bundle from deployment package?!", bundle);

        assertTrue(isBundleInstalled(dp1.getBundle(getSymbolicName("bundle2"))));

        dpBuilder = createDeploymentPackageBuilder(dpBuilder.getSymbolicName(), "1.0.1");
        dpBuilder
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle2")))
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle1")));

        DeploymentPackage dp2 = installDeploymentPackage(dpBuilder);
        assertNotNull("No deployment package returned?!", dp2);

        awaitRefreshPackagesEvent();
View Full Code Here

Examples of org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder

     * Tests that installing a bundle with a dependency installed by another deployment package is not started, but is resolved.
     */
    @Test
    public void testInstallBundleWithDependencyInSeparatePackageOk() throws Exception
    {
        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        dpBuilder.add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle2")));

        DeploymentPackage dp1 = installDeploymentPackage(dpBuilder);
        assertNotNull("No deployment package returned?!", dp1);

        awaitRefreshPackagesEvent();

        assertBundleExists(getSymbolicName("bundle2"), "1.0.0");

        // We shouldn't be able to resolve the deps for bundle2...
        assertFalse(resolveBundles(dp1.getBundle(getSymbolicName("bundle2"))));

        assertTrue(isBundleInstalled(dp1.getBundle(getSymbolicName("bundle2"))));

        dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        // as missing bundle1...
        dpBuilder.add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle1")));

        DeploymentPackage dp2 = installDeploymentPackage(dpBuilder);
        assertNotNull("No deployment package returned?!", dp2);

        awaitRefreshPackagesEvent();
View Full Code Here

Examples of org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder

    @Test
    public void testInstallBundleWithExceptionThrownInStartCausesNoRollbackOk() throws Exception
    {
        System.setProperty("bundle3", "start");

        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        dpBuilder
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle1")))
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle3")));

        DeploymentPackage dp = installDeploymentPackage(dpBuilder);
        assertNotNull("No deployment package returned?!", dp);

        awaitRefreshPackagesEvent();
View Full Code Here

Examples of org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder

     * Tests that installing a bundle along with a fragment bundle succeeds (DA should not try to start the fragment, see FELIX-4167).
     */
    @Test
    public void testInstallBundleWithFragmentOk() throws Exception
    {
        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        dpBuilder
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle1")))
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("fragment1")));

        DeploymentPackage dp = installDeploymentPackage(dpBuilder);
        assertNotNull("No deployment package returned?!", dp);

        awaitRefreshPackagesEvent();
View Full Code Here

Examples of org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder

     * Tests that installing a bundle whose dependencies cannot be met, is installed, but not started.
     */
    @Test
    public void testInstallBundleWithMissingDependencyOk() throws Exception
    {
        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        dpBuilder.add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle2")));

        DeploymentPackage dp = installDeploymentPackage(dpBuilder);
        assertNotNull("No deployment package returned?!", dp);

        awaitRefreshPackagesEvent();
View Full Code Here

Examples of org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder

     * Tests that installing a bundle along with other (non-bundle) artifacts succeeds.
     */
    @Test
    public void testInstallBundleWithOtherArtifactsOk() throws Exception
    {
        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        dpBuilder
            .add(dpBuilder.createResourceProcessorResource().setUrl(getTestBundle("rp1")))
            .add(dpBuilder.createResource().setResourceProcessorPID(TEST_FAILING_BUNDLE_RP1).setUrl(getTestResource("test-config1.xml")))
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle3")));

        DeploymentPackage dp = installDeploymentPackage(dpBuilder);
        assertNotNull("No deployment package returned?!", dp);

        awaitRefreshPackagesEvent();
View Full Code Here

Examples of org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder

     * Tests that installing a new bundle works as expected.
     */
    @Test
    public void testInstallSingleValidBundleOk() throws Exception
    {
        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        dpBuilder.add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle1")));

        DeploymentPackage dp = installDeploymentPackage(dpBuilder);
        assertNotNull("No deployment package returned?!", dp);

        awaitRefreshPackagesEvent();
View Full Code Here

Examples of org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder

     * Tests that installing two bundles works as expected.
     */
    @Test
    public void testInstallTwoValidBundlesOk() throws Exception
    {
        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
        dpBuilder
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle1")))
            .add(dpBuilder.createBundleResource().setUrl(getTestBundle("bundle2")));

        DeploymentPackage dp = installDeploymentPackage(dpBuilder);
        assertNotNull("No deployment package returned?!", dp);

        awaitRefreshPackagesEvent();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.