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

📄 testimageprimitive.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 TestImagePrimitive extends TestCase{  private TestFileSet testFileSet;  public TestImagePrimitive(String name) throws IOException  {    super(name);    testFileSet = new TestFileSet("C:/EJwithUML2e/UnitTestResults/HtmlPrimitives/ContentElements/ImagePrimitive/");  }  public void testSimpleImage() throws IOException  {    StringBuffer buffer = new StringBuffer();    ImagePrimitive image = new ImagePrimitive("./pic.jpg");    image.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("SimpleImage.html", buffer.toString());    assertEquals("SimpleImage", match, true);  }  public void testSizedImage() throws IOException  {    StringBuffer buffer = new StringBuffer();    ImagePrimitive image = new ImagePrimitive("./pic.jpg");    image.setSize(50, 50);    image.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("SizedImage.html", buffer.toString());    assertEquals("SizedImage", match, true);  }  public void testAlternateTextImage() throws IOException  {    StringBuffer buffer = new StringBuffer();    ImagePrimitive image = new ImagePrimitive("./pic.jpg");    image.setAlternateText("A fairly pointless but hopefully diverting picture.");    image.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("AlternateText.html", buffer.toString());    assertEquals("AlternateText", match, true);  }  public void testStyledImage() throws IOException  {    StringBuffer buffer = new StringBuffer();    ImagePrimitive image = new ImagePrimitive("./pic.jpg");    image.setStyle(Style.NORMAL_IMAGE);    image.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("StyledImage.html", buffer.toString());    assertEquals("StyledImage", match, true);  }  public void testComplexImage() throws IOException  {    StringBuffer buffer = new StringBuffer();    ImagePrimitive image = new ImagePrimitive("./pic.jpg");    image.setAlternateText("A fairly pointless but hopefully diverting picture.");    image.setSize(50,50);    image.setStyle(Style.NORMAL_IMAGE);    image.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("ComplexImage.html", buffer.toString());    assertEquals("ComplexImage", match, true);  }}

⌨️ 快捷键说明

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