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

📄 testtextboxprimitive.java

📁 考勤管理系统源码
💻 JAVA
字号:
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.FormPrimitives;import junit.framework.TestCase;import com.wiley.compBooks.EJwithUML.Base.TestUtilities.*;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core.*;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.ContentElements.*;import java.io.*;public class TestTextBoxPrimitive extends TestCase{  private TestFileSet testFileSet;  public TestTextBoxPrimitive(String name) throws IOException  {    super(name);    testFileSet = new TestFileSet("C:/EJwithUML2e/UnitTestResults/HtmlPrimitives/FormPrimitives/TextBoxPrimitive/");  }  public static void main(String[] args)  {    junit.textui.TestRunner.run(TestTextBoxPrimitive.class);  }  public void testSimpleTextBox() throws IOException  {    StringBuffer buffer = new StringBuffer();    TextBoxPrimitive text_box = new TextBoxPrimitive("favoriteBand");    text_box.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("SimpleTextBox.html", buffer.toString());    assertEquals("SimpleTextBox", match, true);  }  public void testTextBoxWithInitialValue() throws IOException  {    StringBuffer buffer = new StringBuffer();    TextBoxPrimitive text_box = new TextBoxPrimitive("favoriteBand");    text_box.setInitialValue("Pink Floyd");    text_box.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("WithInitialValue.html", buffer.toString());    assertEquals("WithInitialValue", match, true);  }  public void testTextBoxWithMasking() throws IOException  {    StringBuffer buffer = new StringBuffer();    TextBoxPrimitive text_box = new TextBoxPrimitive("favoriteBand");    text_box.setMasked();    text_box.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("WithMasking.html", buffer.toString());    assertEquals("WithMasking", match, true);  }  public void testHidden() throws IOException  {    StringBuffer buffer = new StringBuffer();    TextBoxPrimitive text_box = new TextBoxPrimitive("favoriteBand");    text_box.setHidden();    text_box.setInitialValue("secret band");    text_box.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("Hidden.html", buffer.toString());    assertEquals("Hidden", match, true);  }  public void testFiniteWidthAndCapacity() throws IOException  {    StringBuffer buffer = new StringBuffer();    TextBoxPrimitive text_box = new TextBoxPrimitive("favoriteBand");    text_box.setMaximumLength(10);    text_box.setWidth(5);    text_box.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("FiniteWidthAndCapacity.html", buffer.toString());    assertEquals("FiniteWidthAndCapacity", match, true);  }  public void testReadOnly() throws IOException  {    StringBuffer buffer = new StringBuffer();    TextBoxPrimitive text_box = new TextBoxPrimitive("favoriteBand");    text_box.setReadOnly();    text_box.setInitialValue("you can't change this");    text_box.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("ReadOnly.html", buffer.toString());    assertEquals("ReadOnly", match, true);  }  public void testWithStyle() throws IOException  {    StringBuffer buffer = new StringBuffer();    TextBoxPrimitive text_box = new TextBoxPrimitive("favoriteBand");    text_box.setStyle(Style.NORMAL_TEXT);    text_box.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("WithStyle.html", buffer.toString());    assertEquals("WithStyle", match, true);  }  public void testWithAlmostEverything() throws IOException  {    StringBuffer buffer = new StringBuffer();    TextBoxPrimitive text_box = new TextBoxPrimitive("favoriteBand");    text_box.setStyle(Style.NORMAL_TEXT);    text_box.setInitialValue("Pink Floyd");    text_box.setMaximumLength(10);    text_box.setWidth(5);    text_box.setMasked();    text_box.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("WithAlmostEverything.html", buffer.toString());    assertEquals("WithAlmostEverything", match, true);  }}

⌨️ 快捷键说明

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