Examples of IApplicationSpecification


Examples of org.apache.tapestry.spec.IApplicationSpecification

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

        log.debug("Found " + r);

        IApplicationSpecification as = new ApplicationSpecification();

        MockControl parserControl = newControl(ISpecificationParser.class);
        ISpecificationParser parser = (ISpecificationParser) parserControl.getMock();

        i.setParser(parser);
View Full Code Here

Examples of org.apache.tapestry.spec.IApplicationSpecification

        i.initialize(servlet);

        verifyControls();

        IApplicationSpecification as = ag.getSpecification();

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

Examples of org.apache.tapestry.spec.IApplicationSpecification

        protected boolean argumentMatches(Object expected, Object actual)
        {
            if (expected instanceof IApplicationSpecification)
            {
                IApplicationSpecification expectedSpec = (IApplicationSpecification) expected;
                IApplicationSpecification actualSpec = (IApplicationSpecification) actual;

                return expectedSpec.getName().equals(actualSpec.getName())
                        && expectedSpec.getSpecificationLocation().equals(
                                actualSpec.getSpecificationLocation());
            }

            return super.argumentMatches(expected, actual);
        }
View Full Code Here

Examples of org.apache.tapestry.spec.IApplicationSpecification

    }

    public void testTypeConverter() throws Exception
    {
        MockControl asc = newControl(IApplicationSpecification.class);
        IApplicationSpecification as = (IApplicationSpecification) asc.getMock();

        MockControl tcc = newControl(TypeConverter.class);
        TypeConverter tc = (TypeConverter) tcc.getMock();

        // Training

        as.checkExtension(Tapestry.OGNL_TYPE_CONVERTER);
        asc.setReturnValue(true);

        as.getExtension(Tapestry.OGNL_TYPE_CONVERTER, TypeConverter.class);
        asc.setReturnValue(tc);

        replayControls();

        ExpressionCache cache = new ExpressionCacheImpl();
View Full Code Here

Examples of org.apache.tapestry.spec.IApplicationSpecification

public class TestApplicationSpecification extends TapestryTestCase
{

    public void testBasicExtension() throws Exception
    {
        IApplicationSpecification spec = parseApp("BasicExtension.application");

        PropertyBean extension = (PropertyBean) spec.getExtension("testBean");

        assertEquals("booleanProperty", true, extension.getBooleanProperty());
        assertEquals("intProperty", 18, extension.getIntProperty());
        assertEquals("longProperty", 383838L, extension.getLongProperty());
        assertEquals("doubleProperty", -3.14, extension.getDoubleProperty(), 0.0);
View Full Code Here

Examples of org.apache.tapestry.spec.IApplicationSpecification

                .getStringProperty());
    }

    public void testExtensionType() throws Exception
    {
        IApplicationSpecification spec = parseApp("BasicExtension.application");

        PropertyBean extension = (PropertyBean) spec.getExtension("testBean", Object.class);

        assertNotNull(extension);
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IApplicationSpecification

        assertNotNull(extension);
    }

    public void testExtensionTypeFailClass() throws Exception
    {
        IApplicationSpecification spec = parseApp("BasicExtension.application");

        try
        {
            spec.getExtension("testBean", Number.class);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            checkException(ex, "does not inherit from class java.lang.Number");
View Full Code Here

Examples of org.apache.tapestry.spec.IApplicationSpecification

    }

    public void testExtensionTypeFailInterface() throws Exception
    {
        IApplicationSpecification spec = parseApp("BasicExtension.application");

        try
        {
            spec.getExtension("testBean", IMonitor.class);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            checkException(ex, "does not implement interface org.apache.tapestry.engine.IMonitor");
View Full Code Here

Examples of org.apache.tapestry.spec.IApplicationSpecification

    }

    public void testExtensionProperty() throws Exception
    {
        IApplicationSpecification a = parseApp("ExtensionProperty.application");

        IExtensionSpecification e = a.getExtensionSpecification("testBean");

        assertEquals("Property fred.", "flintstone", e.getProperty("fred"));
    }
View Full Code Here

Examples of org.apache.tapestry.spec.IApplicationSpecification

        verify();
    }

    private IApplicationSpecification newAppSpec()
    {
        IApplicationSpecification spec = newMock(IApplicationSpecification.class);

        expect(spec.checkExtension(Tapestry.OGNL_TYPE_CONVERTER)).andReturn(false);

        return spec;
    }
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.