📄 testpageprimitive.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -