Examples of addLimitWarningEvents()


Examples of org.rhq.core.domain.event.transfer.EventReport.addLimitWarningEvents()

        Resource resource = new Resource(1);
        EventDefinition eventDefinition = new EventDefinition(resourceType, "foo");
        EventSource eventSource = new EventSource("foo", eventDefinition, resource);
        EventReport report = new EventReport(10, 10);
        report.addEvent(new Event("foo", "foo", 0, EventSeverity.DEBUG, "foo-first", eventSource), eventSource);
        report.addLimitWarningEvents(); // should do nothing
        Map<EventSource, Set<Event>> allEvents = report.getEvents();
        assert allEvents.size() == 1;
        assert allEvents.get(eventSource).size() == 1;

        report.addEvent(new Event("foo", "foo", 1, EventSeverity.DEBUG, "foo-second", eventSource), eventSource);
View Full Code Here

Examples of org.rhq.core.domain.event.transfer.EventReport.addLimitWarningEvents()

        Map<EventSource, Set<Event>> allEvents = report.getEvents();
        assert allEvents.size() == 1;
        assert allEvents.get(eventSource).size() == 1;

        report.addEvent(new Event("foo", "foo", 1, EventSeverity.DEBUG, "foo-second", eventSource), eventSource);
        report.addLimitWarningEvents(); // should do nothing
        allEvents = report.getEvents();
        assert allEvents.size() == 1; // only one event source still!
        assert allEvents.get(eventSource).size() == 2;

        // make sure they are the ones we expect
View Full Code Here

Examples of org.rhq.core.domain.event.transfer.EventReport.addLimitWarningEvents()

        }

        // use a second event source
        EventSource eventSource2 = new EventSource("bar", eventDefinition, resource);
        report.addEvent(new Event("bar", "bar", 2, EventSeverity.DEBUG, "bar-first", eventSource2), eventSource2);
        report.addLimitWarningEvents(); // should do nothing
        allEvents = report.getEvents();
        assert allEvents.size() == 2;
        assert allEvents.get(eventSource).size() == 2;
        assert allEvents.get(eventSource2).size() == 1;
View Full Code Here

Examples of org.rhq.core.domain.event.transfer.EventReport.addLimitWarningEvents()

        EventSource eventSource = new EventSource("foo", eventDefinition, resource);
        EventReport report = new EventReport(1, 10);

        // add the first
        addEvent(report, "foo", "first", eventSource);
        report.addLimitWarningEvents(); // should do nothing
        Map<EventSource, Set<Event>> allEvents = report.getEvents();
        assert allEvents.size() == 1; // only one event source still!
        assert allEvents.get(eventSource).size() == 1;

        // add the second (this is over the max)
View Full Code Here

Examples of org.rhq.core.domain.event.transfer.EventReport.addLimitWarningEvents()

        assert allEvents.size() == 1; // only one event source still!
        assert allEvents.get(eventSource).size() == 1;

        // add the second (this is over the max)
        addEvent(report, "foo", "second", eventSource); // OVER MAX SO THIS NEVER MAKES IT!
        report.addLimitWarningEvents();
        allEvents = report.getEvents();
        assert allEvents.size() == 1; // only one event source still!
        assert allEvents.get(eventSource).size() == 2; // the second one is our "over the max" message
        int foo_count = 0;
        int limit_count = 0;
View Full Code Here

Examples of org.rhq.core.domain.event.transfer.EventReport.addLimitWarningEvents()

        // add the third (this is over the max)
        report = stripLimitWarningEvents(report);
        addEvent(report, "foo", "second", eventSource); // OVER MAX SO THIS NEVER MAKES IT!
        addEvent(report, "foo", "third", eventSource); // STILL OVER MAX SO THIS NEVER MAKES IT EITHER!
        report.addLimitWarningEvents();
        allEvents = report.getEvents();
        assert allEvents.size() == 1; // only one event source still!
        assert allEvents.get(eventSource).size() == 2; // no others have been added, this includes our "over the max" event
        foo_count = 0;
        limit_count = 0;
View Full Code Here

Examples of org.rhq.core.domain.event.transfer.EventReport.addLimitWarningEvents()

        EventSource eventSource2 = new EventSource("bar", eventDefinition, resource);
        report = stripLimitWarningEvents(report);
        addEvent(report, "foo", "second", eventSource); // OVER MAX SO THIS NEVER MAKES IT!
        addEvent(report, "foo", "third", eventSource); // STILL OVER MAX SO THIS NEVER MAKES IT EITHER!
        addEvent(report, "bar", "first", eventSource2);
        report.addLimitWarningEvents();
        allEvents = report.getEvents();
        assert allEvents.size() == 2;
        assert allEvents.get(eventSource).size() == 2; // the original one plus a warning event
        assert allEvents.get(eventSource2).size() == 1; // our new one (no warning events here)
View Full Code Here

Examples of org.rhq.core.domain.event.transfer.EventReport.addLimitWarningEvents()

        EventSource eventSource = new EventSource("foo", eventDefinition, resource);
        EventReport report = new EventReport(10, 1); // max total takes precedence!

        // add the first
        addEvent(report, "foo", "first", eventSource);
        report.addLimitWarningEvents(); // should do nothing
        Map<EventSource, Set<Event>> allEvents = report.getEvents();
        assert allEvents.size() == 1; // only one event source still!
        assert allEvents.get(eventSource).size() == 1;

        // add the second (this is over the max)
View Full Code Here

Examples of org.rhq.core.domain.event.transfer.EventReport.addLimitWarningEvents()

        assert allEvents.size() == 1; // only one event source still!
        assert allEvents.get(eventSource).size() == 1;

        // add the second (this is over the max)
        addEvent(report, "foo", "second", eventSource); // OVER MAX SO THIS NEVER MAKES IT!
        report.addLimitWarningEvents();
        allEvents = report.getEvents();
        assert allEvents.size() == 1; // only one event source still!
        assert allEvents.get(eventSource).size() == 2; // the second one is our "over the max" message
        int foo_count = 0;
        int limit_count = 0;
View Full Code Here

Examples of org.rhq.core.domain.event.transfer.EventReport.addLimitWarningEvents()

        EventSource eventSource2 = new EventSource("bar", eventDefinition, resource);
        report = stripLimitWarningEvents(report);
        addEvent(report, "foo", "second", eventSource); // OVER MAX SO THIS NEVER MAKES IT!
        addEvent(report, "foo", "third", eventSource); // STILL OVER MAX SO THIS NEVER MAKES IT EITHER!
        addEvent(report, "bar", "first", eventSource2); // WE ARE OVER THE TOTAL MAX, SO THIS NEVER MAKES IT EITHER!
        report.addLimitWarningEvents();
        allEvents = report.getEvents();
        assert allEvents.size() == 2; // both are here, the second one just has a single limit warning event
        assert allEvents.get(eventSource).size() == 2;
        assert allEvents.containsKey(eventSource2) == true; // even though the "real" event never made it, we have a limit warn event
        assert allEvents.get(eventSource2).size() == 1; // this isn't the "real" bar event, its the limit warn event
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.