Package org.rhq.enterprise.server.test

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


        });
    }

    @Test
    public void testAcknowledgeAlertsByTemplateContext() {
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                try {
                    // Template definition alert id could be anything
                    alertManager.acknowledgeAlertsByContext(testData.getSubject(), EntityContext.forTemplate(42));
View Full Code Here


        final GroupOperationHistory groupOpHistory = results.get(0);

        // We'll throw in a time based purge test here. We can't purge before current time because we could wipe out
        // stuff generated by other tests.  To try and limit what we wipe out, set the ctime of the group history to
        // be very old...
        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                Query q = em.createQuery("update GroupOperationHistory h set h.createdTime = 900 where h.id = "
                    + groupOpHistory.getId());
                int numUpdated = q.executeUpdate();
View Full Code Here

        assert history.getStatus() == OperationRequestStatus.FAILURE : history;

        // We'll throw in a time based purge test here. We can't purge before current time because we could wipe out
        // stuff generated by other tests.  To try and limit what we wipe out, set the ctime of the res history to
        // be very old...
        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                Query q = em.createQuery("update ResourceOperationHistory h set h.createdTime = 900 where h.id = "
                    + history.getId());
                int numUpdated = q.executeUpdate();
View Full Code Here

*/
public class ScriptingAPIServerTest extends ScriptableAbstractEJB3Test {

    @Test
    public void testProxyFactoryCorrectlyDefinesMethodsAndProperties() throws Exception {
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                ResourceType rt = createResourceType();
                Resource r = createResource(rt);

View Full Code Here

        resourceManager = LookupUtil.getResourceManager();
    }

    @Test
    public void testNoCandidates() {
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                ResourceCriteria criteria = new ResourceCriteria();
                criteria.setCaseSensitive(false);
                criteria.addFilterName(GROUP_MEMBER_CANDIDATE_NAME_PREFIX);
View Full Code Here

        });
    }

    @Test
    public void testNoCandidatesWithExclusions() {
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                ResourceCriteria criteria = new ResourceCriteria();
                criteria.setCaseSensitive(false);
                criteria.addFilterName(GROUP_MEMBER_CANDIDATE_NAME_PREFIX);
View Full Code Here

        });
    }

    @Test
    public void testUnlimitedPageControl() {
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                ResourceCriteria criteria = new ResourceCriteria();
                criteria.setPageControl(PageControl.getUnlimitedInstance());
View Full Code Here

        });
    }

    @Test
    public void testPageControl() {
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                int resourcesCount = 100;
                createTestResources(resourcesCount);
                ResourceCriteria criteria = new ResourceCriteria();
View Full Code Here

        });
    }

    @Test
    public void testPageControlWithExclusions() {
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                int resourcesCount = 100;
                int[] resourcesIds = createTestResources(resourcesCount);
                ResourceCriteria criteria = new ResourceCriteria();
View Full Code Here

            }
        }
    }

    private void moveBaselineBackInPast(final MeasurementSchedule schedule, final long anHourAgo) {
        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                String query = "update MeasurementBaseline set computeTime = :computeTime " //
                    + "where scheduleId = :scheduleId";
                getEntityManager().createQuery(query) //
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.