1 29 30 package nextapp.echo2.webcontainer.test; 31 32 import nextapp.echo2.app.Extent; 33 import nextapp.echo2.app.Font; 34 import nextapp.echo2.webcontainer.propertyrender.FontRender; 35 import nextapp.echo2.webrender.output.CssStyle; 36 import junit.framework.TestCase; 37 38 41 public class FontRenderTest extends TestCase { 42 43 public void testFontRender() { 44 Font font = new Font(Font.VERDANA, Font.BOLD | Font.UNDERLINE, new Extent(12, Extent.PT)); 45 CssStyle cssStyle = new CssStyle(); 46 FontRender.renderToStyle(cssStyle, font); 47 assertEquals("Verdana,Arial,Helvetica,Sans-Serif", cssStyle.getAttribute("font-family")); 48 assertEquals("bold", cssStyle.getAttribute("font-weight")); 49 assertEquals("underline", cssStyle.getAttribute("text-decoration")); 50 assertEquals(null, cssStyle.getAttribute("font-style")); 51 } 52 } 53 | Popular Tags |