1 29 30 package nextapp.echo2.webcontainer.test; 31 32 import nextapp.echo2.app.Border; 33 import nextapp.echo2.app.Color; 34 import nextapp.echo2.app.Extent; 35 import nextapp.echo2.webcontainer.propertyrender.BorderRender; 36 import nextapp.echo2.webrender.output.CssStyle; 37 import junit.framework.TestCase; 38 39 42 public class BorderRenderTest extends TestCase { 43 44 public void testNull() { 45 CssStyle cssStyle = new CssStyle(); 46 Border border = new Border(null, null, Border.STYLE_NONE); 47 BorderRender.renderToStyle(cssStyle, border); 48 assertEquals("none", cssStyle.getAttribute("border")); 49 } 50 51 public void testAll() { 52 CssStyle cssStyle = new CssStyle(); 53 Border border = new Border(new Extent(20, Extent.PX), Color.GREEN, Border.STYLE_SOLID); 54 BorderRender.renderToStyle(cssStyle, border); 55 assertEquals("20px solid #00ff00", cssStyle.getAttribute("border")); 56 } 57 } 58 | Popular Tags |