Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.Context


    public void path_does_not_contain_a_period() throws Exception
    {
        Request request = newRequest("/start");
        Response response = mockResponse();
        RequestHandler handler = mockRequestHandler();
        Context context = mockContext();

        train_service(handler, request, response, true);

        replay();
View Full Code Here


        String path = "/cell.gif";

        Request request = newRequest(path);
        Response response = mockResponse();
        RequestHandler handler = mockRequestHandler();
        Context context = mockContext();

        train_getResource(context, path, url);

        replay();
View Full Code Here

        String path = "/cell.tml";

        Request request = newRequest(path);
        Response response = mockResponse();
        RequestHandler handler = mockRequestHandler();
        Context context = mockContext();

        train_getResource(context, path, url);

        response.sendError(
                HttpServletResponse.SC_FORBIDDEN,
View Full Code Here

        String path = "/cell.TML";

        Request request = newRequest(path);
        Response response = mockResponse();
        RequestHandler handler = mockRequestHandler();
        Context context = mockContext();

        train_getResource(context, path, url);

        response.sendError(
                HttpServletResponse.SC_FORBIDDEN,
View Full Code Here

        String path = "/start.update";

        Request request = newRequest(path);
        Response response = mockResponse();
        RequestHandler handler = mockRequestHandler();
        Context context = mockContext();

        train_getResource(context, path, null);
        train_service(handler, request, response, true);

        replay();
View Full Code Here

{

    @Test
    public void missing_spring_context()
    {
        Context context = mockContext(null);

        replay();

        try
        {
View Full Code Here

    @Test
    public void success()
    {
        WebApplicationContext webContext = newMock(WebApplicationContext.class);
        Context context = mockContext(webContext);

        replay();

        assertSame(SpringModule.build(context), webContext);
View Full Code Here

        verify();
    }

    protected final Context mockContext(Object webApplicationContext)
    {
        Context context = mockContext();

        expect(context.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE))
                .andReturn(webApplicationContext);

        return context;
    }
View Full Code Here

    }

    @Test
    public void error_getting_spring_context()
    {
        Context context = mockContext("[Placeholder]");

        replay();

        try
        {
View Full Code Here

    public void get_url_no_real_file() throws Exception
    {
        String path = "/foo/Bar.txt";
        URL url = getClass().getResource("ContextResourceTest.class");

        Context context = mockContext();

        expect(context.getRealFile(path)).andReturn(null);

        expect(context.getResource("/foo/Bar.txt")).andReturn(url);

        replay();

        Resource r = new ContextResource(context, "foo/Bar.txt");
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.Context

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.