1 15 package org.apache.tapestry.annotations; 16 17 import org.apache.tapestry.enhance.EnhancementOperation; 18 import org.apache.tapestry.enhance.InjectComponentWorker; 19 import org.apache.tapestry.spec.IComponentSpecification; 20 21 27 public class TestInjectComponentAnnotationWorker extends BaseAnnotationTestCase 28 { 29 30 public void testDefault() 31 { 32 InjectComponentAnnotationWorker worker = new InjectComponentAnnotationWorker(); 33 34 assertNotNull(worker._delegate); 35 } 36 37 public void testDelegation() 38 { 39 EnhancementOperation op = newOp(); 40 IComponentSpecification spec = newSpec(); 41 42 InjectComponentWorker delegate = (InjectComponentWorker) newMock(InjectComponentWorker.class); 43 44 delegate.injectComponent(op, "fred", "fredField"); 45 46 replayControls(); 47 48 InjectComponentAnnotationWorker worker = new InjectComponentAnnotationWorker(delegate); 49 50 worker.performEnhancement(op, spec, findMethod(AnnotatedPage.class, "getFredField"), null); 51 52 verifyControls(); 53 } 54 } 55 | Popular Tags |