Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.Context


    private final IdentityAssetPathConverter converter = new IdentityAssetPathConverter();

    @Test
    public void root_resource()
    {
        Context context = mockContext();
        Request request = mockRequest();

        replay();

        AssetFactory factory = new ContextAssetFactory(request, context, "1.2.3", converter);
View Full Code Here


    }

    @Test
    public void asset_client_URL()
    {
        Context context = mockContext();
        Request request = mockRequest();

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

        train_getContextPath(request, "/context");
View Full Code Here

    {
        File f = File.createTempFile("foo", ".properties");

        setupFile(f);

        Context context = mockContext();

        expect(context.getRealFile("/bar/" + f.getName())).andReturn(f);

        replay();

        ContextResourceSymbolProvider provider = new ContextResourceSymbolProvider(context, "bar/" + f.getName());
View Full Code Here

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

        Context context = mockContext();

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

        expect(context.getResource("/foo/ContextResourceTest.class")).andReturn(url);

        replay();

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

    {
        File f = File.createTempFile("Bar", ".txt");

        String path = "/foo/" + f.getName();

        Context context = mockContext();

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

        replay();

        Resource r = new ContextResource(context, "foo/" + f.getName());
View Full Code Here

    }

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

        replay();

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

    }

    @Test
    public void hash_code()
    {
        Context context1 = mockContext();
        Context context2 = mockContext();

        replay();

        Resource r1 = new ContextResource(context1, "foo");
        Resource r2 = new ContextResource(context1, "foo");
View Full Code Here

    }

    @Test
    public void equals()
    {
        Context context1 = mockContext();
        Context context2 = mockContext();
        Resource r = mockResource();

        replay();

        Resource r1 = new ContextResource(context1, "foo");
View Full Code Here

        expect(servletContext.getAttribute(name)).andReturn(value);

        replay();

        Context context = new ContextImpl(servletContext);

        assertSame(context.getAttribute(name), value);

        verify();
    }
View Full Code Here

        train_getRealPath(servletContext, path, realPath);

        replay();

        Context c = new ContextImpl(servletContext);

        File f = c.getRealFile(path);

        assertEquals(f, file);


        verify();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.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.