Package com.volantis.mcs.integration.transcoder

Examples of com.volantis.mcs.integration.transcoder.ICSWithoutGIF


     * Tests that when there is no aspect ratio width and height are not set
     * on the element.
     */
    public void testNoAspectRatio() throws Exception {
        TestMarinerRequestContext requestContext =
                createRequestContext(new ICSWithoutGIF(), "cj24", 250);

        // Create the urlc attribute for the image element implementation.
        ImageAttributes papiImageAttributes = new ImageAttributes();
        papiImageAttributes.
                setUrlc("http://www.volantis.com/myImage.jpg?myParam=56");
View Full Code Here


     * Tests that when there is an aspect ratio, width and height are set
     * on the element.
     */
    public void testAspectRatio() throws Exception {
        TestMarinerRequestContext requestContext =
                createRequestContext(new ICSWithoutGIF(), "cj24", 250);

        // Create the urlc attribute for the image element implementation.
        ImageAttributes papiImageAttributes = new ImageAttributes();
        papiImageAttributes.
                setUrlc("http://www.volantis.com/myImage.jpg?mcs.ar=5:4");
View Full Code Here

     * Tests that when there is an aspect ratio and an existing width and
     * height on the element, then these values are not overridden.
     */
    public void testAspectRatioNoOverwrite() throws Exception {
        TestMarinerRequestContext requestContext =
                createRequestContext(new ICSWithoutGIF(), "cj24", 250);

        // Create the urlc attribute for the image element implementation.
        ImageAttributes papiImageAttributes = new ImageAttributes();
        papiImageAttributes.
                setUrlc("http://www.volantis.com/myImage.jpg?mcs.ar=5:4");
View Full Code Here

     * Tests that when there is an aspect ratio parameter, it is removed from
     * the urlc.
     */
    public void testAspectRatioRemoval() throws Exception {
        final String rule = "cj24";
        final PluggableAssetTranscoder transcoder = new ICSWithoutGIF();
        final int width = 369;
        final String urlc = "http://www.volantis.com/myImage.jpg?mcs.ar=5:4";
        TestMarinerRequestContext requestContext =
                createRequestContext(transcoder, rule, width);

        // Create the urlc attribute for the image element implementation.
        ImageAttributes papiImageAttributes = new ImageAttributes();
        papiImageAttributes.setUrlc(urlc);

        // Create the image element implementation.
        ImageElementImpl element = new ImageElementImpl();

        // Generate the pane output for this image element.
        element.elementStartImpl(requestContext, papiImageAttributes);

        // Retrieve the image attributes so that the src can be checked for the
        // removal of the aspect ratio parameter.
        com.volantis.mcs.protocols.ImageAttributes protocolImageAttributes =
                (com.volantis.mcs.protocols.ImageAttributes)
                PrivateAccessor.getField(element, "pattributes");

        final String urlcNoAspectRatio = protocolImageAttributes.getSrc();
        assertEquals("There should be no ratio parameter",
                "http://www.volantis.com/" + rule + "/myImage.jpg?" +
                transcoder.getWidthParameter() + "=" + width,
                urlcNoAspectRatio);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.integration.transcoder.ICSWithoutGIF

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.