Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Element


            protocol.setMarinerPageContext(mpc);
            testable.setSupportsAccessKeyAttribute(values.supportsAccessKeys);
            //@todo need to reenable this check?
            //assertEquals(protocol.supportsAccessKeyAttribute(), values.supportsAccessKeys);

            Element result = protocol.openAction(buffer,
                                                 values.attributes,
                                                 values.inline);
            assertNotNull("Result should not be null", result);
            try {
                String actual = DOMUtilities.toString(result, protocol.getCharacterEncoder());
View Full Code Here


       attributes.setName("URL");

       protocol.doMeta(buffer, attributes);

       // Check the meta tag and attributes
       Element nullElement = buffer.popElement();
       Element element = (Element) nullElement.getHead();

       // We need to get the content string from the buffer as it
       // isn't encoded in the element.
       String result = bufferToString(buffer);
       int start = result.indexOf("content");
       int end = result.indexOf("ing\"", start);
       assertEquals("content=\"Test & encoding\"", result.substring(start, end + 4));
       // For WML, there may be more than one meta generated, hence this loop.
       do {
           assertEquals("meta", element.getName());
           if(element.getAttributeValue("http-equiv") != null) {
               assertEquals("refresh", element.getAttributeValue("http-equiv"));
           }
           if(element.getAttributeValue("name") != null) {
               assertEquals("URL", element.getAttributeValue("name"));
           }
       } while((element = (Element) element.getNext()) != null);

    }
View Full Code Here

        }

        attributes.setStyles(StylesBuilder.getCompleteStyles(
                css));

        Element element = domFactory.createElement("input");
        protocol.addTextInputValidation(element, attributes);

        String output = helper.render(element);
        String expectedMarkup = "<input";
        if (expectedEmptyOk != null) {
View Full Code Here

        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 );
        assertEquals("Image element should exist", "img", el.getName());
        assertEquals("Incorrect src attribute",
                "http://www.images.com/test/image.jpg", el.getAttributeValue("src"));
    }
View Full Code Here

        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 );
        assertEquals("Image element should exist", "img", el.getName());
        assertEquals("Incorrect src attribute",
                "http://www.images.com/test/image.jpg?name=fred",
                el.getAttributeValue("src"));
    }
View Full Code Here

        return "text/vnd.wap.wml";
    }

    protected void checkRenderAltText(String altText, DOMOutputBuffer buffer) {
        // WML just adds the text in without a containing tag.
        Element root = buffer.getCurrentElement();
        checkTextEquals(altText, root.getHead());
    }
View Full Code Here

        attributes.setAltText("Alternate Text");

        protocol.doImage(buffer, attributes);
       
        // valid src and alt generates <img src="url" alt="text" />
        Element root = buffer.getCurrentElement();
        Element element = (Element) root.getHead();

        DOMAssertionUtilities.assertElement("img", element);
        DOMAssertionUtilities.assertAttributeEquals("localsrc","myImage.jpg",element);
        DOMAssertionUtilities.assertAttributeEquals("alt","Alternate Text",element);
    }
View Full Code Here

        attributes.setAltText(expected);

        protocol.doImage(buffer, attributes);
       
        // No src with alt text generates <span>text</span>
        Element root = buffer.getCurrentElement();
        Text altText = (Text)root.getHead();
        String txtAltText = new String(altText.getContents(),
                0, expected.length());
        assertEquals("Incorrect Text", expected, txtAltText);
    }
View Full Code Here

        attributes.setAltText("    ");

        protocol.doImage(buffer, attributes);
       
        // No src and whitespace text generates no output
        Element root = buffer.getCurrentElement();
        Element empty = (Element) root.getHead();
        assertNull("No output should be generated", empty);
    }
View Full Code Here

        attributes.setStyles(StylesBuilder.getDeprecatedStyles());

        attributes.setFormat(new Form(new CanvasLayout()));
        buffer.addStyledElement("table", attributes);
        protocol.openGrid(buffer, attributes);
        Element e = buffer.getCurrentElement();
        assertNull(e.getAttributeValue("columns"));
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom.Element

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.