Examples of BundleType


Examples of org.rhq.core.domain.bundle.BundleType

    private static String getPath(String path) {
        return ((File.separatorChar == '\\') && path.startsWith("/")) ? ("C:" + path) : path;
    }

    public void testNonPlatformBundleDeploy_FileSystem_RelativePath() throws Exception {
        BundleType bundleType = new BundleType("bundleTypeName", im.bundleHandlerType);
        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_FS, "relative/path"); // RELATIVE PATH
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
View Full Code Here

Examples of org.rhq.core.domain.bundle.BundleType

        assertBundleDeploymentStatus(BundleDeploymentStatus.SUCCESS);

    }

    public void testNonPlatformBundleDeploy_PluginConfig() throws Exception {
        BundleType bundleType = new BundleType("bundleTypeName", im.bundleHandlerType);
        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_PC, "relative/path/pc");
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
View Full Code Here

Examples of org.rhq.core.domain.bundle.BundleType

        assertBundleDeploymentStatus(BundleDeploymentStatus.SUCCESS);

    }

    public void testNonPlatformBundleDeploy_ResourceConfig() throws Exception {
        BundleType bundleType = new BundleType("bundleTypeName", im.bundleHandlerType);
        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_RC, "relative/path/rc");
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
View Full Code Here

Examples of org.rhq.core.domain.bundle.BundleType

        assertBundleDeploymentStatus(BundleDeploymentStatus.SUCCESS);

    }

    public void testNonPlatformBundleDeploy_Trait() throws Exception {
        BundleType bundleType = new BundleType("bundleTypeName", im.bundleHandlerType);
        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_MT, "relative/path/mt");
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
View Full Code Here

