Package org.apache.tapestry

Examples of org.apache.tapestry.IScript


        return parser.parse(scriptLocation);
    }

    private IScript execute(String file, Map symbols) throws DocumentParseException
    {
        IScript script = read(file);

        IRequestCycle cycle = (IRequestCycle) newMock(IRequestCycle.class);

        replayControls();

        script.execute(cycle, _processor, symbols);

        verifyControls();

        return script;
    }
View Full Code Here


     * @since 3.0
     */

    public void testUnique() throws Exception
    {
        IScript script = read("unique.script");

        IRequestCycle cycle = new RequestCycle();

        script.execute(cycle, _processor, null);
        script.execute(cycle, _processor, null);

        assertEquals("Block1\nBlock2\nNotUnique\n\n\n\nNotUnique", _processor.getBody().trim());
    }
View Full Code Here

        assertSymbol(symbols, "gamma", "Alpha_1");
    }

    public void testIncludeScript() throws Exception
    {
        IScript script = execute("include-script.script", null);

        Resource scriptLocation = script.getScriptResource();

        Resource[] expected = new Resource[]
        { scriptLocation.getRelativeResource("first"),
                scriptLocation.getRelativeResource("second"),
                scriptLocation.getRelativeResource("third") };
View Full Code Here

    /**
     * A bunch of quickies to push up the code coverage numbers.
     */
    public void testCheats() throws Exception
    {
        IScript script = execute("simple.script", null);

        ScriptSession session = new ScriptSessionImpl(script.getScriptResource(), null, null,
                createExpressionEvaluator(), null, null);
        assertEquals("ScriptSession[" + script.getScriptResource() + "]", session.toString());
    }
View Full Code Here

     * No input symbols, no informal parameters.
     */
    public void testMinimalRender()
    {
        IScriptSource source = newScriptSource();
        IScript script = newScript();

        PageRenderSupport support = newPageRenderSupport();
        IRequestCycle cycle = newCycle(false);
        IMarkupWriter writer = newWriter();
        Resource scriptLocation = newResource();
        IRender body = newRender();

        IComponent container = newComponent();

        String scriptPath = "MyScript.script";

        Script component = (Script) newInstance(Script.class, new Object[]
        { "specification", new ComponentSpecification(), "container", container, "scriptSource",
                source, "scriptPath", scriptPath });

        trainGetPageRenderSupport(cycle, support);

        trainGetScriptLocation(container, scriptPath, scriptLocation);

        trainGetScript(source, scriptLocation, script);

        script.execute(cycle, support, new HashMap());

        body.render(writer, cycle);

        replayControls();

View Full Code Here

TOP

Related Classes of org.apache.tapestry.IScript

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.