Package org.jboss.dmr

Examples of org.jboss.dmr.ValueExpression


        Assert.assertEquals(1, legacyModel.keys().size());
        Assert.assertEquals("test-ds", legacyModel.get(DEFAULT_DATASOURCE.getName()).asString());

        ModelNode op = Util.getWriteAttributeOperation(PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, JPAExtension.SUBSYSTEM_NAME)),
                CommonAttributes.DEFAULT_EXTENDEDPERSISTENCE_INHERITANCE,
                new ModelNode().set(new ValueExpression("${xxxx:SHALLOW}")));
        ModelTestUtils.checkFailed(mainServices.executeOperation(oldVersion, mainServices.transformOperation(oldVersion, op)));

        op = Util.getWriteAttributeOperation(PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, JPAExtension.SUBSYSTEM_NAME)),
                CommonAttributes.DEFAULT_EXTENDEDPERSISTENCE_INHERITANCE,
                new ModelNode().set(new ValueExpression("SHALLOW")));
        ModelTestUtils.checkFailed(mainServices.executeOperation(oldVersion, mainServices.transformOperation(oldVersion, op)));

        op = Util.getUndefineAttributeOperation(PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, JPAExtension.SUBSYSTEM_NAME)), CommonAttributes.DEFAULT_EXTENDEDPERSISTENCE_INHERITANCE);
        ModelTestUtils.checkOutcome(mainServices.executeOperation(oldVersion, mainServices.transformOperation(oldVersion, op)));
    }
View Full Code Here


                        if (attrType == ModelType.STRING) {
                            checkForUnconvertedExpression(address, attrName, attrValue);
                        }
                        String expression = "${exp.test:" + attrValue.asString() + "}";
                        expressionAttrs.put(attrName, new ModelNode(expression));
                        expectedAttrs.put(attrName, new ModelNode().set(new ValueExpression(expression)));
                        simple++;
                        logHandling("Added expression to simple attribute " + attrName + " at " + address.toModelNode().asString());
                    }
                } else {
                    if (attrType != ModelType.EXPRESSION) {
View Full Code Here

                        if (propValType == ModelType.STRING) {
                            checkForUnconvertedExpression(address, attrName, propVal);
                        }
                        String expression = "${exp.test:" + propVal.asString() + "}";
                        updated.get(prop.getName()).set(expression);
                        expected.get(prop.getName()).set(new ModelNode().set(new ValueExpression(expression)));
                        hasExpression = true;

                    } else {
                        updated.get(prop.getName()).set(propVal);
                        expected.get(prop.getName()).set(propVal);
                    }
                } else if (item.isDefined() && itemType != ModelType.EXPRESSION) {
                    // Convert item to expression
                    if (itemType == ModelType.STRING) {
                        checkForUnconvertedExpression(address, attrName, item);
                    }
                    String expression = "${exp.test:" + item.asString() + "}";
                    updated.add(expression);
                    expected.add(new ModelNode().set(new ValueExpression(expression)));
                    hasExpression = true;
                } else {
                    updated.add(item);
                    expected.add(item);
                }
View Full Code Here

                    checkForUnconvertedExpression(address, attrName, item);
                }
                String valueString = timeunit ? fieldValue.asString().toLowerCase() : fieldValue.asString();
                String expression = "${exp.test:" + valueString + "}";
                updatedItem.get(fieldName).set(expression);
                itemToExpect.get(fieldName).set(new ModelNode().set(new ValueExpression(expression)));
                changed = true;
            }
        }

        if (!changed) {
View Full Code Here

        Assert.assertEquals(ModelType.UNDEFINED, val.getType());
    }

    @Test
    public void testExpression() {
        ModelNode val = new ModelNode().set(new ValueExpression("${foo}"));
        Assert.assertTrue(testee.rejectAttribute(PathAddress.EMPTY_ADDRESS, "foo", val, null));
        testee.convertAttribute(PathAddress.EMPTY_ADDRESS, "foo", val, null);
        Assert.assertEquals(ModelType.EXPRESSION, val.getType());
    }
View Full Code Here

            checkSubsystemModelTransformation(mainServices, modelVersion, new ModelFixer() {
                @Override
                public ModelNode fixModel(ModelNode modelNode) {
                    Assert.assertTrue(modelNode.get(EESubsystemModel.JBOSS_DESCRIPTOR_PROPERTY_REPLACEMENT).asBoolean());
                    //Replace the value used in the xml
                    modelNode.get(EESubsystemModel.JBOSS_DESCRIPTOR_PROPERTY_REPLACEMENT).set(new ValueExpression("${test-exp2:false}"));
                    return modelNode;
                }
            });
        } finally {
            System.clearProperty("jboss.test.core.model.version.override");
View Full Code Here

TOP

Related Classes of org.jboss.dmr.ValueExpression

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.