Package org.rhq.modules.plugins.jbossas7.json

Examples of org.rhq.modules.plugins.jbossas7.json.Address


* @author Heiko W. Rupp
*/
public class MiscTest extends AbstractIntegrationTest {

    public void testSetRollback() throws Exception {
        Operation op = new Operation("foo", new Address());
        Result res = getDomainControllerASConnection().execute(op);
        assertNotNull(res);
        assertFalse(res.isSuccess(), "Response outcome was success.");
        assertTrue(res.isRolledBack(), "Response was not rolled back: " + res);
        assertTrue(res.getFailureDescription().endsWith("rolled-back=true"), "Unexpected failure description: " + res);
View Full Code Here


        assertTrue(res.isRolledBack(), "Response was not rolled back: " + res);
        assertTrue(res.getFailureDescription().endsWith("rolled-back=true"), "Unexpected failure description: " + res);
    }

    public void testCompositeReadAttribute() throws Exception {
        Address a = new Address("profile=default,subsystem=web,connector=http");
        CompositeOperation cop = new CompositeOperation();
        Operation step1 = new ReadAttribute(a, "maxTime");
        cop.addStep(step1);
        Operation step2 = new ReadAttribute(a, "processingTime");
        cop.addStep(step2);
View Full Code Here

@Test(groups = "unit")
public class PathHandlingTest {

    public void emptyAddress() throws Exception {

        Address a = new Address();
        assert a.getPath() != null;
        assert a.getPath().isEmpty();
    }
View Full Code Here

        assert a.getPath().isEmpty();
    }

    public void emptyAddress2() throws Exception {

        Address a = new Address((String) null);
        assert a.getPath() != null;
        assert a.getPath().isEmpty();
        assert a.isEmpty();
        assert a.size() == 0;
    }
View Full Code Here

        assert a.size() == 0;
    }

    public void addressPath1() throws Exception {
        String path = "subsystem=jms,profile=default,queue=foo";
        Address a = new Address("/" + path);
        assert a.getPath().equals(path);
    }
View Full Code Here

        assert a.getPath().equals(path);
    }

    public void addressPath2() throws Exception {
        String path = "subsystem=jms,profile=default,queue=foo";
        Address a = new Address(path);
        assert a.getPath().equals(path);
        assert a.size() == 3 : "Size was not 3, but " + a.size();
        assert !a.isEmpty();
    }
View Full Code Here

            List<String> childrenNamesSubList = childrenNames.subList(0, Math.min(batchSize, childrenNames.size()));

            // Create batch operation to read N query-cache nodes
            CompositeOperation batchOperation = new CompositeOperation();
            for (String childrenName : childrenNamesSubList) {
                Address address = new Address(getAddress());
                address.add("query-cache", childrenName);
                ReadResource readQueryCacheResource = new ReadResource(address);
                readQueryCacheResource.includeRuntime(true);
                batchOperation.addStep(readQueryCacheResource);
            }
View Full Code Here

        assert !a.isEmpty();
    }

    public void getParent1() throws Exception {
        String path = "subsystem=jms,profile=default,queue=foo";
        Address a = new Address(path);
        Address b = a.getParent();
        assert b != null;
        assert b.size() == 2;
        assert b.get(0).equals("subsystem=jms");
        assert b.get(1).equals("profile=default");
    }
View Full Code Here

        assert b.get(0).equals("subsystem=jms");
        assert b.get(1).equals("profile=default");
    }

    public void getParent2() throws Exception {
        Address a = new Address();
        Address b = a.getParent();
        assert b != null;
        assert b.isEmpty();
        assert b.size() == 0;
    }
View Full Code Here

        assert b.isEmpty();
        assert b.size() == 0;
    }

    public void getParent3() throws Exception {
        Address a = new Address("foo=bar");
        Address b = a.getParent();
        assert b != null;
        assert b.isEmpty();
        assert b.size() == 0;
    }
View Full Code Here

TOP

Related Classes of org.rhq.modules.plugins.jbossas7.json.Address

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.