Package org.rhq.core.pc.inventory

Examples of org.rhq.core.pc.inventory.AvailabilityExecutor.call()


    public void testAvailReport() throws Exception {
        Assert.assertTrue(pluginContainer.isStarted());
        Assert.assertTrue(pluginContainer.isRunning());
        AvailabilityExecutor executor = new ForceAvailabilityExecutor(this.pluginContainer.getInventoryManager());
        dumpContainers("testAvailReport() Start");
        AvailabilityReport report = executor.call();
        dumpContainers("testAvailReport() After First Avail Check");
        Assert.assertNotNull(report);
        Assert.assertEquals(report.isChangesOnlyReport(), false, "First report should have been a full report");
        List<Datum> availData = report.getResourceAvailability();
        for (Datum datum : availData) {
View Full Code Here


        }
        AvailabilityExecutor.Scan scan = executor.getMostRecentScanHistory();
        assertScan(scan, true, true, 29, 29, 29, 28, 0, 0);

        // do a forced avail check again - nothing changed, so we should have an empty report
        report = executor.call();
        dumpContainers("testAvailReport() After Second Avail Check");
        Assert.assertNotNull(report);
        Assert.assertEquals(report.isChangesOnlyReport(), true, "Second report should have been changes-only");
        Assert.assertEquals(report.getResourceAvailability().isEmpty(), true, "Nothing changed, should be empty");
        scan = executor.getMostRecentScanHistory();
View Full Code Here

        // make one of the top parents down and see all other children are down, force a scan of all to make sure we pick
        // up the changed resource.
        AvailResourceComponent downParent = this.parentComponents1.iterator().next();
        downParent.setNextAvailability(AvailabilityType.DOWN);
        report = executor.call();
        dumpContainers("testAvailReport() After Third Avail Check");
        Assert.assertNotNull(report);
        Assert.assertEquals(report.isChangesOnlyReport(), true, "report should have been changes-only");
        availData = report.getResourceAvailability();
        Assert.assertEquals(availData.size(), 7, "Should have 1 parent, its 2 children and 4 grandchildren");
View Full Code Here

    @Test(groups = "pc.itest.avail", priority = 21)
    public void testScheduling() throws Exception {
        Assert.assertTrue(pluginContainer.isStarted());
        Assert.assertTrue(pluginContainer.isRunning());
        AvailabilityExecutor executor = new ForceAvailabilityExecutor(this.pluginContainer.getInventoryManager());
        AvailabilityReport report = executor.call();
        Assert.assertNotNull(report);
        Assert.assertEquals(report.isChangesOnlyReport(), false, "First report should have been a full report");
        List<Datum> availData = report.getResourceAvailability();
        for (Datum datum : availData) {
            assert datum.getResourceId() != 0 : "resource IDs should be != zero since it should be committed";
View Full Code Here

    public void testForceChildrenOfParentUp() throws Exception {
        Assert.assertTrue(pluginContainer.isStarted());
        Assert.assertTrue(pluginContainer.isRunning());
        // don't use a ForceAvailabilityExecutor for this test, we want to manipulate what gets checked
        AvailabilityExecutor executor = new AvailabilityExecutor(this.pluginContainer.getInventoryManager());
        AvailabilityReport report = executor.call();
        Assert.assertNotNull(report);
        Assert.assertEquals(report.isChangesOnlyReport(), false, "First report should have been a full report");
        List<Datum> availData = report.getResourceAvailability();
        int numUp = 0;
        for (Datum datum : availData) {
View Full Code Here

        }

        // a changes-only report, even though only 2 checks are scheduled, we should see checks for half
        // the resources, as the children will be forced. (they should change from null to UP).  The scheduled
        // checks should see their schedules pushed out, but the forced checks should be rescheduled randomly
        report = executor.call();
        Assert.assertNotNull(report);
        Assert.assertEquals(report.isChangesOnlyReport(), true, "Second report should have been changes-only");
        Assert.assertEquals(report.getResourceAvailability().size(), 14, "should report half the resources");
        availData = report.getResourceAvailability();
        for (Datum datum : availData) {
View Full Code Here

    public void testDeferToParentDown() throws Exception {
        Assert.assertTrue(pluginContainer.isStarted());
        Assert.assertTrue(pluginContainer.isRunning());
        // don't use a ForceAvailabilityExecutor for this test, we want to manipulate what gets checked
        AvailabilityExecutor executor = new AvailabilityExecutor(this.pluginContainer.getInventoryManager());
        AvailabilityReport report = executor.call();
        Assert.assertNotNull(report);
        Assert.assertEquals(report.isChangesOnlyReport(), false, "First report should have been a full report");
        List<Datum> availData = report.getResourceAvailability();
        int numUp = 0;
        for (Datum datum : availData) {
View Full Code Here

        // a changes-only report, even though only 2 checks are scheduled, we should see checks for half
        // the resources, as the children should defer to the DOWN parent. (they should change from null to DOWN).
        // The scheduled checks should see their schedules pushed out but the deferred checks should not, their
        // schedules remain unchanged in this scenario.
        report = executor.call();
        Assert.assertNotNull(report);
        Assert.assertEquals(report.isChangesOnlyReport(), true, "Second report should have been changes-only");
        Assert.assertEquals(report.getResourceAvailability().size(), 14, "should report half the resources");
        availData = report.getResourceAvailability();
        for (Datum datum : availData) {
View Full Code Here

    public void testCheckOnlyEligible() throws Exception {
        Assert.assertTrue(pluginContainer.isStarted());
        Assert.assertTrue(pluginContainer.isRunning());
        // Force all the avails to UP to start so we can avoid the scenario in  testForceChildrenOfParentUp()
        AvailabilityExecutor executor = new ForceAvailabilityExecutor(this.pluginContainer.getInventoryManager());
        AvailabilityReport report = executor.call();
        Assert.assertNotNull(report);
        Assert.assertEquals(report.isChangesOnlyReport(), false, "First report should have been a full report");
        List<Datum> availData = report.getResourceAvailability();
        for (Datum datum : availData) {
            assert datum.getResourceId() != 0 : "resource IDs should be != zero since it should be committed";
View Full Code Here

                c.setAvailabilityScheduleTime(later);
            }
        }

        // a changes-only report, check half the resources, no changes - should all be UP already. push out scheds for each
        report = executor.call();
        Assert.assertNotNull(report);
        Assert.assertEquals(report.isChangesOnlyReport(), true, "Second report should have been changes-only");
        Assert.assertEquals(report.getResourceAvailability().size(), 0, "no changes, everything was already up");
        availData = report.getResourceAvailability();
        for (Datum datum : availData) {
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.