Package com.volantis.mcs.expression.functions.diselect

Examples of com.volantis.mcs.expression.functions.diselect.DILengthFunction


     * pixels, actual length in millimetres, usable length in pixels
     */
    public abstract String[] getPolicyNames();

    public void testConvertLengthFromMMWithInvalidUnit() {
        DILengthFunction function = getFunction();
        try {
            function.convertLengthFromMm(10, "mmm");
            fail("Attempting to convert a length when the specified unit is " +
                    "invalid should cause an exception to be thrown");
        } catch(IllegalArgumentException e) {
            // do nothing, correct behaviour
        }
View Full Code Here


            // do nothing, correct behaviour
        }
    }

    public void testConvertLengthFromMMWithValidUnits() {
        DILengthFunction function = getFunction();

        final double lengthInMm = 15;
        final double lengthInCm = 15 * 0.1;
        final double lengthInIn = 15 * 0.0393701;
        final double lengthInPt = 15 * 2.845358;
        final double lengthInPc = 15 * 0.2371132;

        double result = function.convertLengthFromMm(lengthInMm,
                DILengthFunction.MM);
        assertTrue(lengthInMm == result);

        result = function.convertLengthFromMm(lengthInMm,
                DILengthFunction.CM);
        assertTrue(lengthInCm == result);

        result = function.convertLengthFromMm(lengthInMm,
                DILengthFunction.IN);
        assertTrue(lengthInIn == result);

        result = function.convertLengthFromMm(lengthInMm,
                DILengthFunction.PT);
        assertTrue(lengthInPt == result);

        result = function.convertLengthFromMm(lengthInMm,
                DILengthFunction.PC);
        assertTrue(lengthInPc == result);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.expression.functions.diselect.DILengthFunction

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.