Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.XFImplicitAttributes


        TestMarinerPageContext context = new TestMarinerPageContext();
        protocol.setMarinerPageContext(context);

        XMLReader reader = DOMUtilities.getReader();

        XFImplicitAttributes attributes = new XFImplicitAttributes();
        final String xfName = "xfImplicitAtributesName";
        final String xfValue = "xfImplicitAtributesValue";
        attributes.setName(xfName);
        attributes.setValue(xfValue);

        XFFormAttributes formAttributes = new XFFormAttributes();
        String name = "This is the name";
        formAttributes.setName(name);
        Form form = new Form(new CanvasLayout());
        FormInstance formInstance = new FormInstance(
                NDimensionalIndex.ZERO_DIMENSIONS);
        formInstance.setFormat(form);

        formAttributes.setFormData(formInstance);
        attributes.setFormAttributes(formAttributes);
        attributes.setFormData(formInstance);

        protocol.doImplicitValue(attributes);

        String actual = DOMUtilities.toString(
                buffer.getRoot(), protocol.getCharacterEncoder());
View Full Code Here


    /**
     * Test getXFImplicitAttributesValue with no attributes
     */
    public void testGetXFImplicitAttributesValueNoAttributes() {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        assertNull("should be null when value and clientVariableName not supplied",
                protocol.getXFImplicitAttributesValue(attributes));
    }
View Full Code Here

    /**
     * Test getXFImplicitAttributesValue with just a value attribute
     */
    public void testGetXFImplicitAttributesValueValueAttribute() {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        // Test just value set
        attributes.setValue("value");
        assertEquals("wrong value returned", "value",
                protocol.getXFImplicitAttributesValue(attributes));
    }
View Full Code Here

    /**
     * Test getXFImplicitAttributesValue with just clientVariableName
     */
    public void testGetXFImplicitAttributesValueClientVariableName() {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        // Test just clientVariableName set
        attributes.setClientVariableName("clientVariableName");
        assertEquals("wrong clientVariableName returned",
                WMLVariable.WMLV_NOBRACKETS + "clientVariableName" +
                WMLVariable.WMLV_NOBRACKETS,
                protocol.getXFImplicitAttributesValue(attributes));
    }
View Full Code Here

     * Test getXFImplicitAttributesValue with both clientVariableName
     * and value attributes
     */
    public void testGetXFImplicitAttributesValueBothAttributes() {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        // Test that clientVariableName takes precedence over value
        attributes.setClientVariableName("clientVariableName");
        attributes.setValue("value");
        assertEquals("wrong clientVariableName returned",
                WMLVariable.WMLV_NOBRACKETS + "clientVariableName" +
                WMLVariable.WMLV_NOBRACKETS,
                protocol.getXFImplicitAttributesValue(attributes));
    }
View Full Code Here

     * Test addPostField puts the correct element in the output buffer when
     * we pass it no XFImplicit attributes.
     */
    public void testAddPostFieldNoAttributes() throws Exception {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        // Test with no attributes
        protocol.addPostField(buffer, attributes);
    }
View Full Code Here

     * Test addPostField puts the correct element in the output buffer when
     * we pass it just a value in the XFImplicit attributes.
     */
    public void testAddPostFieldValueAttributes() throws Exception {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        buffer = new TestDOMOutputBuffer();
        document = domFactory.createDocument();

        attributes.setName("name");
        attributes.setValue("value");
        protocol.addPostField(buffer, attributes);
        document.addNode(buffer.getRoot());
        String output = DOMUtilities.toString(
                document, protocol.getCharacterEncoder());
        assertEquals("Wrong output in postfield element",
View Full Code Here

     * Test addPostField puts the correct element in the output buffer when
     * we pass it just a clientVariableName XFImplicit attributes.
     */
    public void testAddPostFieldClientVariableName() throws Exception {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        buffer = new TestDOMOutputBuffer();
        document = domFactory.createDocument();

        attributes.setName("name");
        attributes.setClientVariableName("clientVariableName");
        protocol.addPostField(buffer, attributes);

        document.addNode(buffer.getRoot());
        String output = DOMUtilities.toString(
                document, protocol.getCharacterEncoder());
View Full Code Here

     * we pass it clientVariableName and value XFImplicit attributes.
     */
    public void testAddPostFieldClientVariableNameAndValueAttributes()
             throws Exception {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        // Test that clientVariableName takes precedence over value
        buffer = new TestDOMOutputBuffer();
        document = domFactory.createDocument();

        attributes.setName("name");
        attributes.setValue("value");
        attributes.setClientVariableName("clientVariableName");
        protocol.addPostField(buffer, attributes);

        document.addNode(buffer.getRoot());
        String output = DOMUtilities.toString(
                document, protocol.getCharacterEncoder());
View Full Code Here

     * Test addPostField puts the correct element in the output buffer when
     * we pass it just a clientVariableName XFImplicit attributes.
     */
    public void testAddPostFieldClientVariableName() throws Exception {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        buffer = new TestDOMOutputBuffer();
        buffer.initialise();
        document = domFactory.createDocument();

        attributes.setName("name");
        attributes.setClientVariableName("clientVariableName");
        protocol.addPostField(buffer, attributes);

        document.addNode(buffer.getRoot());
        String output = DOMUtilities.toString(
                document, protocol.getCharacterEncoder());
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.XFImplicitAttributes

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.