Package org.rhq.enterprise.server.test

Examples of org.rhq.enterprise.server.test.TransactionCallback


        });
    }

    @Test(enabled = ENABLED)
    public void deleteCandidatesForContentSource() throws Exception {
        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {

                ContentSourceType contentSourceType = new ContentSourceType("testSourceType");
                Set<ContentSourceType> types = new HashSet<ContentSourceType>(1);
View Full Code Here


    @Test(enabled = ENABLED)
    public void updateRepoWithProvider() throws Exception {
        // See BZ 537216 for more details

        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {

                String newName = "newRepo-" + RandomStringUtils.randomAlphanumeric(6);
                String oldName = "testRepo-" + RandomStringUtils.randomAlphanumeric(6);
View Full Code Here

        });
    }

    @Test(enabled = ENABLED)
    public void updateSyncSchedule() {
        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {

                Repo repo = new Repo("updateSyncSchedule");
                repo.setSyncSchedule("NOT A VALID CRON");
View Full Code Here

        definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));

        final DriftDefinitionTemplate newTemplate = templateMgr.createTemplate(getOverlord(), resourceType.getId(),
            true, definition);

        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                ResourceType updatedType = em.find(ResourceType.class, resourceType.getId());

                assertEquals("Failed to add new drift definition to resource type", 1, updatedType
View Full Code Here

        // create change set v1
        driftFile2 = new JPADriftFile(driftFile2Hash);
        final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, attachedDef1);
        drift2 = new JPADrift(changeSet1, drift2Path, FILE_ADDED, null, driftFile2);

        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                em.persist(attachedDef1);

                em.persist(driftFile1);
View Full Code Here

        drift2 = new JPADrift(changeSet1, drift2Path, FILE_ADDED, null, driftFile2);

        final JPADriftSet driftSet1 = new JPADriftSet();
        driftSet1.addDrift(drift2);

        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                em.persist(attachedDef1);
                em.persist(attachedDef2);
                em.persist(detachedDef1);
View Full Code Here

            new AggregateNumericMetric(schedule3.getId(), Bucket.ONE_HOUR, 3.15, 2.96, 3.59, lastHour.getMillis()) //
        );

        oobManager.computeOOBsForLastHour(overlord, metrics);

        executeInTransaction(new TransactionCallback() {
            @Override
            @SuppressWarnings("unchecked")
            public void execute() throws Exception {
                EntityManager em = getEntityManager();
                List<MeasurementOOB> oobs = em.createQuery("select oob from MeasurementOOB oob").getResultList();
View Full Code Here

        JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);

        final JPADriftSet driftSet = new JPADriftSet();
        driftSet.addDrift(drift);

        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                EntityManager em = getEntityManager();
                em.persist(driftFile1);
                em.persist(changeSet);
View Full Code Here

        // create change set v1
        final JPADriftFile driftFile2 = new JPADriftFile(NAME_PREFIX + "1a2b3c");
        final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, driftDef);
        final JPADrift drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);

        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                EntityManager em = getEntityManager();
                em.persist(driftFile1);
                em.persist(driftFile2);
View Full Code Here

        JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);

        final JPADriftSet driftSet = new JPADriftSet();
        driftSet.addDrift(drift);

        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                EntityManager em = getEntityManager();
                em.persist(driftFile1);
                em.persist(changeSet);
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.test.TransactionCallback

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.