Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.InjectSpecification


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

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

            try
            {
                performEnhancement(op, is);
            }
            catch (Exception ex)
            {
                _errorLog.error(EnhanceMessages.errorAddingProperty(
                        is.getProperty(),
                        op.getBaseClass(),
                        ex), is.getLocation(), ex);
            }
        }
    }
View Full Code Here


    {
        String propertyName = AnnotationUtils.getPropertyName(method);

        InjectMeta annotation = method.getAnnotation(InjectMeta.class);

        InjectSpecification is = new InjectSpecificationImpl();
        is.setProperty(propertyName);
        is.setType("meta");
        is.setObject(annotation.value());
        is.setLocation(location);
       
        spec.addInjectSpecification(is);
    }
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

                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

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

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

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

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

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

        assertEquals("metaFred", is.getProperty());
        assertEquals("meta", is.getType());
        assertEquals("fred", is.getObject());
        assertNull(is.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.