Examples of InjectSpecification


Examples of org.apache.tapestry.spec.InjectSpecification

        return (ComponentPropertySource) newMock(ComponentPropertySource.class);
    }

    public void testPrimitive()
    {
        InjectSpecification spec = newSpec("fooBar", "foo.bar");

        ComponentPropertySource source = newSource();

        MockControl control = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) control.getMock();
View Full Code Here

Examples of org.apache.tapestry.spec.InjectSpecification

        verifyControls();
    }

    public void testCharacter()
    {
        InjectSpecification spec = newSpec("fooBar", "foo.bar");

        ComponentPropertySource source = newSource();

        MockControl control = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) control.getMock();
View Full Code Here

Examples of org.apache.tapestry.spec.InjectSpecification

        verifyControls();
    }

    public void testObject()
    {
        InjectSpecification spec = newSpec("fooBar", "foo.bar");

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

        MockControl control = newControl(EnhancementOperation.class);
View Full Code Here

Examples of org.apache.tapestry.spec.InjectSpecification

        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

Examples of org.apache.tapestry.spec.InjectSpecification

        return spec;
    }

    public void testSuccess()
    {
        InjectSpecification spec = newSpec("fred", "barney", null);
        MockControl opc = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) opc.getMock();

        ApplicationStateManager asm = newASM();
View Full Code Here

Examples of org.apache.tapestry.spec.InjectSpecification

    }

    private InjectSpecification newInjectSpecification(String propertyName, String type,
            String object, Location location)
    {
        InjectSpecification result = new InjectSpecificationImpl();
        result.setProperty(propertyName);
        result.setType(type);
        result.setObject(object);
        result.setLocation(location);

        return result;
    }
View Full Code Here

Examples of org.apache.tapestry.spec.InjectSpecification

    }

    public void testSuccess()
    {
        EnhancementOperation op = newOp();
        InjectSpecification is = newInjectSpecification("property", "object", "service:Foo");
        InjectEnhancementWorker worker = newWorker();
        Map map = newMap("object", worker);
        IComponentSpecification spec = newSpec(is);

        worker.performEnhancement(op, is);
View Full Code Here

Examples of org.apache.tapestry.spec.InjectSpecification

    public void testUnknownType()
    {
        Location l = newLocation();
        EnhancementOperation op = newOp();
        InjectSpecification is = newInjectSpecification(
                "injectedProperty",
                "object",
                "service:Foo",
                l);
        IComponentSpecification spec = newSpec(is);
View Full Code Here

Examples of org.apache.tapestry.spec.InjectSpecification

    public void testFailure()
    {
        Location l = newLocation();
        MockControl opc = newControl(EnhancementOperation.class);
        EnhancementOperation op = (EnhancementOperation) opc.getMock();
        InjectSpecification is = newInjectSpecification("myProperty", "object", "service:Foo", l);
        MockControl workerc = newControl(InjectEnhancementWorker.class);
        InjectEnhancementWorker worker = (InjectEnhancementWorker) workerc.getMock();
        Map map = newMap("object", worker);
        IComponentSpecification spec = newSpec(is);
        Throwable t = new RuntimeException("Simulated failure.");
View Full Code Here

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
TOP
Copyright © 2018 www.massapi.com. 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.