Examples of IPropertySource


Examples of org.apache.tapestry.engine.IPropertySource

    {
        ApplicationSpecification spec = new ApplicationSpecification();

        spec.setProperty("fred", "barney");

        IPropertySource source = new PropertyHolderPropertySource(spec);

        expect(source, "fred", "barney");
        expect(source, "wilma", null);
    }
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

        expect(source, "wilma", null);
    }

    public void testSystemProperties()
    {
        IPropertySource source = SystemPropertiesPropertySource.getInstance();

        expect(source, "java.os", System.getProperty("java.os"));
        expect(source, "foo", null);
    }
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    }

    public void testGlobalPropertyObjectProviderSuccess()
    {
        MockControl sourceControl = newControl(IPropertySource.class);
        IPropertySource source = (IPropertySource) sourceControl.getMock();

        // Training

        source.getPropertyValue("foo");
        sourceControl.setReturnValue("bar");

        replayControls();

        PropertyObjectProvider p = new PropertyObjectProvider();
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    public void testGlobalPropertyObjectProviderFailure()
    {
        Location l = fabricateLocation(223);

        MockControl sourceControl = newControl(IPropertySource.class);
        IPropertySource source = (IPropertySource) sourceControl.getMock();

        // Training

        source.getPropertyValue("foo");
        sourceControl.setThrowable(new ApplicationRuntimeException("failure"));

        replayControls();

        PropertyObjectProvider p = new PropertyObjectProvider();
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

public class TestLocalizedPropertySource extends HiveMindTestCase
{
    public void testFound()
    {
        MockControl control = newControl(IPropertySource.class);
        IPropertySource ps = (IPropertySource) control.getMock();

        ps.getPropertyValue("property-name_en");
        control.setReturnValue(null);

        ps.getPropertyValue("property-name");
        control.setReturnValue("fred");

        replayControls();

        LocalizedPropertySource lps = new LocalizedPropertySource(ps);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    }

    public void testNotFound()
    {
        MockControl control = newControl(IPropertySource.class);
        IPropertySource ps = (IPropertySource) control.getMock();

        ps.getPropertyValue("property-name_fr");
        control.setReturnValue(null);

        ps.getPropertyValue("property-name");
        control.setReturnValue(null);

        replayControls();

        LocalizedPropertySource lps = new LocalizedPropertySource(ps);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

        if (!init)
        {
            RequestContext requestContext = cycle.getRequestContext();
            ApplicationServlet servlet = requestContext.getServlet();
            ServletContext context = servlet.getServletContext();
            IPropertySource propertySource = cycle.getEngine().getPropertySource();
            IResourceLocation webInfLocation = new ContextResourceLocation(context, "/WEB-INF/");
            IResourceLocation webInfAppLocation = webInfLocation.getRelativeLocation(servlet.getServletName() + "/");
            readQuestions(easyQuestions, webInfAppLocation, propertySource.getPropertyValue("easyquestionsfile"));
            readQuestions(mediumQuestions, webInfAppLocation, propertySource.getPropertyValue("mediumquestiosfile"));
            readQuestions(hardQuestions, webInfAppLocation, propertySource.getPropertyValue("hardquestionsfile"));
            points = new int[10];
            names = new String[10];
            for (int i = 0; i <= 9; i++)
            {
                points[i] = 0;
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    protected AssetExternalizer(IRequestCycle cycle)
    {
        _resolver = cycle.getEngine().getResourceResolver();
   
        IPropertySource properties = cycle.getEngine().getPropertySource();


        String directory = properties.getPropertyValue("org.apache.tapestry.asset.dir");

        if (directory == null)
            return;

        _URL = properties.getPropertyValue("org.apache.tapestry.asset.URL");

        if (_URL == null)
            return;

        _assetDir = new File(directory);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

        String result = null;
        int count = _sources.size();
       
        for (int i = 0; i < count; i++)
        {
            IPropertySource source = (IPropertySource)_sources.get(i);
           
            result = source.getPropertyValue(propertyName);
           
            if (result != null)
                break;
        }
       
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    }

    public void testGlobalPropertyObjectProviderSuccess()
    {
        MockControl sourceControl = newControl(IPropertySource.class);
        IPropertySource source = (IPropertySource) sourceControl.getMock();

        // Training

        source.getPropertyValue("foo");
        sourceControl.setReturnValue("bar");

        replayControls();

        PropertyObjectProvider p = new PropertyObjectProvider();
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.