Examples of LiteralScriptAssetReference


Examples of com.volantis.mcs.protocols.assets.implementation.LiteralScriptAssetReference

     */
    public void testAddEventAttributeUserScript() throws ProtocolException {
        Element element = domFactory.createElement();
        String attributeName = "event";
        ScriptAssetReference userScript =
                new LiteralScriptAssetReference("userscript");
        String internalScript = null;
        protocol.addEventAttribute(element, attributeName, userScript,
                internalScript);
        String attributeValue = element.getAttributeValue(attributeName);
        assertEquals("script attribute", userScript.getScript(), attributeValue);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralScriptAssetReference

                     "",
                     DOMUtilities.toString(
                             buffer.getRoot(), protocol.getCharacterEncoder()));

        Script script = DOMScript.createScript(
                new LiteralScriptAssetReference("task"));
        protocol.addOnEventElement(buffer, attributes, "testEvent", script);
        String expected = transformMarkup(
                "<onevent type=\"testEvent\">task</onevent>",
                protocol);
        assertEquals("Buffer should as",
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralScriptAssetReference

        EventType click = EventType.ON_CLICK;
        EventType mouse = EventType.ON_MOUSE_OVER;
        EventType focus = EventType.ON_FOCUS;

        ScriptAssetReference handlerOne =
                new LiteralScriptAssetReference("Handle blurrred things");
        ScriptAssetReference handlerTwo =
                new LiteralScriptAssetReference("Handle clicked things");
        ScriptAssetReference handlerThree =
                new LiteralScriptAssetReference("Handle mouse over things");
        ScriptAssetReference handlerFour =
                new LiteralScriptAssetReference("Handle focus things");

        Object handler;

        // Test retrieval with nothing set
        handler = item.getEventHandler(blur);
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralScriptAssetReference

        EventType blur = EventType.ON_BLUR;
        EventType click = EventType.ON_CLICK;
        EventType mouse = EventType.ON_MOUSE_OVER;

        ScriptAssetReference handlerOne =
                new LiteralScriptAssetReference("Handle blurrred things");
        ScriptAssetReference handlerTwo =
                new LiteralScriptAssetReference("Handle clicked things");
        ScriptAssetReference handlerThree =
                new LiteralScriptAssetReference("Handle mouse over things");

        Object handler;

        // Test retrieval with nothing set
        handler = item.getEventHandler(blur);
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralScriptAssetReference

                        (PolicyReferenceResolverMock)
                        pageContext.getPolicyReferenceResolver();

                referenceResolverMock.expects
                        .resolveQuotedScriptExpression("onclick")
                        .returns(new LiteralScriptAssetReference("onclick"))
                        .any();

                element.elementStart(pageContext.getRequestContext(),
                                     getAttributes());
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralScriptAssetReference

     *
     * @return the script value.
     */
    ScriptAssetReference getDefaultScriptValue() {
        // a normal script treats values as text, so doesn't really matter.
        return new LiteralScriptAssetReference("a script");
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralScriptAssetReference

       
        Script script2 = createScript(context, scriptObject);
        assertEquals(script, script2);
       
        Script script3 = createScript(context,
                new LiteralScriptAssetReference("another script"));
        assertNotEquals(script,script3);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralScriptAssetReference

    // Inherit Javadoc.
    ScriptAssetReference getDefaultScriptValue() {
        // a DOMScript parses content as XML, so lets give it a bit of a
        // workout by providing some XML content to parse.
        return new LiteralScriptAssetReference(
                "<tag>content<empty/>more content</tag>");
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralScriptAssetReference

     *
     * @throws ProtocolException
     */
    public void testCreateSimpleXmlInvalid() throws ProtocolException {
        TestMarinerPageContext context = new TestMarinerPageContext();
        ScriptAssetReference expected = new LiteralScriptAssetReference(
                "<unbalanced-tag>");
        try {
            createScript(context, expected);
            fail("Unbalanced XML tag should fail to parse");
        } catch (ProtocolException e) {
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.implementation.LiteralScriptAssetReference

        String ON_LOAD = "Onload";
        String ON_UNLOAD = "OnUnload";

        referenceResolverMock.expects.resolveQuotedScriptExpression(ON_LOAD)
            .returns(new LiteralScriptAssetReference(ON_LOAD)).any();

        referenceResolverMock.expects.resolveQuotedScriptExpression(ON_UNLOAD)
            .returns(new LiteralScriptAssetReference(ON_UNLOAD)).any();

        papiAttributes.setOnLoad(ON_LOAD);
        papiAttributes.setOnUnload(ON_UNLOAD);
        CanvasAttributes attributes = new CanvasAttributes();
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.