1 29 30 package nextapp.echo2.app.test.componentxml; 31 32 import java.io.InputStream ; 33 34 import junit.framework.TestCase; 35 import nextapp.echo2.app.Extent; 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 IndexedPropertyTest extends TestCase { 45 46 private StyleSheet styleSheet; 47 48 51 public void setUp() 52 throws Exception { 53 InputStream in = AlignmentPeerTest.class.getResourceAsStream("IndexedPropertyTest.stylesheet"); 54 styleSheet = StyleSheetLoader.load(in, StyleSheetLoaderTest.class.getClassLoader()); 55 in.close(); 56 } 57 58 public void testIndexedProperties() { 59 Style alphaStyle = styleSheet.getStyle(Grid.class, "alpha"); 60 assertEquals(new Extent(100), alphaStyle.getIndexedProperty(Grid.PROPERTY_COLUMN_WIDTH, 0)); 61 assertEquals(new Extent(200), alphaStyle.getIndexedProperty(Grid.PROPERTY_COLUMN_WIDTH, 1)); 62 } 63 } 64 | Popular Tags |