Examples of org.rhq.core.domain.bundle.BundleType

        assertBundleDeploymentStatus(BundleDeploymentStatus.SUCCESS);

    }

    public void testNonPlatformBundleDeploy_FileSystem_Failure() throws Exception {
        BundleType bundleType = new BundleType("bundleTypeName", im.bundleHandlerType);
        Bundle bundle = new Bundle("bundleName", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bundleVersionName", "1.0", bundle, "");
        BundleDestination destination = new BundleDestination(bundle, "destName", null,
            MockInventoryManager.BUNDLE_CONFIG_NAME_FS, getPath("/tmp/dest")); // ABSOLUTE PATH
        BundleDeployment bundleDeployment = new BundleDeployment(bundleVersion, destination, "deploymentName");
View Full Code Here

Examples of org.rhq.core.domain.bundle.BundleType

    }

    private void createAntBundleType() throws Exception {
        ResourceType rt = createResourceTypeForBundleType();
        Subject overlord = LookupUtil.getSubjectManager().getOverlord();
        BundleType bt = bundleManager.createBundleType(overlord, ANT_BUNDLE_TYPE_NAME, rt.getId());

        assert bt.getId() > 0;
    }
View Full Code Here

Examples of org.rhq.core.domain.bundle.BundleType

        // need a dummy deployment

        ResourceType resourceType = new ResourceType("name", "plugin", ResourceCategory.PLATFORM, null);
        Resource resource = new Resource("key", "name", resourceType);
        BundleType bundleType = new BundleType("name", resourceType);
        Bundle bundle = new Bundle("name", bundleType, null, null);
        BundleVersion bundleVersion = new BundleVersion("bname", "bversion", bundle, "");
        String name = "name";
        String destBaseDirName = "destBaseDirName";
        String installDir = "installDir";
View Full Code Here

Examples of org.rhq.core.domain.bundle.BundleType

        setAllowEmptyValue(false);
        setMultiple(false);

        addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent event) {
                BundleType bundleType = knownBundleTypes.get(event.getValue());
                setSelected(bundleType);
            }
        });

        BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService();
        bundleServer.getAllBundleTypes(new AsyncCallback<ArrayList<BundleType>>() {
            public void onSuccess(ArrayList<BundleType> result) {
                if (result == null || result.size() == 0) {
                    setSelected(null);
                    CoreGUI.getMessageCenter().notify(
                        new Message(CoreGUI.getMessages().view_bundle_createWizard_noBundleTypesSupported(),
                            Severity.Error));
                    return;
                }

                for (BundleType bundleType : result) {
                    knownBundleTypes.put(bundleType.getName(), bundleType);
                    if (getSelected() == null) {
                        setSelected(bundleType);
                        setDefaultValue(bundleType.getName());
                        setValue(bundleType.getName());
                    }
                }
                setValueMap(knownBundleTypes.keySet().toArray(new String[0]));
                setDisabled(false);
                // don't bother showing the menu if there is only one item
View Full Code Here

Examples of org.rhq.core.domain.bundle.BundleType

            q.setParameter("id", repo1.getId());
            assert q.getResultList().size() == 0 : "should not have repo1 mapping in the db yet";
            q.setParameter("id", repo2.getId());
            assert q.getResultList().size() == 0 : "should not have repo2 mapping in the db yet";

            BundleType bundleType = createBundleType(em, name + "-Type", createResourceType(em));
            Bundle bundle = createBundle(em, name + "-Bundle", bundleType);

            BundleVersion bundleVersion = new BundleVersion(name, "1.0.0.BETA", bundle, recipe);
            bundleVersion.setVersionOrder(0);
            em.persist(bundleVersion);
View Full Code Here

Examples of org.rhq.core.domain.bundle.BundleType

            int id;

            String name = "BundleTest-testBundleVersion";
            String recipe = "action/script/recipe is here";

            BundleType bundleType = createBundleType(em, name + "-Type", createResourceType(em));
            Bundle bundle = createBundle(em, name + "-Bundle", bundleType);
            id = bundle.getId();
            assert id > 0;
            assert bundle.getBundleType().getId() != 0 : "bundleType should have been cascade persisted too";

            BundleVersion bv = new BundleVersion(name, "1.0.0.BETA", bundle, recipe);
            bv.setVersionOrder(777);
            Query q = em.createNamedQuery(BundleVersion.QUERY_FIND_BY_NAME);
            q.setParameter("name", bv.getName());
            assert q.getResultList().size() == 0; // not in the db yet

            em.persist(bv);
            id = bv.getId();
            assert id > 0;

            q = em.createNamedQuery(BundleVersion.QUERY_FIND_BY_NAME);
            q.setParameter("name", bv.getName());
            assert q.getResultList().size() == 1;
            assert ((BundleVersion) q.getSingleResult()).getName().equals(bv.getName());

            BundleVersion bvFind = em.find(BundleVersion.class, id);
            assert bvFind != null;
            assert bvFind.getId() == bv.getId();
            assert bvFind.getName().equals(bv.getName());
            assert bvFind.getVersion().equals(bv.getVersion());
            assert bvFind.getVersionOrder() == bv.getVersionOrder();
            assert bvFind.getRecipe().equals(bv.getRecipe());
            assert bvFind.getBundle().equals(bv.getBundle());
            assert bvFind.equals(bv);
            assert bvFind.hashCode() == bv.hashCode();

            // clean up - delete our test entity
            em.clear();

            q = em.createNamedQuery(BundleVersion.QUERY_FIND_BY_NAME);
            q.setParameter("name", bv.getName());
            BundleVersion doomed = (BundleVersion) q.getSingleResult();
            doomed = em.getReference(BundleVersion.class, doomed.getId());
            em.remove(doomed);
            assert q.getResultList().size() == 0 : "didn't remove the entity";
            em.clear();

            // make sure we didn't delete the bundle - it should not be cascade deleted
            q = em.createNamedQuery(Bundle.QUERY_FIND_BY_NAME);
            q.setParameter("name", bundle.getName());
            assert q.getResultList().size() == 1;
            bundle = (Bundle) q.getSingleResult();
            bundleType = bundle.getBundleType();
            Repo repo = bundle.getRepo();
            em.remove(bundle);
            em.remove(repo);

            deleteResourceType(em, bundleType.getResourceType());

            assert q.getResultList().size() == 0 : "didn't clean up test bundle";
            assert em.find(BundleType.class, bundleType.getId()) == null : "didn't clean up bundle type";

            em.clear();

        } catch (Throwable t) {
            t.printStackTrace();
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.