Examples of ValueConstraint


Examples of com.sun.appserv.web.cache.mapping.ValueConstraint

            for (int j = 0; j < fieldConfig.sizeValue(); j++) {
                value = fieldConfig.getValue(j).trim();
                expr = fieldConfig.getAttributeValue(
                    com.sun.enterprise.deployment.runtime.web.ConstraintField.VALUE, j, com.sun.enterprise.deployment.runtime.web.ConstraintField.MATCH_EXPR);
               
                ValueConstraint constraint = new ValueConstraint(value, expr);
                value = fieldConfig.getAttributeValue(com.sun.enterprise.deployment.runtime.web.ConstraintField.VALUE, j, com.sun.enterprise.deployment.runtime.web.ConstraintField.CACHE_ON_MATCH);
                if (value != null) {
                    constraint.setCacheOnMatch(ConfigBean.toBoolean(value));
                }
                value = fieldConfig.getAttributeValue(com.sun.enterprise.deployment.runtime.web.ConstraintField.VALUE, j, com.sun.enterprise.deployment.runtime.web.ConstraintField.CACHE_ON_MATCH_FAILURE);
                if (value != null) {
                    constraint.setCacheOnMatchFailure(
                                    ConfigBean.toBoolean(value));
                }
                constraintField.addConstraint(constraint);

                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("added a constraint: " + constraint.toString());
                }
            }

            mapping.addConstraintField(constraintField);
View Full Code Here

Examples of com.sun.appserv.web.cache.mapping.ValueConstraint

            for (int j = 0; j < fieldConfig.sizeValue(); j++) {
                value = fieldConfig.getValue(j).trim();
                expr = fieldConfig.getAttributeValue(
                        org.glassfish.web.deployment.runtime.ConstraintField.VALUE, j, org.glassfish.web.deployment.runtime.ConstraintField.MATCH_EXPR);
               
                ValueConstraint constraint = new ValueConstraint(value, expr);
                value = fieldConfig.getAttributeValue(org.glassfish.web.deployment.runtime.ConstraintField.VALUE, j, org.glassfish.web.deployment.runtime.ConstraintField.CACHE_ON_MATCH);
                if (value != null) {
                    constraint.setCacheOnMatch(ConfigBeansUtilities.toBoolean(value));
                }
                value = fieldConfig.getAttributeValue(org.glassfish.web.deployment.runtime.ConstraintField.VALUE, j, org.glassfish.web.deployment.runtime.ConstraintField.CACHE_ON_MATCH_FAILURE);
                if (value != null) {
                    constraint.setCacheOnMatchFailure(
                                    ConfigBeansUtilities.toBoolean(value));
                }
                constraintField.addConstraint(constraint);

                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE, CONSTRAINT_ADDED, constraint.toString());
                }
            }

            mapping.addConstraintField(constraintField);
View Full Code Here

Examples of com.volantis.styling.impl.engine.matchers.constraints.ValueConstraint

    /**
     * Test that it matches the prefix of a language code.
     */
    public void testMatchesLanguagePrefix() {
        ValueConstraint constraint = createConstraint("abc");
        assertTrue("Language string did not match",
                constraint.satisfied("abc"));
        assertTrue("Language string did not match",
                   constraint.satisfied("abc-"));
        assertTrue("Language string did not match",
                constraint.satisfied("abc-def"));
        assertFalse("Language string should not match",
                constraint.satisfied("abcdef"));
        assertFalse("Language string should not match",
                constraint.satisfied("ab"));
        assertFalse("Language string should not match",
                constraint.satisfied(""));
    }
View Full Code Here

Examples of com.volantis.styling.impl.engine.matchers.constraints.ValueConstraint

    /**
     * Test that a null local name fails.
     */
    public void testNullLocalNameFails() {
        try {
            ValueConstraint constraint = new ValueConstraintMock(
                    "constraintMock", expectations);
            new AttributeMatcher(null, null, constraint);
            fail("Null localName not detected");
        } catch (IllegalArgumentException e) {
            assertEquals("Error message incorrect",
View Full Code Here

Examples of com.volantis.styling.impl.engine.matchers.constraints.ValueConstraint

    /**
     * Test that it matches the prefix of a long language code.
     */
    public void testMatchesLongLanguagePrefix() {
        ValueConstraint constraint = createConstraint("abc-xyz");
        assertTrue("Language string did not match",
                constraint.satisfied("abc-xyz"));
        assertTrue("Language string did not match",
                constraint.satisfied("abc-xyz-"));
        assertTrue("Language string did not match",
                   constraint.satisfied("abc-xyz-qrs"));
        assertFalse("Language string should not match",
                constraint.satisfied("abc-xyzqrs"));
        assertFalse("Language string should not match",
                constraint.satisfied("abc-x"));
        assertFalse("Language string should not match",
                constraint.satisfied("abc-"));
        assertFalse("Language string should not match",
                constraint.satisfied("ab"));
        assertFalse("Language string should not match",
                constraint.satisfied(""));
    }
View Full Code Here

Examples of com.volantis.styling.impl.engine.matchers.constraints.ValueConstraint

    /**
     * Test that a value that is the only word in the list succeeds.
     */
    public void testOnlyWord() {
        ValueConstraint constraint = new ListContains("alpha");
        assertTrue("Only word did not match",
                   constraint.satisfied("alpha"));
    }
View Full Code Here

Examples of com.volantis.styling.impl.engine.matchers.constraints.ValueConstraint

    /**
     * Test that a value that is the first word in the list succeeds.
     */
    public void testFirstWord() {
        ValueConstraint constraint = new ListContains("alpha");
        assertTrue("First word did not match",
                   constraint.satisfied("alpha beta gamma"));
    }
View Full Code Here

Examples of com.volantis.styling.impl.engine.matchers.constraints.ValueConstraint

    /**
     * Test that a value that is the middle word in the list succeeds.
     */
    public void testMiddleWord() {
        ValueConstraint constraint = new ListContains("beta");
        assertTrue("Middle word did not match",
                   constraint.satisfied("alpha beta gamma"));
    }
View Full Code Here

Examples of com.volantis.styling.impl.engine.matchers.constraints.ValueConstraint

    /**
     * Test that a value that is the last word in the list succeeds.
     */
    public void testLastWord() {
        ValueConstraint constraint = new ListContains("gamma");
        assertTrue("Last word did not match",
                   constraint.satisfied("alpha beta gamma"));
    }
View Full Code Here

Examples of com.volantis.styling.impl.engine.matchers.constraints.ValueConstraint

    /**
     * Test that a value that is a suffix of an item works.
     */
    public void testWordSuffix() {
        ValueConstraint constraint = new ListContains("eta");
        assertFalse("Suffix matched",
                    constraint.satisfied("alpha beta gamma"));
    }
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.