Package liquibase

Examples of liquibase.ContextExpression


    @Test
    public void setParameterValue_doubleSetButSecondWrongDatabase() {
        ChangeLogParameters changeLogParameters = new ChangeLogParameters(new H2Database());

        changeLogParameters.set("doubleSet", "originalValue", new ContextExpression(), new Labels(), "baddb");
        changeLogParameters.set("doubleSet", "newValue");

        assertEquals("newValue", changeLogParameters.getValue("doubleSet"));
    }
View Full Code Here


    @Test
    public void setParameterValue_multiDatabase() {
        ChangeLogParameters changeLogParameters = new ChangeLogParameters(new H2Database());

        changeLogParameters.set("doubleSet", "originalValue", new ContextExpression(), new Labels(), "baddb, h2");

        assertEquals("originalValue", changeLogParameters.getValue("doubleSet"));
    }
View Full Code Here

    public void set(String paramter, Object value) {
        changeLogParameters.add(new ChangeLogParameter(paramter, value));
    }

    public void set(String key, String value, String contexts, String labels, String databases) {
        set(key, value, new ContextExpression(contexts), new Labels(labels), databases);
    }
View Full Code Here

            this.key = key;
            this.value = value;
        }

        public ChangeLogParameter(String key, Object value, String validContexts, String labels, String validDatabases) {
            this(key, value, new ContextExpression(validContexts), new Labels(labels), StringUtils.splitAndTrim(validDatabases, ","));
        }
View Full Code Here


    private static final class TestSqlVisitor extends AbstractSqlVisitor {

        public TestSqlVisitor(final String... contexts) {
            setContexts(new ContextExpression(contexts));
        }
View Full Code Here

                   Boolean value = childNode.getValue(Boolean.class);
                   if (value != null) {
                       setApplyToRollback(value);
                   }
               } else if (childNode.getName().equals("context") || childNode.getName().equals("contexts")) {
                   setContexts(new ContextExpression((String) childNode.getValue()));
                } else  if (ObjectUtil.hasWriteProperty(this, childNode.getName())) {
                   Object value = childNode.getValue();
                   if (value != null) {
                       value = value.toString();
                   }
View Full Code Here

                throw new ChangeLogParseException("Could not find databaseChangeLog node");
            }
            for (Object obj : rootList) {
                if (obj instanceof Map && ((Map) obj).containsKey("property")) {
                    Map property = (Map) ((Map) obj).get("property");
                    ContextExpression context = new ContextExpression((String) property.get("context"));
                    Labels labels = new Labels((String) property.get("labels"));
                    if (property.containsKey("name")) {
                        Object value = property.get("value");
                        if (value != null) {
                            value = value.toString();
View Full Code Here

        this.filePath = filePath;
        this.alwaysRun = alwaysRun;
        this.runOnChange = runOnChange;
        this.runInTransaction = runInTransaction;
        this.objectQuotingStrategy = quotingStrategy;
        this.contexts = new ContextExpression(contextList);
        setDbms(dbmsList);
    }
View Full Code Here

    public void load(ParsedNode node, ResourceAccessor resourceAccessor) throws ParsedNodeException {
        this.id = node.getChildValue(null, "id", String.class);
        this.author = node.getChildValue(null, "author", String.class);
        this.alwaysRun  = node.getChildValue(null, "runAlways", node.getChildValue(null, "alwaysRun", false));
        this.runOnChange  = node.getChildValue(null, "runOnChange", false);
        this.contexts = new ContextExpression(node.getChildValue(null, "context", String.class));
        this.labels = new Labels(StringUtils.trimToNull(node.getChildValue(null, "labels", String.class)));
        setDbms(node.getChildValue(null, "dbms", String.class));
        this.runInTransaction  = node.getChildValue(null, "runInTransaction", true);
        this.comments = StringUtils.join(node.getChildren(null, "comment"), "\n", new StringUtils.StringUtilsFormatter() {
            @Override
View Full Code Here

            Set<String> dbms = new HashSet<String>();
            if (dbmsString != null) {
                dbms.addAll(StringUtils.splitAndTrim(dbmsString, ","));
            }
            ContextExpression context = null;
            if (contextString != null) {
                context = new ContextExpression(contextString);
            }

            Labels labels = null;
            if (labelsString != null) {
                labels = new Labels(labelsString);
View Full Code Here

TOP

Related Classes of liquibase.ContextExpression

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.