Package org.rhq.core.domain.shared

Examples of org.rhq.core.domain.shared.ResourceBuilder$ChildrenResourceBuilder


        assertNotNull("Cannot create resources. Unable to find resource type for [name: " + resourceTypeName
            + ", plugin: " + pluginName + "]", resourceType);

        List<Resource> resources = new ArrayList<Resource>();
        for (int i = 0; i < count; ++i) {
            resources.add(new ResourceBuilder().createServer().withResourceType(resourceType)
                .withName(resourceType.getName() + "--" + i).withUuid(resourceType.getName())
                .withRandomResourceKey(resourceType.getName() + "--" + i).build());
        }

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


        assertLineEquals(5, "\t" + padResourceField("resourceType") + ": " + resource.getResourceType().getName(),
            "Expected short version of Resource.resourceType to be the fifth property printed");
    }

    private Resource createResource() {
        return new ResourceBuilder().createServer().usingDefaultResourceType().withId(111).withName("test-server")
            .withUuid("12345").withVersion("1.0").inInventory().withCurrentAvailability(AvailabilityType.UP).build();
    }
View Full Code Here

        return new ResourceBuilder().createServer().usingDefaultResourceType().withId(111).withName("test-server")
            .withUuid("12345").withVersion("1.0").inInventory().withCurrentAvailability(AvailabilityType.UP).build();
    }

    private Resource createUncommittedResource() {
        return new ResourceBuilder().createServer().usingDefaultResourceType().withId(111).withName("test-server")
            .withUuid("12345").withVersion("1.0").notInInventory().build();
    }
View Full Code Here

            .withUuid("12345").withVersion("1.0").notInInventory().build();
    }

    @Test
    public void printCollectionOfUncommittedResource() {
        Resource parent = new ResourceBuilder().createServer().usingDefaultResourceType().withName("test-server")
            .withUuid("12345").withVersion("1.0").inInventory().with(2).randomChildServices()
            //                .notInInventory()
            //                .included()
            .build();
View Full Code Here

    protected void initAgent() {
        agent = new Agent(AGENT_NAME, AGENT_NAME, 17080, "", AGENT_NAME + "_TOKEN");
    }

    protected void initResource() {
        resource = new ResourceBuilder().createResource().withId(0).withName(RESOURCE_NAME)
            .withResourceKey(RESOURCE_NAME).withRandomUuid().withResourceType(resourceType).build();
    }
View Full Code Here

    }

    @Test
    public void acceptReportWithNoDeletedTypes() {
        InventoryReport report = createReport();
        report.addAddedRoot(new ResourceBuilder()
            .createRandomServer()
            .with(2).randomChildServices()
            .build());
        report.addAddedRoot(new ResourceBuilder()
            .createRandomService()
            .with(2).randomChildServices()
            .build());

        final List<Plugin> plugins = new ArrayList<Plugin>(getPluginsInReport(report.getAddedRoots()));
View Full Code Here

        final PageList<ResourceType> deletedTypes = new PageList<ResourceType>();
        deletedTypes.add(deletedServiceType);

        InventoryReport report = createReport();
        report.addAddedRoot(new ResourceBuilder()
            .createRandomServer()
            .withChildService()
                .withName("ChildService")
                .withUuid("c1")
                .withResourceType(new ResourceTypeBuilder()
View Full Code Here

    }

    @Test
    public void rejectReportWithPluginThatIsNotInstalled() {
        InventoryReport report = createReport();
        report.addAddedRoot(new ResourceBuilder()
            .createRandomServer()
            .with(2).randomChildServices()
            .build());
        report.addAddedRoot(new ResourceBuilder()
            .createRandomService()
            .withResourceType(new ResourceTypeBuilder()
                .createServerResourceType()
                .withName("StaleServer")
                .withPlugin("DeletedPlugin")
View Full Code Here

                alertDef.getParentId());
        }
    }

    private Resource createResourceForTest(String resourceKey) {
        Resource res = new ResourceBuilder().createPlatform().withRandomUuid().withResourceKey(resourceKey)
            .withResourceType(resourceType).withName(resourceKey).withInventoryStatus(InventoryStatus.COMMITTED)
            .build();
        res.setAgent(agent);

        return res;
View Full Code Here

        return new ResourceTypeBuilder().createResourceType().withId(0).withName(JPADriftChangeSetTest.class.getName())
            .withCategory(SERVER).withPlugin(JPADriftChangeSetTest.class.getName().toLowerCase()).build();
    }

    private Resource createResource(ResourceType type) {
        return new ResourceBuilder().createResource().withId(0)
            .withName(JPADriftChangeSetTest.class.getSimpleName() + "_" + resourceCount++)
            .withResourceKey(JPADriftChangeSetTest.class.getSimpleName() + "_" + resourceCount)
            .withUuid(JPADriftChangeSetTest.class.getSimpleName() + "_" + resourceCount).withResourceType(type).build();
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.shared.ResourceBuilder$ChildrenResourceBuilder

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.