⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testlinkprimitive.java

📁 考勤管理系统源码
💻 JAVA
字号:
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 java.io.*;public class TestLinkPrimitive extends TestCase{  private TestFileSet testFileSet;  public TestLinkPrimitive(String name) throws IOException  {    super(name);    testFileSet = new TestFileSet("C:/EJwithUML2e/UnitTestResults/HtmlPrimitives/ContentElements/LinkPrimitive/");  }  public void testEmptyLink() throws IOException  {    LinkPrimitive link = new LinkPrimitive("http://www.javasoft.com");    StringBuffer buffer = new StringBuffer();    link.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("EmptyLink.html", buffer.toString());    assertEquals("EmptyLink", match, true);  }  public void testSimpleTextLink() throws IOException  {    TextPrimitive text = new TextPrimitive("Java Mecca");    LinkPrimitive link = new LinkPrimitive("http://www.javasoft.com");    link.addText(text);    StringBuffer buffer = new StringBuffer();    link.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("SimpleTextLink.html", buffer.toString());    assertEquals("SimpleTextLink", match, true);  }  public void testImageLink() throws IOException  {    ImagePrimitive image = new ImagePrimitive("./pic.jpg");    image.setSize(50,50);    image.setAlternateText("A completely unrelated image");    LinkPrimitive link = new LinkPrimitive("http://www.javasoft.com");    link.addImage(image);    StringBuffer buffer = new StringBuffer();    link.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("ImageLink.html", buffer.toString());    assertEquals("ImageLink", match, true);  }  public void testStyledTextLink() throws IOException  {    TextPrimitive text = new TextPrimitive("Java Mecca");    LinkPrimitive link = new LinkPrimitive("http://www.javasoft.com");    link.addText(text);    link.setStyle(Style.IMPORTANT_TEXT);    StringBuffer buffer = new StringBuffer();    link.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("StyledTextLink.html", buffer.toString());    assertEquals("StyledTextLink", match, true);  }}

⌨️ 快捷键说明

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