Package org.jboss.dmr

Examples of org.jboss.dmr.ModelNode.asPropertyList()


     * @return
     */
    public static List<Property> getCachesAsPropertyList(ModelNode model, String containerName, String cacheType) {
        ModelNode caches = model.get(ModelKeys.CACHE_CONTAINER, containerName, cacheType);
        if (caches.isDefined() && caches.getType() == ModelType.OBJECT) {
            return caches.asPropertyList();
        }
        return null ;
    }

    private void writeAliases(XMLExtendedStreamWriter writer, Attribute attribute, ModelNode container, String key) throws XMLStreamException {
View Full Code Here


                // TODO could be this... could be that
                if(result.hasDefined(Util.DOMAIN_RESULTS)) {
                    result = result.get(Util.DOMAIN_RESULTS);
                }
                final List<Property> stepResponses = result.asPropertyList();
                for(int i = 0; i < serverGroups.size() ; ++i) {
                    final Property prop = stepResponses.get(i);
                    ModelNode stepResponse = prop.getValue();
                    if(stepResponse.has(prop.getName())) { // TODO remove when the structure is consistent
                        stepResponse = stepResponse.get(prop.getName());
View Full Code Here

                // TODO it could be... could be not...
                if(result.hasDefined(Util.DOMAIN_RESULTS)) {
                    result = result.get(Util.DOMAIN_RESULTS);
                }

                final Iterator<Property> steps = result.asPropertyList().iterator();
                if(!steps.hasNext()) {
                    throw new CommandFormatException("Response for the main resource info of the deployment is missing: " + result);
                }

                // /deployment=<name>
View Full Code Here

    @Test
    public void testDefault_Object() throws Exception {
        final ModelNode value = ArgumentValueConverter.DEFAULT.fromString("{\"item1\"=>\"value1\",\"item2\"=>\"value2\"}");
        assertNotNull(value);
        assertEquals(ModelType.OBJECT, value.getType());
        final List<Property> list = value.asPropertyList();
        assertEquals(2, list.size());
        assertEquals("item1", list.get(0).getName());
        assertEquals("value1", list.get(0).getValue().asString());
        assertEquals("item2", list.get(1).getName());
        assertEquals("value2", list.get(1).getValue().asString());
View Full Code Here

    @Test
    public void testPropertyList_DMR() throws Exception {
        final ModelNode value = ArgumentValueConverter.PROPERTIES.fromString("[(\"a\"=>\"b\"),(\"c\"=>\"d\")]");
        assertNotNull(value);
        assertEquals(ModelType.LIST, value.getType());
        final List<Property> list = value.asPropertyList();
        assertEquals(2, list.size());
        Property prop = list.get(0);
        assertNotNull(prop);
        assertEquals("a", prop.getName());
        assertEquals("b", prop.getValue().asString());
View Full Code Here

    @Test
    public void testPropertyList_SimpleCommaSeparated() throws Exception {
        final ModelNode value = ArgumentValueConverter.PROPERTIES.fromString("a=b,c=d");
        assertNotNull(value);
        assertEquals(ModelType.LIST, value.getType());
        final List<Property> list = value.asPropertyList();
        assertEquals(2, list.size());
        Property prop = list.get(0);
        assertNotNull(prop);
        assertEquals("a", prop.getName());
        assertEquals("b", prop.getValue().asString());
View Full Code Here

    @Test
    public void testPropertyList_SimpleCommaSeparatedInBrackets() throws Exception {
        final ModelNode value = ArgumentValueConverter.PROPERTIES.fromString("[a=b,c=d]");
        assertNotNull(value);
        assertEquals(ModelType.LIST, value.getType());
        final List<Property> list = value.asPropertyList();
        assertEquals(2, list.size());
        Property prop = list.get(0);
        assertNotNull(prop);
        assertEquals("a", prop.getName());
        assertEquals("b", prop.getValue().asString());
View Full Code Here

    @Test
    public void testObject_DMR() throws Exception {
        final ModelNode value = ArgumentValueConverter.OBJECT.fromString("{\"a\"=>\"b\",\"c\"=>\"d\"}");
        assertNotNull(value);
        assertEquals(ModelType.OBJECT, value.getType());
        final List<Property> list = value.asPropertyList();
        assertEquals(2, list.size());
        Property prop = list.get(0);
        assertNotNull(prop);
        assertEquals("a", prop.getName());
        assertEquals("b", prop.getValue().asString());
View Full Code Here

    @Test
    public void testObject_SimpleCommaSeparated() throws Exception {
        final ModelNode value = ArgumentValueConverter.OBJECT.fromString("a=b,c=d");
        assertNotNull(value);
        assertEquals(ModelType.OBJECT, value.getType());
        final List<Property> list = value.asPropertyList();
        assertEquals(2, list.size());
        Property prop = list.get(0);
        assertNotNull(prop);
        assertEquals("a", prop.getName());
        assertEquals("b", prop.getValue().asString());
View Full Code Here

    @Test
    public void testObject_SimpleCommaSeparatedInCurlyBraces() throws Exception {
        final ModelNode value = ArgumentValueConverter.OBJECT.fromString("{a=b,c=d}");
        assertNotNull(value);
        assertEquals(ModelType.OBJECT, value.getType());
        final List<Property> list = value.asPropertyList();
        assertEquals(2, list.size());
        Property prop = list.get(0);
        assertNotNull(prop);
        assertEquals("a", prop.getName());
        assertEquals("b", prop.getValue().asString());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.