testpageprimitive.java
来自「考勤管理系统源码」· Java 代码 · 共 48 行
JAVA
48 行
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Layout;import junit.framework.TestCase;import com.wiley.compBooks.EJwithUML.Base.TestUtilities.*;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.ContentElements.*;import java.io.*;public class TestPagePrimitive extends TestCase{ private TestFileSet testFileSet; public TestPagePrimitive(String name) throws IOException { super(name); testFileSet = new TestFileSet("C:/EJwithUML2e/UnitTestResults/HtmlPrimitives/Layout/PagePrimitive/"); } public void testEmptyPage() throws IOException { StringBuffer buffer = new StringBuffer(); PagePrimitive page = new PagePrimitive("no content here", null); page.buildContent(buffer); boolean match = testFileSet.fileMatchesGold("EmptyPage.html", buffer.toString()); assertEquals("EmptyPage", match, true); } public void testPopulatedPage() throws IOException { StringBuffer buffer = new StringBuffer(); LinkPrimitive link = new LinkPrimitive("www.javasoft.com"); link.addText(new TextPrimitive("Java Mecca")); TextPrimitive text = new TextPrimitive(); text.addText("Hi there"); text.addLineBreak(); text.addText("bye now"); PagePrimitive page = new PagePrimitive("some content here", "../../Default.css"); page.addToBody(link); page.addToBody(text); page.buildContent(buffer); boolean match = testFileSet.fileMatchesGold("PopulatedPage.html", buffer.toString()); assertEquals("PopulatedPage", match, true); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?