Examples of JDOMFactory


Examples of org.jdom.input.JDOMFactory

public class AttributesMessageFormatterTestCase extends TestCaseAbstract {
    /**
     * Test format with just attributes.
     */
    public void testFormatAttributes() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("device", "PC");
        attributes.add(attr);
        attr = factory.attribute("pixelsX", "100");
        attributes.add(attr);
        attr = factory.attribute("pixelsY", "200");
        attributes.add(attr);
        attr = factory.attribute("pixelDepth", "24");
        attributes.add(attr);
        attr = factory.attribute("rendering", "color");
        attributes.add(attr);

        String message = "{value}, {element}, {assetGroup}, {device}, " +
                "{rendering}, {pixelDepth}bits, {pixelsX}x{pixelsY}px, " +
                "{widthHint}";
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test format with attributes and an element.
     */
    public void testFormatAttributesAndElement() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("device", "PC");
        attributes.add(attr);
        attr = factory.attribute("pixelsX", "100");
        attributes.add(attr);
        attr = factory.attribute("pixelsY", "200");
        attributes.add(attr);
        attr = factory.attribute("pixelDepth", "24");
        attributes.add(attr);
        attr = factory.attribute("rendering", "color");
        attributes.add(attr);

        String message = "{value}, {element}, {assetGroup}, {device}, " +
                "{rendering}, {pixelDepth}bits, {pixelsX}x{pixelsY}px, " +
                "{widthHint}";
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test the removal of 'px' if no value for pixels and there is a previous
     * non-empty value in the list.
     */
    public void testFormatAttributesNoOtherElements() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("pixelsX", "100");
        attributes.add(attr);

        String message = "{pixelDepth}bits, {pixelsX}x{pixelsY}px";

        PolicyAttributesDetails details =
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test the removal of 'px' if no value for pixels and there is a previous
     * non-empty value in the list.
     */
    public void testFormatAttributesEndWithX() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("pixelDepth", "24");
        attributes.add(attr);
        attr = factory.attribute("pixelsX", "100");
        attributes.add(attr);

        String message = "{pixelDepth}bits,  {pixelsX}x{pixelsY}px  and that is the end";

        PolicyAttributesDetails details =
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test the removal of 'px' if no value for pixels and there is NO previous
     * non-empty value in the list.
     */
    public void testFormatAttributesNoElements() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("pixelDepth", "24");
        attributes.add(attr);

        String message = "{pixelsX}x{pixelsY}px";

        PolicyAttributesDetails details =
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test the removal of 'px' if no value for pixels and there is spaces and
     * commas.
     */
    public void testFormatAttributesCommasSpaces() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("pixelDepth", "24");
        attributes.add(attr);
        attr = factory.attribute("pixelsY", "100");
        attributes.add(attr);

        String message = "{pixelDepth}bits , {pixelsX}x{pixelsY}px";

        PolicyAttributesDetails details =
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test the missing first bracket (or char) if no value present.
     */
    public void testFormatAttributesMissingGridOpenBracket() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("rows", "1");
        attributes.add(attr);
        attr = factory.attribute("columns", "2");
        attributes.add(attr);

        String message = "{element}: ''{name}'' ({rows}x{columns})";

        PolicyAttributesDetails details =
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test the missing first bracket (or char) if value present.
     */
    public void testFormatAttributesGridOpenBracket() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("name", "name");
        attributes.add(attr);
        attr = factory.attribute("rows", "1");
        attributes.add(attr);
        attr = factory.attribute("columns", "2");
        attributes.add(attr);

        String message = "{element}: ''{name}'' ({rows}x{columns})";

        PolicyAttributesDetails details =
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    public void testSetProxiedElementsReasons() {
        PolicyProxyElementDetails details =
                new PolicyProxyElementDetails("imageComponent");
        ProxyElementDetails.ChangeReason reason =
                ProxyElementDetails.ATTRIBUTES;
        JDOMFactory factory = new DefaultJDOMFactory();
        ArrayList elements = new ArrayList();
        Element element = factory.element("deviceImageAsset");
        elements.add(element);

        assertFalse("Should be false with an ATTRIBUTES reason.",
                details.setProxiedElements(elements.iterator(), reason));
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    public void testSetProxiedElementsNoChange() {
        PolicyProxyElementDetails details =
                new PolicyProxyElementDetails("imageComponent");
        ProxyElementDetails.ChangeReason reason =
                ProxyElementDetails.ELEMENTS;
        JDOMFactory factory = new DefaultJDOMFactory();
        ArrayList elements = new ArrayList();
        elements.add(factory.element(ODOMElement.NULL_ELEMENT_NAME));

        assertFalse("Should be false since the first time " +
                "setProxiedElements is called, element should be \"" +
                ODOMElement.NULL_ELEMENT_NAME + "\".",
                details.setProxiedElements(elements.iterator(), reason));
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.