Examples of AlertDefinitionCriteria


Examples of org.rhq.core.domain.criteria.AlertDefinitionCriteria

        TestAlertSender.setExpectedSubject(subject);
        TestAlertSender.resetValidateMethodCallCount();

        AlertDefinitionManagerLocal adm = LookupUtil.getAlertDefinitionManager();

        AlertDefinitionCriteria crit = new AlertDefinitionCriteria();
        crit.addFilterId(groupLevelAlertDefinitionId);
        crit.fetchAlertNotifications(true);
        crit.fetchConditions(true);

        List<AlertDefinition> foundDefs = adm.findAlertDefinitionsByCriteria(subject, crit);

        assertEquals("Failed to find the previously created group level alert definition.", 1, foundDefs.size());
View Full Code Here

Examples of org.rhq.core.domain.criteria.AlertDefinitionCriteria

        TestAlertSender.setExpectedSubject(subject);
        TestAlertSender.resetValidateMethodCallCount();

        AlertDefinitionManagerLocal adm = LookupUtil.getAlertDefinitionManager();

        AlertDefinitionCriteria crit = new AlertDefinitionCriteria();
        crit.addFilterId(templateLevelAlertDefinitionId);
        crit.fetchAlertNotifications(true);
        crit.fetchConditions(true);

        List<AlertDefinition> foundDefs = adm.findAlertDefinitionsByCriteria(subject, crit);

        assertEquals("Failed to find the previously created resource level alert definition.", 1, foundDefs.size());
View Full Code Here

Examples of org.rhq.core.domain.criteria.AlertDefinitionCriteria

        TestAlertSender.setExpectedSubject(subject);
        TestAlertSender.resetValidateMethodCallCount();

        AlertDefinitionManagerLocal adm = LookupUtil.getAlertDefinitionManager();

        AlertDefinitionCriteria crit = new AlertDefinitionCriteria();
        crit.addFilterId(resourceLevelAlertDefinitionId);
        crit.fetchAlertNotifications(true);
        crit.fetchConditions(true);

        List<AlertDefinition> foundDefs = adm.findAlertDefinitionsByCriteria(subject, crit);

        assertEquals("Failed to find the previously created resource level alert definition.", 1, foundDefs.size());
View Full Code Here

Examples of org.rhq.core.domain.criteria.AlertDefinitionCriteria

        TestAlertSender.setExpectedSubject(subject);
        TestAlertSender.resetValidateMethodCallCount();

        AlertDefinitionManagerLocal adm = LookupUtil.getAlertDefinitionManager();

        AlertDefinitionCriteria crit = new AlertDefinitionCriteria();
        crit.addFilterId(groupLevelAlertDefinitionId);
        crit.fetchAlertNotifications(true);
        crit.fetchConditions(true);

        List<AlertDefinition> foundDefs = adm.findAlertDefinitionsByCriteria(subject, crit);

        assertEquals("Failed to find the previously created group level alert definition.", 1, foundDefs.size());
View Full Code Here

Examples of org.rhq.core.domain.criteria.AlertDefinitionCriteria

        TestAlertSender.setExpectedSubject(subject);
        TestAlertSender.resetValidateMethodCallCount();

        AlertDefinitionManagerLocal adm = LookupUtil.getAlertDefinitionManager();

        AlertDefinitionCriteria crit = new AlertDefinitionCriteria();
        crit.addFilterId(templateLevelAlertDefinitionId);
        crit.fetchAlertNotifications(true);
        crit.fetchConditions(true);

        List<AlertDefinition> foundDefs = adm.findAlertDefinitionsByCriteria(subject, crit);

        assertEquals("Failed to find the previously created template level alert definition.", 1, foundDefs.size());
View Full Code Here

Examples of org.rhq.core.domain.criteria.AlertDefinitionCriteria

        return notif;
    }

    private void testMainAlertDefinition(int id) {
        AlertDefinitionCriteria crit = new AlertDefinitionCriteria();
        crit.addFilterId(id);
        crit.fetchAlertNotifications(true);

        List<AlertDefinition> checkList = LookupUtil.getAlertDefinitionManager().findAlertDefinitionsByCriteria(
            subject, crit);

        assertNotNull("Failed to retrieve the save alert definition", checkList);
View Full Code Here

Examples of org.rhq.core.domain.criteria.AlertDefinitionCriteria

        assertNull("Ephemeral property seems to have been saved",
            config.getSimpleValue(TestAlertSender.EPHEMERAL_PROPERTY_NAME, null));
    }

    private List<AlertDefinition> testDependentAlertDefinitions(int expectedParentId, ParentType parentType) {
        AlertDefinitionCriteria crit = new AlertDefinitionCriteria();

        Set<Integer> resourceIds = new HashSet<Integer>(resources.size());
        for (Resource r : resources) {
            resourceIds.add(r.getId());
        }

        if (parentType == ParentType.TEMPLATE) {
            crit.addFilterAlertTemplateParentId(expectedParentId);
        } else if (parentType == ParentType.GROUP) {
            crit.addFilterGroupAlertDefinitionId(expectedParentId);
        }

        crit.fetchAlertNotifications(true);

        List<AlertDefinition> checkList = LookupUtil.getAlertDefinitionManager().findAlertDefinitionsByCriteria(
            subject, crit);

        assertNotNull("Failed to retrieve the save alert definition", checkList);
View Full Code Here

Examples of org.rhq.core.domain.criteria.AlertDefinitionCriteria

            @Override
            public void execute() throws Exception {
                String name = prefix + "group_Alertdef";
                int groupAlertDefinitionId = createGroupAlertDefinitionAndGetId(name);

                AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
                criteria.addFilterResourceGroupIds(testData.getResourceGroup().getId());

                // tests the reported bug
                List<AlertDefinition> result = alertDefinitionManager.findAlertDefinitionsByCriteria(
                    testData.getSubject(), criteria);
                assertNotNull(result);
View Full Code Here

Examples of org.rhq.core.domain.criteria.AlertDefinitionCriteria

                testData.getResourceGroup().getId(), new int[] { resource2.getId() });
            LookupUtil.getResourceGroupManager().addResourcesToGroup(subjectManager.getOverlord(),
                testData.getResourceGroup().getId(), new int[] { resource3.getId() });

            int[] ids = new int[] { resource2.getId(), resource3.getId() };
            AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
            criteria.fetchConditions(true);
            criteria.addFilterResourceIds(ids[0], ids[1]);

            List<AlertDefinition> result = alertDefinitionManager.findAlertDefinitionsByCriteria(testData.getSubject(),
                criteria);
            assertNotNull(result);
            assertEquals(2, result.size());
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.