Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.InjectSpecification


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

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

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

    }
View Full Code Here


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

        InjectSpecification spec = _factory.createInjectSpecification();

        spec.setProperty(property);
        spec.setObjectReference(objectReference);
        IComponentSpecification cs = (IComponentSpecification) peekObject();

        cs.addInjectSpecification(spec);

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

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

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

        return Collections.singletonList(is);
    }
View Full Code Here

        List l = spec.getInjectSpecifications();

        assertEquals(2, l.size());

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

        assertEquals("fred", i1.getProperty());
        assertEquals("flintstone", i1.getObjectReference());
        assertNotNull(i1.getLocation());

        InjectSpecification i2 = (InjectSpecification) l.get(1);
        assertEquals("barney", i2.getProperty());
        assertEquals("rubble", i2.getObjectReference());
        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

    @Test
    public void testPrimitive()
    {
        Location l = newLocation();
        InjectSpecification spec = newSpec("fooBar", "foo.bar", l);

        ComponentPropertySource source = newSource();
       
        EnhancementOperation op = newMock(EnhancementOperation.class);
View Full Code Here

    @Test
    public void testCharacter()
    {
        Location l = newLocation();
        InjectSpecification spec = newSpec("fooBar", "foo.bar", l);

        ComponentPropertySource source = newSource();

        EnhancementOperation op = newMock(EnhancementOperation.class);
View Full Code Here

    @Test
    public void testObject()
    {
        Location l = newLocation();
        InjectSpecification spec = newSpec("fooBar", "foo.bar", l);

        ComponentPropertySource source = newSource();
        ValueConverter converter = newMock(ValueConverter.class);

        EnhancementOperation op = newMock(EnhancementOperation.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

        return newMock(ApplicationStateManager.class);
    }

    private InjectSpecification newSpec(String propertyName, String objectName, Location l)
    {
        InjectSpecification spec = new InjectSpecificationImpl();

        spec.setProperty(propertyName);
        spec.setObject(objectName);
        spec.setLocation(l);

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