Examples of ImageAttributes


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\" " +
        "src=\"http://www.volantis.com/my_image.jpg\" width=\"10\"/>";
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

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

        // Initialise our protocol attributes with an id attribute.
        String idValue = "the identifier value";
        ImageAttributes attributes = new ImageAttributes();
        attributes.setId(idValue);
        attributes.setSrc("required");

        // Create the expected value for the name attribute output.
        String expectedNameValue = null;
        if (protocol.enableNameIdentification) {
            expectedNameValue = idValue;
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

        privateSetUp();
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();
       
        ImageAttributes attrs = new ImageAttributes();
        attrs.setStyles(StylesBuilder.getInitialValueStyles());

        attrs.setSrc("http://www.images.com/test/image.jpg");
        protocol.doImage(buffer,attrs);

        Element root = buffer.getCurrentElement();
        Element el = (Element) root.getHead();
        assertNotNull("Image element should exist.", el );
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

        privateSetUp();
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();
       
        ImageAttributes attrs = new ImageAttributes();
        attrs.setStyles(StylesBuilder.getInitialValueStyles());

        attrs.setSrc("http://www.images.com/test/image.jpg");
        attrs.setAssetURLSuffix("?name=fred");
        protocol.doImage(buffer,attrs);

        Element root = buffer.getCurrentElement();
        Element el = (Element) root.getHead();
        assertNotNull("Image element should exist.", el );
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.getInitialValueStyles());

        attributes.setLocalSrc(true);
        attributes.setSrc("myImage.jpg");
        attributes.setAltText("Alternate Text");

        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);

        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("    ");

        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

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

        protocol.setMarinerPageContext(context);

        ImageAttributes attrs = new ImageAttributes();
        attrs.setStyles(StylesBuilder.getInitialValueStyles());
        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\" border=\"5\" " +
                "height=\"20\" src=\"http://www.volantis.com/my_image.jpg\" " +
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);

        protocol.doImage(buffer, attributes);

        // No src with alt text generates text as there is currently no support
        // for <span> in HDML.
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

     * Test writeImage with no pane defined
     */
    public void testWriteImageNoPane() {
        privateSetUp();

        ImageAttributes ia = new ImageAttributes();
        ia.setPane(null);
        ia.setAlign("left");
        ia.setAltText("AltText");
        ia.setBorder("1");
        ia.setSrc("http://www.images.com/test/test.jpg");
        try {
            protocol.writeImage(ia);
            fail("Should have thrown illegal argument exception.");
        } catch (IllegalArgumentException iae) {
            // Expected as neither the attributes or page context
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.