Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.XFActionAttributes


     */
    protected void checkActionInputType() throws ProtocolException {

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();
        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        // Setup test for normal behaviour for input tag generation (submit)
        String name = "My Name";
        String actionType = "submit";
        String caption = "This is my caption";
        String value = "This is my value";

        attributes.setName(name);
        attributes.setType(actionType);
        attributes.setCaption(new LiteralTextAssetReference(caption));
        attributes.setValue(value);

        protocol.doActionInput(buffer, attributes);
        String actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
                     "<input name=\"" + name + "\" " +
                     "type=\"" + actionType + "\" value=\"" + caption  + "\"/>",
                     actualResult);

        // Setup test for normal behaviour for input tag generation (perform)
        buffer = new DOMOutputBuffer();
        buffer.initialise();
        actionType = "perform";
        attributes.setType(actionType);

        protocol.doActionInput(buffer, attributes);
        actualResult = bufferToString(buffer);

        assertEquals("DOM buffer should match",
                     "<input name=\"" + name + "\" " +
                     "type=\"" + "submit" + "\" value=\"" + caption  + "\"/>",
                     actualResult);

        // Setup test for normal behaviour for input tag generation (perform)
        buffer = new DOMOutputBuffer();
        buffer.initialise();
        actionType = "reset";
        attributes.setType(actionType);
        protocol.doActionInput(buffer, attributes);
        actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
                     "<input name=\"" + name + "\" " +
                     "type=\"" + actionType + "\" value=\"" + caption  + "\"/>",
                     actualResult);

        // Setup test for abnormal behaviour - garbage actionType
        buffer = new DOMOutputBuffer();
        buffer.initialise();
        actionType = "GARBAGE";
        attributes.setType(actionType);
        try {
            protocol.doActionInput(buffer, attributes);
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }

        // Setup test for abnormal behaviour - garbage actionType
        buffer = new DOMOutputBuffer();
        buffer.initialise();
        actionType = "submit";
        attributes.setType(actionType);
        attributes.setTabindex("1");
        protocol.doActionInput(buffer, attributes);
        assertTrue(protocol.supportsTabindex);
        actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
                     "<input name=\"" + name + "\" " +
View Full Code Here


        String value = "This is my value";

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

        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        attributes.setName(name);
        attributes.setType(actionType);
        attributes.setCaption(new LiteralTextAssetReference(caption));
        attributes.setValue(value);
        // todo XDIME-CP style forms correctly.
//        attributes.setStyleClass(style);

        // Setup test to ensure that link style form submision fallsback to the
        // default form submision
View Full Code Here

     */
    protected void checkActionInputType() throws ProtocolException {

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();
        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        // Setup test for normal behaviour for input tag generation (submit)
        String name = "My Name";
        String actionType = "submit";
        String caption = "This is my caption";
        String value = "This is my value";

        attributes.setName(name);
        attributes.setType(actionType);
        attributes.setCaption(new LiteralTextAssetReference(caption));
        attributes.setValue(value);

        protocol.doActionInput(buffer, attributes);
        String actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
                "<input name=\"" + name + "\" type=\"submit\" "+
                "value=\"" + caption + "\"/>", actualResult);

        // Setup test for normal behaviour for input tag generation (perform)
        buffer = new DOMOutputBuffer();
        buffer.initialise();
        actionType = "perform";
        attributes.setType(actionType);       
        protocol.doActionInput(buffer, attributes);
        actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
                "<input name=\"" + name + "\" " +
                "type=\"submit\" value=\"" + caption  + "\"/>",
                actualResult);

        // Setup test for normal behaviour for input tag generation (perform)
        buffer = new DOMOutputBuffer();
        buffer.initialise();
        actionType = "reset";
        attributes.setType(actionType);
        protocol.doActionInput(buffer, attributes);
        actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
                "<input name=\"" + name + "\" " +
                "type=\"reset\" value=\"" + caption  + "\"/>",
                actualResult);

        // Setup test for abnormal behaviour - garbage actionType
        buffer = new DOMOutputBuffer();
        buffer.initialise();
        actionType = "GARBAGE";
        attributes.setType(actionType);
        try {
            protocol.doActionInput(buffer, attributes);
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }

        // Setup test for abnormal behaviour - garbage actionType
        buffer = new DOMOutputBuffer();
        buffer.initialise();
        actionType = "submit";
        attributes.setType(actionType);
        attributes.setTabindex("1");
        protocol.doActionInput(buffer, attributes);
        assertTrue(protocol.supportsTabindex);
        actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
                "<input name=\"" + name + "\" " +
