Package org.rhq.core.domain.event.transfer

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


        ResourceType resourceType = new ResourceType("foo", "foo", ResourceCategory.PLATFORM, null);
        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;
View Full Code Here


        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);
        report.addLimitWarningEvents(); // should do nothing
        allEvents = report.getEvents();
        assert allEvents.size() == 1; // only one event source still!
        assert allEvents.get(eventSource).size() == 2;
View Full Code Here

            assert e.getDetail().startsWith("foo-");
        }

        // 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

        ResourceType resourceType = new ResourceType("foo", "foo", ResourceCategory.PLATFORM, null);
        Resource resource = new Resource(1);
        EventDefinition eventDefinition = new EventDefinition(resourceType, "foo");
        EventSource eventSource = new EventSource("foo", eventDefinition, resource);
        EventReport report = new EventReport(2, 2);
        report.addEvent(new Event("foo", "foo", 0, EventSeverity.DEBUG, ""), eventSource);
        assert ensureSerializable(report).getEvents().size() == 1;
        report.addEvent(new Event("foo", "foo", 1, EventSeverity.DEBUG, ""), eventSource);
        assert ensureSerializable(report).getEvents().size() == 1; // only one event source still!
        assert ensureSerializable(report).getEvents().values().iterator().next().size() == 2;
    }
View Full Code Here

        EventDefinition eventDefinition = new EventDefinition(resourceType, "foo");
        EventSource eventSource = new EventSource("foo", eventDefinition, resource);
        EventReport report = new EventReport(2, 2);
        report.addEvent(new Event("foo", "foo", 0, EventSeverity.DEBUG, ""), eventSource);
        assert ensureSerializable(report).getEvents().size() == 1;
        report.addEvent(new Event("foo", "foo", 1, EventSeverity.DEBUG, ""), eventSource);
        assert ensureSerializable(report).getEvents().size() == 1; // only one event source still!
        assert ensureSerializable(report).getEvents().values().iterator().next().size() == 2;
    }

    /**
 
View Full Code Here

        for (Map.Entry<EventSource, Set<Event>> entry : report.getEvents().entrySet()) {
            EventSource eventSource = entry.getKey();
            for (Event event : entry.getValue()) {
                if (event.getSeverity() == EventSeverity.DEBUG) {
                    newReport.addEvent(event, eventSource);
                }
            }
        }

        return newReport;
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.