Examples of IScript


Examples of org.apache.tapestry.IScript

        return parser.parse(scriptLocation);
    }

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

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

        replayControls();

        script.execute(cycle, _processor, symbols);

        verifyControls();

        return script;
    }
View Full Code Here

Examples of org.apache.tapestry.IScript

     * @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

Examples of org.apache.tapestry.IScript

        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

Examples of org.apache.tapestry.IScript

    /**
     * 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

Examples of org.apache.tapestry.IScript

        finalSymbols.put(FORM_SYMBOL, form);
        finalSymbols.put(VALIDATOR_SYMBOL, this);

        Resource location = new ClasspathResource(engine.getClassResolver(), scriptPath);

        IScript script = source.getScript(location);

        // If there's an error, report it against the field (this validator object doesn't
        // have a location).

        PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, field);

        script.execute(cycle, pageRenderSupport, finalSymbols);
    }
View Full Code Here

Examples of org.apache.tapestry.IScript

        IResourceLocation scriptLocation =
            getSpecification().getSpecificationLocation().getRelativeLocation(
                "InspectorButton.script");

        IScript script = source.getScript(scriptLocation);

        Map symbols = new HashMap();

        IEngineService service = engine.getService(Tapestry.DIRECT_SERVICE);
        ILink link = service.getLink(cycle, this, null);

        symbols.put("URL", link.getURL());

        Body body = Body.get(cycle);

        if (body == null)
            throw new ApplicationRuntimeException(
                Tapestry.getMessage("InspectorButton.must-be-contained-by-body"),
                this,
                null,
                null);

        script.execute(cycle, body, symbols);

        // Now, go render the rest from the template.

        super.renderComponent(writer, cycle);
    }
View Full Code Here

Examples of org.apache.tapestry.IScript

        __CLOVER_445_0.S[9857]++;finalSymbols.put(VALIDATOR_SYMBOL, this);

        __CLOVER_445_0.S[9858]++;Resource location =
            new ClasspathResource(engine.getClassResolver(), scriptPath);

        __CLOVER_445_0.S[9859]++;IScript script = source.getScript(location);

        __CLOVER_445_0.S[9860]++;Body body = Body.get(cycle);

        __CLOVER_445_0.S[9861]++;if ((((body == null) && (++__CLOVER_445_0.CT[1688] != 0)) || (++__CLOVER_445_0.CF[1688] == 0))){
            __CLOVER_445_0.S[9862]++;throw new ApplicationRuntimeException(
                Tapestry.getMessage("ValidField.must-be-contained-by-body"),
                field,
                null,
                null);}

        __CLOVER_445_0.S[9863]++;script.execute(cycle, body, finalSymbols);

        __CLOVER_445_0.S[9864]++;String functionName = (String) finalSymbols.get(FUNCTION_SYMBOL);

        __CLOVER_445_0.S[9865]++;form.addEventHandler(FormEventType.SUBMIT, functionName);
    } finally { }}
View Full Code Here

Examples of org.apache.tapestry.IScript

    public void testRenderNormal()
    {
        IMarkupWriter writer = newBufferWriter();
        IRequestCycle cycle = newCycle();
        IScript script = new ScriptFixture();
        PageRenderSupport support = newPageRenderSupport();

        IForm form = newForm();

        LinkSubmit linkSubmit = (LinkSubmit) newInstance(LinkSubmit.class, new Object[]
View Full Code Here

Examples of org.apache.tapestry.IScript

        __CLOVER_79_0.S[1986]++;_cache.clear();
    } finally { }}

    public synchronized IScript getScript(Resource resource)
    {try { __CLOVER_79_0.M[457]++;
        __CLOVER_79_0.S[1987]++;IScript result = (IScript) _cache.get(resource);

        __CLOVER_79_0.S[1988]++;if ((((result != null) && (++__CLOVER_79_0.CT[374] != 0)) || (++__CLOVER_79_0.CF[374] == 0))){
            __CLOVER_79_0.S[1989]++;return result;}

        __CLOVER_79_0.S[1990]++;result = parse(resource);
View Full Code Here

Examples of org.apache.tapestry.IScript

        __CLOVER_79_0.S[12455]++;_cache.clear();
    } finally { }}

    public synchronized IScript getScript(Resource resource)
    {try { __CLOVER_79_0.M[3027]++;
        __CLOVER_79_0.S[12456]++;IScript result = (IScript) _cache.get(resource);

        __CLOVER_79_0.S[12457]++;if ((((result != null) && (++__CLOVER_79_0.CT[2135] != 0)) || (++__CLOVER_79_0.CF[2135] == 0))){
            __CLOVER_79_0.S[12458]++;return result;}

        __CLOVER_79_0.S[12459]++;result = parse(resource);
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.