1 15 package org.apache.tapestry; 16 17 import org.apache.hivemind.test.HiveMindTestCase; 18 19 26 public class TestAbstractComponent extends HiveMindTestCase 27 { 28 private static class ConcreteComponent extends AbstractComponent 29 { 30 31 protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) 32 { 33 } 34 35 } 36 37 public void testUnimplementedMethods() 38 { 39 IComponent component = new ConcreteComponent(); 40 41 try 42 { 43 component.getMessages(); 44 unreachable(); 45 } 46 catch (IllegalStateException ex) 47 { 48 assertEquals( 49 "Method getMessages() is not implemented. An implementation of this method should be provided via runtime class enhancement.", 50 ex.getMessage()); 51 } 52 53 try 54 { 55 component.getSpecification(); 56 unreachable(); 57 } 58 catch (IllegalStateException ex) 59 { 60 assertEquals(TapestryMessages.providedByEnhancement("getSpecification"), ex 61 .getMessage()); 62 } 63 } 64 } | Popular Tags |