Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.InjectSpecification


    public void testInjectNull()
    {
        Location l = newLocation();

        InjectSpecification spec = newSpec("fred", "service:barney", l);

        MockControl opc = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) opc.getMock();

        MockControl pc = newControl(InjectedValueProvider.class);
View Full Code Here


    public void testInjectedValueWrongType()
    {
        Location l = newLocation();

        InjectSpecification spec = newSpec("fred", "service:barney", l);

        MockControl opc = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) opc.getMock();

        MockControl pc = newControl(InjectedValueProvider.class);
View Full Code Here

        List l = spec.getInjectSpecifications();

        assertEquals(2, l.size());

        InjectSpecification i1 = (InjectSpecification) l.get(0);

        assertEquals("fred", i1.getProperty());
        assertEquals("object", i1.getType());
        assertEquals("flintstone", i1.getObject());
        assertNotNull(i1.getLocation());

        InjectSpecification i2 = (InjectSpecification) l.get(1);
        assertEquals("barney", i2.getProperty());
        assertEquals("state", i2.getType());
        assertEquals("rubble", i2.getObject());
        assertNotNull(i2.getLocation());
    }
View Full Code Here

        List l = spec.getInjectSpecifications();

        assertEquals(2, l.size());

        InjectSpecification i1 = (InjectSpecification) l.get(0);

        assertEquals("fred", i1.getProperty());
        assertEquals("object", i1.getType());
        assertEquals("flintstone", i1.getObject());
        assertNotNull(i1.getLocation());

        InjectSpecification i2 = (InjectSpecification) l.get(1);
        assertEquals("barney", i2.getProperty());
        assertEquals("state", i2.getType());
        assertEquals("rubble", i2.getObject());
        assertNotNull(i2.getLocation());
    }
View Full Code Here

    public void testInjectPage()
    {
        Location l = newLocation();
        IComponentSpecification spec = execute(new InjectPageAnnotationWorker(), "getMyPage", l);

        InjectSpecification is = (InjectSpecification) spec.getInjectSpecifications().get(0);

        assertEquals("myPage", is.getProperty());
        assertEquals("page", is.getType());
        assertEquals("SomePageName", is.getObject());
        assertSame(l, is.getLocation());
    }
View Full Code Here

    public void testInjectMeta()
    {
        Location l = newLocation();
        IComponentSpecification spec = execute(new InjectMetaAnnotationWorker(), "getMetaFred", l);

        InjectSpecification is = (InjectSpecification) spec.getInjectSpecifications().get(0);

        assertEquals("metaFred", is.getProperty());
        assertEquals("meta", is.getType());
        assertEquals("fred", is.getObject());
        assertSame(l, is.getLocation());

    }
View Full Code Here

    public void testInjectScript()
    {
        Location l = newLocation();
        IComponentSpecification spec = execute(new InjectScriptAnnotationWorker(), "getScript", l);

        InjectSpecification is = (InjectSpecification) spec.getInjectSpecifications().get(0);

        assertEquals("script", is.getProperty());
        assertEquals("script", is.getType());
        assertEquals("foo.script", is.getObject());
        assertSame(l, is.getLocation());

    }
View Full Code Here

                PROPERTY_NAME_PATTERN,
                "invalid-property-name");
        String type = getAttribute("type");
        String objectReference = getAttribute("object");

        InjectSpecification spec = _factory.createInjectSpecification();

        spec.setProperty(property);
        spec.setType(type);
        spec.setObject(objectReference);
        IComponentSpecification cs = (IComponentSpecification) peekObject();

        cs.addInjectSpecification(spec);

        push(_elementName, spec, STATE_NO_CONTENT);
View Full Code Here

                PROPERTY_NAME_PATTERN,
                "invalid-property-name");
        String type = getAttribute("type");
        String objectReference = getAttribute("object");

        InjectSpecification spec = _factory.createInjectSpecification();

        spec.setProperty(property);
        spec.setType(type);
        spec.setObject(objectReference);
        IComponentSpecification cs = (IComponentSpecification) peekObject();

        cs.addInjectSpecification(spec);

        push(_elementName, spec, STATE_NO_CONTENT);
View Full Code Here

                PROPERTY_NAME_PATTERN,
                "invalid-property-name");
        String type = getAttribute("type");
        String objectReference = getAttribute("object");

        InjectSpecification spec = _factory.createInjectSpecification();

        spec.setProperty(property);
        spec.setType(type);
        spec.setObject(objectReference);
        IComponentSpecification cs = (IComponentSpecification) peekObject();

        cs.addInjectSpecification(spec);

        push(_elementName, spec, STATE_NO_CONTENT);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.spec.InjectSpecification

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.