Package org.apache.tapestry.engine

Examples of org.apache.tapestry.engine.RequestCycle


        decodeParameters(request.getActivationPath(), request.getPathInfo(), parameters);

        String serviceName = findService(parameters);

        IRequestCycle cycle = new RequestCycle(engine, parameters, serviceName, _environment);

        _requestGlobals.store(cycle);

        try {

            _requestGlobals.store(_responseDelegateFactory.getResponseBuilder(cycle));

            cycle.setResponseBuilder(_requestGlobals.getResponseBuilder());

        } catch (IOException e) {
            throw new ApplicationRuntimeException("Error creating response builder.", e);
        }
View Full Code Here


    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

        decodeParameters(request.getActivationPath(), request.getPathInfo(), parameters);

        String serviceName = findService(parameters);

        IRequestCycle cycle = new RequestCycle(engine, parameters, serviceName, monitor,
                _environment, context);

        _requestGlobals.store(cycle);

        return cycle;
View Full Code Here

        decodeParameters(request.getActivationPath(), request.getPathInfo(), parameters);

        String serviceName = findService(parameters);

        IRequestCycle cycle = new RequestCycle(engine, parameters, serviceName, monitor,
                _environment);

        _requestGlobals.store(cycle);

        return cycle;
View Full Code Here

     */
    public void testLimitOutput() {
        InsertLimited insertLimited = new MyInsertLimited(25, false, null, TEXT_VALUE, null, null, "...");
        StringWriter strwriter = new StringWriter();
        PrintWriter writer = new PrintWriter(strwriter);
        insertLimited.renderComponent(new MarkupWriterImpl("UTF-8", writer, new AsciiMarkupFilter()), new RequestCycle());
        writer.flush();
        assertEquals("1234567890123456789012...", strwriter.toString());
    }
View Full Code Here

     */
    public void testLimitOutputWithNoMarker() {
        InsertLimited insertLimited = new MyInsertLimited(25, false, null, TEXT_VALUE, null, null, null);
        StringWriter strwriter = new StringWriter();
        PrintWriter writer = new PrintWriter(strwriter);
        insertLimited.renderComponent(new MarkupWriterImpl("UTF-8", writer, new AsciiMarkupFilter()), new RequestCycle());
        writer.flush();
        assertEquals("1234567890123456789012345", strwriter.toString());
    }
View Full Code Here

     */
    public void testRawOutputIsNotLimited() {
        InsertLimited insertLimited = new MyInsertLimited(25, true, null, TEXT_VALUE, null, null, "...");
        StringWriter strwriter = new StringWriter();
        PrintWriter writer = new PrintWriter(strwriter);
        insertLimited.renderComponent(new MarkupWriterImpl("UTF-8", writer, new AsciiMarkupFilter()), new RequestCycle());
        writer.flush();
        assertEquals(TEXT_VALUE, strwriter.toString());
    }
View Full Code Here

        String value = format.format(date);
        int maxlen = 3;
        InsertLimited insertLimited = new MyInsertLimited(maxlen, false, null, date, format, null, null);
        StringWriter strwriter = new StringWriter();
        PrintWriter writer = new PrintWriter(strwriter);
        insertLimited.renderComponent(new MarkupWriterImpl("UTF-8", writer, new AsciiMarkupFilter()), new RequestCycle());
        writer.flush();
        assertEquals(value.substring(0, maxlen), strwriter.toString());
    }
View Full Code Here

    public void testNotRewinding() {
        Mock formMock = getFormMock(false);
        Html4Button button = getButton(formMock, null, false, null);
        StringWriter strWriter = new StringWriter();
        PrintWriter writer = new PrintWriter(strWriter);
        button.renderFormComponent(new MarkupWriterImpl("UTF-8", writer, new AsciiMarkupFilter()), new RequestCycle());
        writer.flush();
        formMock.verify();
        String hiddenName = FORM_NAME + "_ctrl";
        assertEquals("<input type=\"hidden\" name=\"" + hiddenName + "\"></input><button type=\"" + TYPE + "\" name=\"" + FORM_NAME + "\" value=\"" + LABEL + "\" onclick=\"document." + FORM_NAME + "." + hiddenName + ".value='x'\"><em>body</em></button>", strWriter.toString());
    }
View Full Code Here

    public void testNotRewindingWithOnlick() {
        Mock formMock = getFormMock(false);
        Html4Button button = getButton(formMock, null, false, "void(0)");
        StringWriter strWriter = new StringWriter();
        PrintWriter writer = new PrintWriter(strWriter);
        button.renderFormComponent(new MarkupWriterImpl("UTF-8", writer, new AsciiMarkupFilter()), new RequestCycle());
        writer.flush();
        formMock.verify();
        String hiddenName = FORM_NAME + "_ctrl";
        assertEquals("<input type=\"hidden\" name=\"" + hiddenName + "\"></input><button type=\"" + TYPE + "\" name=\"" + FORM_NAME + "\" value=\"" + LABEL + "\" onclick=\"document." + FORM_NAME + "." + hiddenName + ".value='x'; void(0)\"><em>body</em></button>", strWriter.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.engine.RequestCycle

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.