Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.InjectSpecification


                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

    {
        Iterator i = spec.getInjectSpecifications().iterator();

        while (i.hasNext())
        {
            InjectSpecification is = (InjectSpecification) i.next();

            invokeWorker(op, is);
        }
    }
View Full Code Here

    {
        InjectStateFlag isv = method.getAnnotation(InjectStateFlag.class);

        String propertyName = AnnotationUtils.getPropertyName(method);

        InjectSpecification inject = new InjectSpecificationImpl();

        inject.setType("state-flag");
        inject.setProperty(propertyName);
        inject.setObject(isv.value());
        inject.setLocation(location);

        spec.addInjectSpecification(inject);
    }
View Full Code Here

*/
public class TestInjectObjectWorker extends HiveMindTestCase
{
    private InjectSpecification newSpec(String name, String locator, Location location)
    {
        InjectSpecification is = new InjectSpecificationImpl();

        is.setProperty(name);
        is.setObject(locator);
        is.setLocation(location);

        return is;
    }
View Full Code Here

    public void testNoExistingProperty()
    {
        Location l = newLocation();
        Object injectedValue = new Object();

        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 testWithExistingProperty()
    {
        Location l = newLocation();
        Object injectedValue = new HomeService();

        InjectSpecification spec = newSpec("wilma", "service:betty", l);

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

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

    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

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.