1 29 30 package nextapp.echo2.app.test.componentxml; 31 32 import java.io.InputStream ; 33 34 import junit.framework.TestCase; 35 36 import nextapp.echo2.app.Grid; 37 import nextapp.echo2.app.Style; 38 import nextapp.echo2.app.StyleSheet; 39 import nextapp.echo2.app.componentxml.StyleSheetLoader; 40 41 44 public class IntegerPeerTest extends TestCase { 45 46 private StyleSheet styleSheet; 47 48 51 public void setUp() 52 throws Exception { 53 InputStream in = IntegerPeerTest.class.getResourceAsStream("IntegerPeerTest.stylesheet"); 54 styleSheet = StyleSheetLoader.load(in, StyleSheetLoaderTest.class.getClassLoader()); 55 in.close(); 56 } 57 58 public void testBasic() { 59 Style charlieStyle = styleSheet.getStyle(Grid.class, "charlie"); 60 assertEquals(new Integer (0), charlieStyle.getProperty("orientation")); 61 } 62 63 public void testIntrospectedConstant() { 64 Style deltaStyle = styleSheet.getStyle(Grid.class, "delta"); 65 assertEquals(new Integer (Grid.ORIENTATION_VERTICAL), deltaStyle.getProperty("orientation")); 66 } 67 } 68 | Popular Tags |