Examples of addExplicitResource()


Examples of org.rhq.core.domain.resource.group.ResourceGroup.addExplicitResource()

            resource.setAgent(agent);
            resource.setResourceConfiguration(rc);
            em.persist(resource);

            resourceGroup = new ResourceGroup(TEST_PREFIX + "-group-" + System.currentTimeMillis());
            resourceGroup.addExplicitResource(resource);
            resourceGroup.addImplicitResource(resource);
            resourceGroup.setResourceType(resourceType); // need to tell the group the type it is
            em.persist(resourceGroup);

            getTransactionManager().commit();
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ResourceGroup.addExplicitResource()

        resourceType.setResourceTypeBundleConfiguration(resourceTypeBundleConfiguration);

        Resource resource = SessionTestHelper.createNewResource(em, getRandomString(), resourceType);

        ResourceGroup resourceGroup = createResourceGroup();
        resourceGroup.addExplicitResource(resource);
        resourceGroup.setResourceType(resourceType);

        return resourceGroup;
    }
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ResourceGroup.addExplicitResource()

                    .getGroupAvailabilityType());
                assertEquals("Should cover whole range", 0L, avails.get(0).getStartTime().longValue());
                assertEquals("Should cover whole range", 20000L, avails.get(0).getEndTime().longValue());

                // add the resources to the group
                group.addExplicitResource(r1);
                group.addExplicitResource(r2);
                group.addExplicitResource(r3);
                em.merge(group);
                em.flush();
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ResourceGroup.addExplicitResource()

                assertEquals("Should cover whole range", 0L, avails.get(0).getStartTime().longValue());
                assertEquals("Should cover whole range", 20000L, avails.get(0).getEndTime().longValue());

                // add the resources to the group
                group.addExplicitResource(r1);
                group.addExplicitResource(r2);
                group.addExplicitResource(r3);
                em.merge(group);
                em.flush();

                avails = availabilityManager.getAvailabilitiesForResourceGroup(overlord, groupId, 5000L, 50000);
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ResourceGroup.addExplicitResource()

                assertEquals("Should cover whole range", 20000L, avails.get(0).getEndTime().longValue());

                // add the resources to the group
                group.addExplicitResource(r1);
                group.addExplicitResource(r2);
                group.addExplicitResource(r3);
                em.merge(group);
                em.flush();

                avails = availabilityManager.getAvailabilitiesForResourceGroup(overlord, groupId, 5000L, 50000);
                assertEquals("Should have initial avail + 4 changes", 5, avails.size());
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ResourceGroup.addExplicitResource()

            resource.setInventoryStatus(InventoryStatus.COMMITTED);
            em.persist(resource);

            ResourceGroup group = new ResourceGroup(PREFIX + "groupOMB" + System.currentTimeMillis(), resourceType);
            em.persist(group);
            group.addExplicitResource(resource);
            em.flush();

        } catch (Exception e) {
            System.out.println("CANNOT PREPARE TEST: " + e);
            getTransactionManager().rollback();
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ResourceGroup.addExplicitResource()

            resource.setUuid("" + new Random().nextInt());
            em.persist(resource);

            ResourceGroup group = new ResourceGroup("testgroupOH" + System.currentTimeMillis(), resourceType);
            em.persist(group);
            group.addExplicitResource(resource);

            getTransactionManager().commit();

        } catch (Exception e) {
            System.out.println(e);
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ResourceGroup.addExplicitResource()

                resource.setUuid("" + new Random().nextInt());
                em.persist(resource);

                ResourceGroup group = new ResourceGroup("testgroupRG" + System.currentTimeMillis(), resourceType);
                em.persist(group);
                group.addExplicitResource(resource);

            getTransactionManager().commit();

            } catch (Exception e) {
                System.out.println(e);
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ResourceGroup.addExplicitResource()

            Resource resource3 = SessionTestHelper.createNewResourceForGroup(em, testGroup1, "testResource3");

            Role testRole2 = SessionTestHelper.createNewRoleForSubject(em, testSubject, "testRole2");
            ResourceGroup testGroup2 = SessionTestHelper.createNewMixedGroupForRole(em, testRole2, "testGroup2", false);

            testGroup2.addExplicitResource(resource1);
            resource1.getExplicitGroups().add(testGroup2);

            /*
             * Single resource implies the implicit resource list should mirror the explicit one
             */
 
View Full Code Here

Examples of org.rhq.core.domain.resource.group.ResourceGroup.addExplicitResource()

            Resource resource2 = SessionTestHelper.createNewResourceForGroup(em, testGroup1, "testResource2");
            Resource resource3 = SessionTestHelper.createNewResourceForGroup(em, testGroup1, "testResource3");

            ResourceGroup testGroup2 = SessionTestHelper.createNewMixedGroupForRole(em, testRole1, "testGroup2", false);

            testGroup2.addExplicitResource(resource1);
            resource1.getExplicitGroups().add(testGroup2);

            /*
             * Single resource implies the implicit resource list should mirror the explicit one
             */
 
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.