Package org.rhq.enterprise.server.test

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


    }
   
   
    private void testParsingHelperStartingPageEqualTo(final int startPage, final int pageSize, final int serverCount) throws Exception {

        executeInTransaction(new TransactionCallback() {
            public void execute() throws Exception {
                // verify that all server objects are actually parsed.
                final Set<String> serverNames = new TreeSet<String>();
                final String namePrefix = "server";
                final String addressPrefix = "address";
View Full Code Here


        assertEquals("Unexpected number of alerts on the resource.", 1, alerts.size());
    }

    private void createInventory() throws Exception {
        purgeDB(false);
        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {

                resourceType = new ResourceType(RESOURCE_TYPE, PLUGIN, SERVER, null);
                em.persist(resourceType);
View Full Code Here

        if (!r.isEmpty()) {
            Resource doomedResource = r.get(0);
            deleteAlertDefinitions(doomedResource.getAlertDefinitions());
        }

        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {

                if (!r.isEmpty()) {
                    //load the resource entity again within this transaction so that we
View Full Code Here

        // Then simulate a create resource request
        final String userSuppliedResourceName = prefix("User Supplied Resource Name");
        final String newResourceKey = prefix("Created Resource Key");
        final int serverResourceId = firstDiscoverySyncInfo.getTopLevelServerIds().iterator().next();

        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                Resource serverResource = getEntityManager().find(Resource.class, serverResourceId);
                CreateResourceHistory createResourceHistory = new CreateResourceHistory(serverResource, serviceType1,
                    subjectManager.getOverlord().getName(), new Configuration());
View Full Code Here

    // Test Cases  --------------------------------------------

    @Test(enabled = ENABLE_TESTS)
    public void testPackageBits() throws Throwable {

        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {
                LoadedPackageBitsComposite composite;

                try {
View Full Code Here

    }

    @Test(enabled = ENABLE_TESTS)
    public void testPackageBitsBlobStream() throws Throwable {

        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {
                LoadedPackageBitsComposite composite;
                try {
                    Resource resource = SessionTestHelper.createNewResource(em, "testPkgBitsLargeResource");
View Full Code Here

        driftDef.setDriftHandlingMode(normal);
        driftDef.setInterval(2400L);
        driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
        driftDef.setResource(resource);

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

        driftDef.setInterval(2400L);
        driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
        driftDef.setResource(resource);

        // persist the change set and drift definition
        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                em.persist(changeSet);
                em.persist(driftDef);
                em.persist(driftSet);
View Full Code Here

        unprepareScheduler();
    }

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

            public void execute() throws Exception {
                PageList<Repo> repos = repoManager.findRepos(overlord, new PageControl());
                int origsize = 0;
                if (repos != null) {
View Full Code Here

        });
    }

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

            public void execute() throws Exception {

                Repo repo = new Repo("testCreateDeleteRepo");
                int id = repoManager.createRepo(overlord, repo).getId();
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.