Examples of ListContains


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

public class ListContainsTestCase
        extends ValueComparatorTestCaseAbstract {

    // Javadoc inherited.
    protected ValueConstraint createConstraint(String value) {
        return new ListContains(value);
    }
View Full Code Here

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

    /**
     * Test that a value containing white space fails.
     */
    public void testWhitespaceValueFails() {
        try {
            new ListContains("a b");
            fail("Whitespace value not detected");
        } catch (IllegalArgumentException e) {
            assertEquals("Error message incorrect",
                         "value 'a b' contains whitespace",
                         e.getMessage());
View Full Code Here

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

    /**
     * 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.ListContains

    /**
     * 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.ListContains

    /**
     * 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.ListContains

    /**
     * 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.ListContains

    /**
     * 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

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

    /**
     * Test that a value that is a prefix of an item works.
     */
    public void testWordPrefix() {
        ValueConstraint constraint = new ListContains("bet");
        assertFalse("Prefix matched",
                    constraint.satisfied("alpha beta gamma"));
    }
View Full Code Here

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

    /**
     * Test that a value that is not in the list works.
     */
    public void testMismatchWord() {
        ValueConstraint constraint = new ListContains("epsilon");
        assertFalse("Mismatch word matched",
                    constraint.satisfied("alpha beta gamma"));
    }
View Full Code Here

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

    // Javadoc inherited.
    public void debug(DebugStylingWriter writer) {
        if (namespace == null && localName.equals("class")
                && constraint instanceof ListContains) {

            ListContains classConstraint = (ListContains) constraint;
            writer.print(".").print(classConstraint.getConstraintValue());
        } else if (namespace == null && localName.equals("class")
                && constraint instanceof Equals) {

            Equals equalsConstraint = (Equals) constraint;
            writer.print("#").print(equalsConstraint.getConstraintValue());
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.