testparagraphprimitive.java

来自「考勤管理系统源码」· Java 代码 · 共 44 行

JAVA
44
字号
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.ContentElements;import junit.framework.*;import com.wiley.compBooks.EJwithUML.Base.TestUtilities.*;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core.*;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Layout.*;import java.io.*;public class TestParagraphPrimitive extends TestCase{  private TestFileSet testFileSet;  public TestParagraphPrimitive(String name) throws IOException  {    super(name);    testFileSet = new TestFileSet("C:/EJwithUML2e/UnitTestResults/HtmlPrimitives/ContentElements/ParagraphPrimitive/");  }  public void testVariedStyles() throws IOException  {    StringBuffer buffer = new StringBuffer();    ImagePrimitive image = new ImagePrimitive("./pic.jpg");    ParagraphPrimitive title = new ParagraphPrimitive(Style.PAGE_TITLE,"The Document");    ParagraphPrimitive content = new ParagraphPrimitive(Style.NORMAL_TEXT,"The rain in spain falls mainly on the plains.");    content.addText("Except when it falls on the hills...");    content.addLineBreak();    content.addText(Style.WARNING_TEXT, "Weather is fickle");    content.addLineBreak();    content.addText("some more normal text");    content.addText(Style.FINEPRINT_TEXT, "This information is completely silly. It is not intended for reproduction or really even for reading. it merely demonstrates some styles. The author actually has NO training in meterology.");    PagePrimitive page = new PagePrimitive("Varied Styles", "../../Default.css");    page.addToBody(title);    page.addToBody(content);    page.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("VariedStyles.html", buffer.toString());    assertEquals("VariedStyles", match, true);  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?