Package org.apache.tapestry.engine

Examples of org.apache.tapestry.engine.IEngineService


    /**
     * Gets an application-defined and factory-defined service where there are no naming conflicts.
     */
    public void testGetNoConflict()
    {
        IEngineService factory = constructService("factory");
        IEngineService application = constructService("application");

        replayControls();

        ServiceMapImpl m = new ServiceMapImpl();

View Full Code Here


        verifyControls();
    }

    public void testApplicationOverridesFactory()
    {
        IEngineService factory = constructService("override");
        IEngineService application = constructService("override");

        replayControls();

        ServiceMapImpl m = new ServiceMapImpl();
View Full Code Here

        }
    }

    public void testDuplicateName()
    {
        IEngineService first = constructService("duplicate");
        IEngineService second = constructService("duplicate");

        List list = new ArrayList();
        list.add(first);
        list.add(second);
View Full Code Here

    {
        IRequestCycle cycle = newMock(IRequestCycle.class);
        checkOrder(cycle, false);
       
        ResponseBuilder resp = newMock(ResponseBuilder.class);
        IEngineService engine = newMock(IEngineService.class);
        IEngine cengine = newMock(IEngine.class);
        ILink link = newMock(ILink.class);
        IScript script = newMock(IScript.class);
        PageRenderSupport prs = newMock(PageRenderSupport.class);

        TranslatedFieldSupport translator = newMock(TranslatedFieldSupport.class);
        ValidatableFieldSupport validator = newMock(ValidatableFieldSupport.class);

        IValidationDelegate delegate = new ValidationDelegate();
        IForm form = newMock(IForm.class);
        IMarkupWriter writer = newBufferWriter();

        Suggest comp = newInstance(Suggest.class,
                                   "response", resp,
                                   "templateTagName", "input",
                                   "name", "suggest",
                                   "clientId", "suggest",
                                   "form", form,
                                   "translatedFieldSupport", translator,
                                   "validatableFieldSupport", validator,
                                   "engineService", engine,
                                   "script", script);

        expect(cycle.isRewinding()).andReturn(false).anyTimes();
        expect(resp.isDynamic()).andReturn(false);
        expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(form).anyTimes();

        expect(form.wasPrerendered(writer, comp)).andReturn(false).anyTimes();
        expect(form.getDelegate()).andReturn(delegate).anyTimes();
        expect(form.getElementId(comp)).andReturn("suggest");
        expect(form.isRewinding()).andReturn(false).anyTimes();

        form.setFormFieldUpdating(true);
       
        expect(translator.format(comp, null)).andReturn("r2d2");
        translator.renderContributions(comp, writer, cycle);
        validator.renderContributions(comp, writer, cycle);

        expect(cycle.getEngine()).andReturn(cengine);
        expect(cengine.getOutputEncoding()).andReturn("utf-8");
        expect(engine.getLink(eq(false), isA(DirectServiceParameter.class))).andReturn(link);
        expect(link.getURL()).andReturn("http://url");

        Capturer<Map> parm = newCapturer(Map.class);

        trainGetAttribute(cycle, TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE, prs);
View Full Code Here

    {
        IRequestCycle cycle = newMock(IRequestCycle.class);
        checkOrder(cycle, false);

        ResponseBuilder resp = newMock(ResponseBuilder.class);
        IEngineService engine = newMock(IEngineService.class);
        IEngine cengine = newMock(IEngine.class);
        ILink link = newMock(ILink.class);
        IScript script = newMock(IScript.class);
        PageRenderSupport prs = newMock(PageRenderSupport.class);

        TranslatedFieldSupport translator = newMock(TranslatedFieldSupport.class);
        ValidatableFieldSupport validator = newMock(ValidatableFieldSupport.class);

        IValidationDelegate delegate = new ValidationDelegate();
        IForm form = newMock(IForm.class);
        IMarkupWriter writer = newBufferWriter();

        Suggest comp = newInstance(Suggest.class,
                                   "response", resp,
                                   "templateTagName", "textarea",
                                   "name", "suggest",
                                   "clientId", "suggest",
                                   "form", form,
                                   "translatedFieldSupport", translator,
                                   "validatableFieldSupport", validator,
                                   "engineService", engine,
                                   "script", script);

        expect(cycle.isRewinding()).andReturn(false).anyTimes();
        expect(resp.isDynamic()).andReturn(false);
        expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(form).anyTimes();

        expect(form.wasPrerendered(writer, comp)).andReturn(false).anyTimes();
        expect(form.getDelegate()).andReturn(delegate).anyTimes();
        expect(form.getElementId(comp)).andReturn("suggest");
        expect(form.isRewinding()).andReturn(false).anyTimes();

        form.setFormFieldUpdating(true);

        expect(translator.format(comp, null)).andReturn("r2d2");
        translator.renderContributions(comp, writer, cycle);
        validator.renderContributions(comp, writer, cycle);

        expect(cycle.getEngine()).andReturn(cengine);
        expect(cengine.getOutputEncoding()).andReturn("utf-8");
        expect(engine.getLink(eq(false), isA(DirectServiceParameter.class))).andReturn(link);
        expect(link.getURL()).andReturn("http://url");

        Capturer<Map> parm = newCapturer(Map.class);

        trainGetAttribute(cycle, TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE, prs);
View Full Code Here

@Test
public class ClasspathAssetFactoryTest extends BaseComponentTestCase
{
    public void test_Create_Asset()
    {
        IEngineService assetService = newService();
        Location l = newLocation();
        IComponentSpecification spec = newSpec();
       
        replay();
View Full Code Here

    public void test_Absolute_Asset_Exists()
    {
        String path = "/org/apache/tapestry/html/Shell.jwc";

        IEngineService assetService = newService();
        IComponentSpecification spec = newSpec();
       
        replay();

        ClasspathAssetFactory factory = new ClasspathAssetFactory();
View Full Code Here

        verify();
    }

    public void test_Create_Asset_Missing()
    {
        IEngineService assetService = newService();
        Location l = newLocation();
        IComponentSpecification spec = newSpec();

        replay();
View Full Code Here

        verify();
    }

    public void test_Create_Absolute_Asset()
    {
        IEngineService assetService = newService();
        Location l = newLocation();
        replay();

        ClasspathAssetFactory factory = new ClasspathAssetFactory();
        factory.setClassResolver(getClassResolver());
View Full Code Here

        verify();
    }

    public void test_Create_Absolute_Asset_Missing()
    {
        IEngineService assetService = newService();
        Location l = newLocation();

        replay();

        ClasspathAssetFactory factory = new ClasspathAssetFactory();
View Full Code Here

TOP

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

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.