Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.InjectSpecification


    }

    public void testSuccess()
    {
        Location l = newLocation();
        InjectSpecification spec = newSpec("fred", "barney", l);
       
        EnhancementOperation op = newMock(EnhancementOperation.class);

        ApplicationStateManager asm = newASM();
View Full Code Here


        expect(op.getPropertyType("somePage")).andReturn(int.class);

        replay();

        InjectSpecification is = newSpec(l);

        try
        {
            new InjectPageWorker().performEnhancement(op, is);
            unreachable();
View Full Code Here

        verify();
    }

    private InjectSpecification newSpec(Location l)
    {
        InjectSpecification is = new InjectSpecificationImpl();
        is.setProperty("somePage");
        is.setObject("SomePage");
        is.setLocation(l);

        return is;
    }
View Full Code Here

                "return getPage().getRequestCycle().getPage(\"SomePage\");",
                l);

        replay();

        InjectSpecification is = newSpec(l);

        new InjectPageWorker().performEnhancement(op, is);

        verify();
    }
View Full Code Here

                        "return (org.apache.tapestry.html.BasePage)getPage().getRequestCycle().getPage(\"SomePage\");",
                        l);

        replay();

        InjectSpecification is = newSpec(l);

        new InjectPageWorker().performEnhancement(op, is);

        verify();
    }
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

*/
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

                "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

        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

        return (ApplicationStateManager) 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.