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

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


        int resourceId = 1;

        MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, resourceId, 1);
        c1.setCtime(startTime - (1000 * 5))// c1 is created 5 seconds before startTime
        MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry("c1-1.txt", FILE_ADDED);
        e1.setCtime(startTime - (1000 * 5))// e1 is created 5 seconds before startTime
        c1.add(e1);

        dao.save(c1);

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

        dao.save(c2);

        GenericDriftCriteria criteria = new GenericDriftCriteria();
View Full Code Here


    }

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

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

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterChangeSetId(c2.getId());
View Full Code Here

    }

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

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

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterResourceIds(1);
View Full Code Here

    }

    @Test(enabled = ENABLED)
    public void findEntriesWithResourceIdAndCategoryFilters() {
        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(COVERAGE, 1, 2, 1);
        MongoDBChangeSetEntry e3 = new MongoDBChangeSetEntry("c2-1.txt", FILE_ADDED);
        c2.add(e3);
        dao.save(c2);

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

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterResourceIds(1);
View Full Code Here

    public void findEntriesWithResourceIdAndStartTimeFilter() throws Exception {
        long startTime = System.currentTimeMillis() - (1000 * 60 * 60)// one hour ago

        MongoDBChangeSet c1 = createChangeSet(COVERAGE, 1, 1, 1);
        c1.setCtime(startTime - (1000 * 5))// c1 is created 5 seconds before startTime
        MongoDBChangeSetEntry e1 = new MongoDBChangeSetEntry("c1-1.txt", FILE_ADDED);
        c1.add(e1);
        e1.setCtime(startTime - (1000 * 5))// e1 is created 5 seconds before startTime
        dao.save(c1);

        MongoDBChangeSet c2 = createChangeSet(COVERAGE, 1, 2, 1);
        c2.setCtime(startTime - (1000 * 5))// c2 is created 5 seconds before startTime
        MongoDBChangeSetEntry e2 = new MongoDBChangeSetEntry("c2-1.txt", FILE_ADDED);
        e2.setCtime(startTime - (1000 * 5))// e2 is created 5 seconds before startTime
        c2.add(new MongoDBChangeSetEntry("c2-1.txt", FILE_ADDED));
        dao.save(c2);

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

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterStartTime(startTime);
View Full Code Here

    }

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

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

        long endTime = System.currentTimeMillis();
        Thread.sleep(10);

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

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterEndTime(endTime);
View Full Code Here

    }

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

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

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

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

    }

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

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

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

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

    }

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

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

        MongoDBChangeSet c3 = createChangeSet(COVERAGE, 1, 2, 1);
        MongoDBChangeSetEntry e4 = new MongoDBChangeSetEntry("c2-1.txt", FILE_ADDED);
        MongoDBChangeSetEntry e5 = new MongoDBChangeSetEntry("c3-1.txt", FILE_ADDED);
        c3.add(e4).add(e5);
        dao.save(c3);

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterPath("c2-1.txt");
View Full Code Here

    }

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

        dao.save(c1);

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

        dao.save(c2);

        GenericDriftCriteria criteria = new GenericDriftCriteria();
        criteria.addFilterChangeSetId(c2.getId());
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.