Examples of ImageAttributes


Examples of com.volantis.mcs.protocols.ImageAttributes

     * Test writeImage with pane defined in the attributes
     */
    public void testWriteImageAttributePane() throws ProtocolException {
        privateSetUp();

        ImageAttributes ia = new ImageAttributes();
        ia.setStyles(StylesBuilder.getDeprecatedStyles());
        Pane outPane = new Pane(null);
        outPane.setName("MyPane");
        outPane.setDestinationArea(null);
        ia.setPane(outPane);
        ia.setAltText("AltText");
        ia.setSrc("http://www.images.com/test/test.jpg");
        ia.setLocalSrc(false);
        protocol.writeImage(ia);

        // Check the image tag and attributes
        Element nullElement = buffer.popElement();
        Element element = (Element) nullElement.getHead();
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

     * Test writeImage with pane defined in the page context
     */
    public void testWriteImageContextPane() throws ProtocolException {
        privateSetUp();

        ImageAttributes ia = new ImageAttributes();
        ia.setStyles(StylesBuilder.getDeprecatedStyles());
        Pane outPane = new Pane(null);
        outPane.setName("MyPane");

        outPane.setDestinationArea(null);
        pageContext.setCurrentPane(outPane);
        ia.setPane(null);
        ia.setAltText("AltText");
        ia.setSrc("http://www.images.com/test/test.jpg");
        ia.setLocalSrc(false);
        protocol.writeImage(ia);

        // Check the image tag and attributes
        Element nullElement = buffer.popElement();
        Element element = (Element) nullElement.getHead();
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

        privateSetUp();
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        // Initialise our protocol attributes with an id attribute.
        ImageAttributes attributes = new ImageAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
        attributes.setLocalSrc(true);
        attributes.setSrc("myImage.jpg");
        attributes.setAltText("Alternate Text");

        Pane outPane = new Pane(null);
        outPane.setName("MyPane");
        outPane.setDestinationArea(null);
        attributes.setPane(outPane);

        protocol.doImage(buffer, attributes);

        // valid src and alt generates <img src="url" alt="text" />
        Element root = buffer.getCurrentElement();
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

        buffer.initialise();

        String expected = "Alternate Text";

        // Initialise our protocol attributes with an id attribute.
        ImageAttributes attributes = new ImageAttributes();
        attributes.setLocalSrc(true);
        attributes.setSrc(null);
        attributes.setAltText(expected);

        Pane outPane = new Pane(null);
        outPane.setName("MyPane");
        outPane.setDestinationArea(null);
        attributes.setPane(outPane);

        protocol.doImage(buffer, attributes);

        // No src with alt text generates <span>text</span>
        Element root = buffer.getCurrentElement();
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

        privateSetUp();
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        // Initialise our protocol attributes with an id attribute.
        ImageAttributes attributes = new ImageAttributes();
        attributes.setLocalSrc(true);
        attributes.setSrc(null);
        attributes.setAltText("    ");

        Pane outPane = new Pane(null);
        outPane.setName("MyPane");
        outPane.setDestinationArea(null);
        attributes.setPane(outPane);

        protocol.doImage(buffer, attributes);

        // No src and whitespace text generates no output
        Element root = buffer.getCurrentElement();
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

     * Test the image element. If there is an AssetURLSuffix set then it should
     * be appended to the image URL.
     */
    public void testDoImageNoSuffix() throws ProtocolException {
        privateSetUp();
        ImageAttributes ia = new ImageAttributes();
        ia.setStyles(StylesBuilder.getDeprecatedStyles());
        Pane outPane = new Pane(null);
        outPane.setName("MyPane");
        outPane.setDestinationArea(null);
        ia.setPane(outPane);
        ia.setAltText("AltText");
        ia.setSrc("http://www.images.com/test/test.jpg");
        ia.setLocalSrc(false);
        protocol.writeImage(ia);

        // Check the image tag and attributes
        Element nullElement = buffer.popElement();
        Element element = (Element) nullElement.getHead();
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

        assertEquals("AltText", element.getAttributeValue("alt"));
    }

    public void testDoImageSuffix() throws ProtocolException {
        privateSetUp();
        ImageAttributes ia = new ImageAttributes();
        ia.setStyles(StylesBuilder.getDeprecatedStyles());
        Pane outPane = new Pane(null);
        outPane.setName("MyPane");
        outPane.setDestinationArea(null);
        ia.setPane(outPane);
        ia.setAltText("AltText");
        ia.setSrc("http://www.images.com/test/test.jpg");
        ia.setAssetURLSuffix("?name=fred");
        ia.setLocalSrc(false);
        protocol.writeImage(ia);

        // Check the image tag and attributes
        Element nullElement = buffer.popElement();
        Element element = (Element) nullElement.getHead();
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

        // Needed to allow the call to getTextFromReference within doImage to work
        context = new TestMarinerPageContext();

        protocol.setMarinerPageContext(context);

        ImageAttributes attrs = new ImageAttributes();
        attrs.setSrc("http://www.volantis.com/my_image.jpg");
        attrs.setLocalSrc(true);
        attrs.setAltText("my_alt_text");
        attrs.setWidth("10");
        attrs.setHeight("20");

        protocol.doImage(buffer, attrs);

        String expected = "<img alt=\"my_alt_text\" height=\"20\" " +
                "localsrc=\"http://www.volantis.com/my_image.jpg\" " +
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

        // this should be ignored - invalid.
        properties.setComputedValue(StylePropertyDetails.FONT_SIZE,
                FontSizeKeywords.SMALL);

        ImageAttributes imageAttributes = new ImageAttributes();
        imageAttributes.setSrc("images/background.jpg");
        imageAttributes.setAlign("middle");
        protocol.doImage(buffer, imageAttributes);

        verifyStyleVerticalAlignIMG(bufferToString(buffer));
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

        // Needed to allow the call to getTextFromReference within doImage to work
        context = new TestMarinerPageContext();

        protocol.setMarinerPageContext(context);

        ImageAttributes attrs = new ImageAttributes();
        attrs.setSrc("http://www.volantis.com/my_image.jpg");
        attrs.setLocalSrc(true);
        attrs.setAltText("my_alt_text");
        attrs.setWidth("10");
        attrs.setHeight("20");
        attrs.setBorder("5");

        protocol.doImage(buffer, attrs);

        String expected = "<img alt=\"my_alt_text\" " +
                "height=\"20\" src=\"http://www.volantis.com/my_image.jpg\" " +
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.