Package org.rhq.enterprise.server.test

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


        });
    }

    private void createInventory() throws Exception {
        purgeDB();
        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


    private void purgeDB() {
        purgeBaselines();
        purgeOOBs();

        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                ResourceCriteria c = new ResourceCriteria();
                c.addFilterInventoryStatus(null);
                c.addFilterResourceKey(RESOURCE_KEY);
View Full Code Here

    private void purgeOOBs() {
        purgeTables("rhq_measurement_oob");
    }

    private void purgeTables(final String... tables) {
        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                for (String table : tables) {
                    getEntityManager().createNativeQuery("delete from " + table).executeUpdate();
                }
View Full Code Here

            }
        });
    }

    private void insertBaselines(final List<MeasurementBaseline> baselines) {
        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                EntityManager em = getEntityManager();
                for (MeasurementBaseline baseline : baselines) {
                    em.persist(baseline);
View Full Code Here

   
    @Test(groups = "integration.ejb3")
    public void testStorageNodeCriteriaFinder() throws Exception {

        final int storageNodeCount = 42;
        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {
                // verify that all storage nodes objects are actually parsed.
                final Set<String> nodeAddresses = new HashSet<String>(storageNodeCount);
View Full Code Here

        });
    }
   
    @Test(groups = "integration.ejb3")
    public void testStorageNodeAckFailedOperation() throws Exception {
        executeInTransaction(new TransactionCallback() {

            @Override
            public void execute() throws Exception {
                StorageNode node = StorageNodeFactory.newInstance();
                final String address = TEST_PREFIX + "foo.com";
View Full Code Here

    @Test(groups = "integration.ejb3")
    public void testParsingCriteriaQueryResults1() throws Exception {

        final int serverCount = 208;
        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {
                // verify that all server objects are actually parsed.
                final Set<String> serverNames = new HashSet<String>(serverCount);
                serverNames.add(TestConstants.RHQ_TEST_SERVER_NAME);
View Full Code Here

    @Test(groups = "integration.ejb3")
    public void testParsingCriteriaQueryResults2() throws Exception {

        final int serverCount = 307;
        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {
                // verify that all server objects are actually parsed.
                final Set<String> serverNames = new HashSet<String>(serverCount);
                serverNames.add(TestConstants.RHQ_TEST_SERVER_NAME);
View Full Code Here

   
    @Test(groups = "integration.ejb3")
    public void testParsingCriteriaQueryResultsStrict() throws Exception {

        final int serverCount = 10;
        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {
                // verify that all server objects are actually parsed.
                final Set<String> serverNames = new HashSet<String>(serverCount);
View Full Code Here

    @Test(groups = "integration.ejb3")
    public void testFindNonExistentServer() throws Exception {

        final int serverCount = 5;

        executeInTransaction(new TransactionCallback() {
            public void execute() throws Exception {

                final String namePrefix = "server";
                final String addressPrefix = "address";
               
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.