Package org.apache.hivemind.util

Examples of org.apache.hivemind.util.ContextResource


        verifyControls();

        IApplicationSpecification as = ag.getSpecification();

        assertEquals("wilma", as.getName());
        assertEquals(new ContextResource(context, "/WEB-INF/wilma.application"), as
                .getSpecificationLocation());
    }
View Full Code Here


     * @since 3.1
     */

    protected void addModuleIfExists(RegistryBuilder builder, ServletContext context, String path)
    {
        Resource r = new ContextResource(context, path);

        if (r.getResourceURL() == null)
            return;

        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(_resolver, r));
    }
View Full Code Here

        String servletPath = context.getRequest().getServletPath();

        // Could strip off the servlet name (i.e., "app" in "/app") but
        // there's no need.

        return new ContextResource(servletContext, servletPath);
    }
View Full Code Here

    private ContextResource _servletRoot;

    public void initializeService()
    {
        _servletRoot = new ContextResource(_servletContext, "/");
    }
View Full Code Here

        _context = context;
    }

    public Resource getContextRoot()
    {
        return new ContextResource(_context, "/");
    }
View Full Code Here

        ServletContext context = servlet.getServletContext();
        String servletName = servlet.getServletName();
        String expectedName = servletName + ".application";

        Resource webInfLocation = new ContextResource(context, "/WEB-INF/");
        Resource webInfAppLocation = webInfLocation.getRelativeResource(servletName + "/");

        Resource result = check(webInfAppLocation, expectedName);
        if (result != null)
            return result;
View Full Code Here

        ApplicationSpecification result = new ApplicationSpecification();

        // Pretend the file exists in the most common expected location.
       
        Resource virtualLocation = new ContextResource(servlet.getServletContext(), "/WEB-INF/"
                + servletName + ".application");

        result.setSpecificationLocation(virtualLocation);

        result.setName(servletName);
View Full Code Here

        configControl.setReturnValue("fred");

        log.isDebugEnabled();
        logControl.setReturnValue(true);

        Resource r = new ContextResource(context, "/WEB-INF/fred/fred.application");

        log.debug("Checking for existence of " + r);

        context.getResource(r.getPath());
        contextControl.setReturnValue(new URL("file:/context" + r.getPath()));

        log.debug("Found " + r);

        IApplicationSpecification as = new ApplicationSpecification();
View Full Code Here

        configControl.setReturnValue("barney");

        log.isDebugEnabled();
        logControl.setReturnValue(false);

        Resource r = new ContextResource(context, "/WEB-INF/barney.application");

        context.getResource("/WEB-INF/barney/barney.application");
        contextControl.setReturnValue(null);

        log.isDebugEnabled();
        logControl.setReturnValue(false);

        context.getResource(r.getPath());
        contextControl.setReturnValue(new URL("file:/context" + r.getPath()));

        log.debug("Found " + r);

        IApplicationSpecification as = new ApplicationSpecification();
View Full Code Here

        config.getServletContext();
        configControl.setReturnValue(context);

        IApplicationSpecification as = new ApplicationSpecification();
        as.setName("wilma");
        as.setSpecificationLocation(new ContextResource(context, "/WEB-INF/wilma.application"));

        MockControl agControl = newControl(ApplicationGlobals.class);

        ApplicationGlobals ag = (ApplicationGlobals) agControl.getMock();
View Full Code Here

TOP

Related Classes of org.apache.hivemind.util.ContextResource

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.