Package org.rhq.enterprise.server.plugins.drift.mongodb.entities

Examples of org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSetEntry


        expected.setCategory(DRIFT);
        expected.setResourceId(1);
        expected.setDriftDefinitionId(1);
        expected.setVersion(1);

        MongoDBChangeSetEntry entry = new MongoDBChangeSetEntry();
        entry.setCategory(FILE_ADDED);
        entry.setPath("foo");

        // Adding the file to the change set entry causes the test to fail because the
        // custom assert uses the equals method when comparing the MongoDBFile objects and
        // MongoDBFile does not implement equals/hashCode...yet.
View Full Code Here


        MongoDBChangeSet expected = new MongoDBChangeSet();
        expected.setCategory(DRIFT);
        expected.setVersion(1);
        expected.setResourceId(1);
        expected.setDriftDefinitionId(1);
        expected.add(new MongoDBChangeSetEntry("foo", FILE_ADDED)).add(new MongoDBChangeSetEntry("bar", FILE_ADDED));

        dao.save(expected);

        MongoDBChangeSet actual = dao.get(expected.getObjectId());
View Full Code Here

        c1.setCategory(DRIFT);
        c1.setVersion(1);
        c1.setResourceId(1);
        c1.setDriftDefinitionId(1);
       
        MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry("/test/foo.txt", FILE_ADDED);
        c1.add(e1);
        dao.save(c1);

        MongoDBChangeSet c2 = new MongoDBChangeSet();
        c2.setCategory(DRIFT);
        c2.setVersion(2);
        c2.setResourceId(1);
        c2.setDriftDefinitionId(1);

        MongoDBChangeSetEntry e2 = new MongoDBChangeSetEntry("/test/bar.txt", FILE_ADDED);
        c2.add(e2);
        dao.save(c2);
       
        GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
        criteria.addFilterDriftPath("foo");
View Full Code Here

        c1.setCategory(DRIFT);
        c1.setVersion(1);
        c1.setResourceId(1);
        c1.setDriftDefinitionId(1);

        MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry("./foo/foo.txt", FILE_ADDED);
        c1.add(e1);
        dao.save(c1);

        MongoDBChangeSet c2 = new MongoDBChangeSet();
        c2.setCategory(DRIFT);
        c2.setVersion(2);
        c2.setResourceId(1);
        c2.setDriftDefinitionId(1);

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

        GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
        criteria.addFilterDriftDefinitionId(1);
View Full Code Here

        MongoDBChangeSet c1 = new MongoDBChangeSet();
        c1.setCategory(COVERAGE);
        c1.setVersion(1);
        c1.setResourceId(1);
        c1.setDriftDefinitionId(1);
        c1.add(new MongoDBChangeSetEntry("foo.txt", FILE_ADDED));
        c1.add(new MongoDBChangeSetEntry("bar.txt", FILE_ADDED));
        dao.save(c1);

        MongoDBChangeSet c2 = new MongoDBChangeSet();
        c2.setCategory(DRIFT);
        c2.setVersion(2);
        c2.setResourceId(1);
        c2.setDriftDefinitionId(1);
        c2.add(new MongoDBChangeSetEntry("foo.txt", FILE_CHANGED));
        dao.save(c2);

        MongoDBChangeSet c3 = new MongoDBChangeSet();
        c3.setCategory(DRIFT);
        c3.setVersion(3);
        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);
View Full Code Here

        MongoDBChangeSet c1 = new MongoDBChangeSet();
        c1.setCategory(COVERAGE);
        c1.setVersion(1);
        c1.setResourceId(1);
        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);
View Full Code Here

            expected, actual, ignore);
    }

    @Test(enabled = ENABLED)
    public void findByDriftCriteriaWithCategoryFilter() throws Exception {
        MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1).add(new MongoDBChangeSetEntry("c1-1.txt", FILE_ADDED));
        dao.save(c1);

        MongoDBChangeSet c2 = createChangeSet(DRIFT, 2, 1, 1).add(new MongoDBChangeSetEntry("c2-1.txt", FILE_ADDED))
            .add(new MongoDBChangeSetEntry("c1-1.txt", FILE_CHANGED));
        dao.save(c2);

        MongoDBChangeSet c3 = createChangeSet(DRIFT, 3, 1, 1).add(new MongoDBChangeSetEntry("c1-1.txt", FILE_REMOVED));
        dao.save(c3);

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterCategories(FILE_ADDED);
View Full Code Here

            actual, ignore);
    }

    @Test(enabled = ENABLED)
    public void findByDriftCriteriaWithCategoriesFilter() throws Exception {
        MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1).add(new MongoDBChangeSetEntry("c1-1.txt", FILE_ADDED));
        dao.save(c1);

        MongoDBChangeSet c2 = createChangeSet(DRIFT, 2, 1, 1).add(new MongoDBChangeSetEntry("c2-1.txt", FILE_ADDED))
            .add(new MongoDBChangeSetEntry("c1-1.txt", FILE_CHANGED));
        dao.save(c2);

        MongoDBChangeSet c3 = createChangeSet(DRIFT, 3, 1, 1).add(new MongoDBChangeSetEntry("c1-1.txt", FILE_REMOVED));
        dao.save(c3);

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterCategories(FILE_CHANGED, FILE_REMOVED);
View Full Code Here

    }

    @Test(enabled = ENABLED)
    public void findEntriesWithIdFilter() throws Exception {
        MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1);
        MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry("c1-1.txt", FILE_ADDED);
        MongoDBChangeSetEntry e2 = new MongoDBChangeSetEntry("c2-1.txt", FILE_ADDED);
        c1.add(e1);
        c1.add(e2);
        dao.save(c1);

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterId(e2.getId());

        List<MongoDBChangeSetEntry> entries = dao.findEntries(criteria);
        assertEntriesMatch("Failed to find change set entries with id filter", asList(e2), entries);
    }
View Full Code Here

    }

    @Test(enabled = ENABLED)
    public void findEntriesWithCategoriesFilter() throws Exception {
        MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1);
        MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry("c1-1.txt", FILE_ADDED);
        MongoDBChangeSetEntry e2 = new MongoDBChangeSetEntry("c1-2.txt", FILE_ADDED);
        c1.add(e1).add(e2);
        dao.save(c1);

        MongoDBChangeSet c2 = createChangeSet(DRIFT, 2, 1, 1);
        MongoDBChangeSetEntry e3 = new MongoDBChangeSetEntry("c2-1.txt", FILE_ADDED);
        MongoDBChangeSetEntry e4 = new MongoDBChangeSetEntry("c1-1.txt", FILE_CHANGED);
        MongoDBChangeSetEntry e5 = new MongoDBChangeSetEntry("c1-2.txt", FILE_REMOVED);
        c2.add(e3).add(e4).add(e5);
        dao.save(c2);

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterCategories(FILE_CHANGED, FILE_REMOVED);
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSetEntry

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.