Package org.rhq.core.domain.criteria

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


        c2.setResourceId(1);
        c2.setDriftDefinitionId(1);
        c2.setCtime(c1.getCtime() + (1000 * 60 * 5))// 5 minutes ago
        dao.save(c2);

        GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
        criteria.addFilterDriftDefinitionId(1);
        criteria.addFilterCreatedBefore(c2.getCtime());

        List<MongoDBChangeSet> actual = dao.findByChangeSetCritiera(criteria);
        List<MongoDBChangeSet> expected = asList(c1);

        String ignore = "drifts";
View Full Code Here


        MongoDBChangeSetEntry e2 = new MongoDBChangeSetEntry("/test/bar.txt", FILE_ADDED);
        c2.add(e2);
        dao.save(c2);
       
        GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
        criteria.addFilterDriftPath("foo");
       
        List<MongoDBChangeSet> actual = dao.findByChangeSetCritiera(criteria);
        List<MongoDBChangeSet> expected = asList(c1);
       
        String ignore = "drifts";
View Full Code Here

        MongoDBChangeSetEntry e2 = new MongoDBChangeSetEntry("./bar/bar.txt", FILE_ADDED);
        c2.add(e2);
        dao.save(c2);

        GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
        criteria.addFilterDriftDefinitionId(1);
        criteria.addFilterDriftDirectory("./bar");

        List<MongoDBChangeSet> actual = dao.findByChangeSetCritiera(criteria);
        List<MongoDBChangeSet> expected = asList(c2);

        String ignore = "drifts";
View Full Code Here

        c3.setVersion(3);
        c3.setResourceId(1);
        c3.setDriftDefinitionId(1);
        dao.save(c3);
       
        GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
        criteria.addFilterDriftDefinitionId(1);
        criteria.addFilterCategory(DRIFT);
       
        List<MongoDBChangeSet> actual = dao.findByChangeSetCritiera(criteria);
        List<MongoDBChangeSet> expected = asList(c2, c3);
       
        String ignore = "drifts";
View Full Code Here

        c3.setResourceId(1);
        c3.setDriftDefinitionId(1);
        c3.add(new MongoDBChangeSetEntry("bar.txt", FILE_REMOVED));
        dao.save(c3);

        GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
        criteria.addFilterDriftDefinitionId(1);
        criteria.addFilterDriftCategories(FILE_CHANGED, FILE_REMOVED);

        List<MongoDBChangeSet> actual = dao.findByChangeSetCritiera(criteria);
        List<MongoDBChangeSet> expected = asList(c2, c3);

        String ignore = "drifts";
View Full Code Here

        c1.setDriftDefinitionId(1);
        c1.add(new MongoDBChangeSetEntry("foo.txt", FILE_ADDED));
        c1.add(new MongoDBChangeSetEntry("bar.txt", FILE_ADDED));
        dao.save(c1);
       
        GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
        criteria.addFilterDriftDefinitionId(1);
        criteria.fetchDrifts(false);
       
        List<MongoDBChangeSet> actual = dao.findByChangeSetCritiera(criteria);
        List<MongoDBChangeSet> expected = asList(c1);
       
        String ignore = "drifts";
View Full Code Here

        c3.setVersion(3);
        c3.setResourceId(1);
        c3.setDriftDefinitionId(1);
        dao.save(c3);
       
        GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
        criteria.addFilterDriftDefinitionId(1);
        criteria.addSortVersion(PageOrdering.ASC);
       
        List<MongoDBChangeSet> actual = dao.findByChangeSetCritiera(criteria);
        List<MongoDBChangeSet> expected = asList(c1, c2, c3);
       
        assertChangeSetsMatch("Failed to sort change sets by version in ascending order", expected, actual);
View Full Code Here

        c3.setVersion(3);
        c3.setResourceId(1);
        c3.setDriftDefinitionId(1);
        dao.save(c3);

        GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
        criteria.addFilterDriftDefinitionId(1);
        criteria.addSortVersion(PageOrdering.DESC);

        List<MongoDBChangeSet> actual = dao.findByChangeSetCritiera(criteria);
        List<MongoDBChangeSet> expected = asList(c3, c2, c1);

        assertChangeSetsMatch("Failed to sort change sets by version in descending order", expected, actual);
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria

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.