View Full Code Here

        String value = "This is my value";

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

        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        attributes.setName(name);
        attributes.setType(actionType);
        attributes.setCaption(new LiteralTextAssetReference(caption));
        attributes.setValue(value);
        // todo XDIME-CP style forms correctly.
//        attributes.setStyleClass(style);

        // Setup test to ensure that link style form submision fallsback to the
        // default form submision
View Full Code Here

    protected void checkActionInputShortcut() throws ProtocolException {

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();
        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        // Setup test for normal behaviour for input tag generation (submit)
        String shortcut = "1";
        String name = "My Name";
        String actionType = "submit";
        String caption = "This is my caption";
//        String value = "This is my value";

        attributes.setShortcut(new LiteralTextAssetReference(shortcut));
        attributes.setName(name);
        attributes.setType(actionType);
        attributes.setCaption(new LiteralTextAssetReference(caption));
//        attributes.setValue(value);

        protocol.doActionInput(buffer, attributes);
        String actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
View Full Code Here

    protected void checkActionInputShortcut(boolean generated,
            boolean styled) throws ProtocolException {

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();
        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        // Setup test for normal behaviour for input tag generation (submit)
        String shortcut = "1";
        String name = "My Name";
        String actionType = "submit";
        String caption = "This is my caption";
        //String value = "This is my value";

        attributes.setShortcut(new LiteralTextAssetReference(shortcut));
        attributes.setName(name);
        attributes.setType(actionType);
        attributes.setCaption(new LiteralTextAssetReference(caption));
        //attributes.setValue(value);

        protocol.doActionInput(buffer, attributes);
        String actualResult = bufferToString(buffer);
        assertEquals("DOM buffer should match",
View Full Code Here

                   String expected) {

                this.inline = inline;
                this.supportsAccessKeys = supportsAccessKeys;
                this.expected = expected;
                attributes = new XFActionAttributes();
                attributes.setStyles(StylesBuilder.getInitialValueStyles());
                attributes.setShortcut(new LiteralTextAssetReference(shortcut));
                attributes.setCaption(new LiteralTextAssetReference(caption));
                attributes.setTitle(title);
            }
View Full Code Here

                   String expected) {

                this.inline = inline;
                this.supportsAccessKeys = supportsAccessKeys;
                this.expected = expected;
                attributes = new XFActionAttributes();
                attributes.setStyles(StylesBuilder.getInitialValueStyles());
                attributes.setShortcut(new LiteralTextAssetReference(shortcut));
                attributes.setCaption(new LiteralTextAssetReference(caption));
                attributes.setTitle(title);
            }
View Full Code Here

    protected void doTestAddActionReset(String expected,
                                        XFTextInputAttributes field)
            throws Exception {
        privateSetUp();
        XFActionAttributes attributes = new XFActionAttributes();
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        XFFormAttributes formAttributes = new XFFormAttributes();
        attributes.setFormAttributes(formAttributes);

        if (field != null) {
            formAttributes.addField(field);
        }
View Full Code Here

    }

    public void testAddActionResetFormAttributesInitialValueValid() throws Exception {
        privateSetUp();

        XFActionAttributes attributes = new XFActionAttributes();;
        attributes.setStyles(StylesBuilder.getInitialValueStyles());

        XFFormAttributes formAttributes = new XFFormAttributes();
        attributes.setFormAttributes(formAttributes);

        XFTextInputAttributes field = new XFTextInputAttributes();
        field.setInitial("InitialValue");
        field.setName("Name");
        field.setEntryContainerInstance(new PaneInstance(null));
View Full Code Here

TOP

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

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.