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

📄 textelementtest.java

📁 一个java工作流引擎
💻 JAVA
字号:
package org.jbpm.web.formgen;

import java.io.IOException;

import javax.servlet.jsp.JspWriter;

import junit.framework.TestCase;

public class TextElementTest extends TestCase {
  
  private TextElement textElement = null;
  private String writtenText = null;
  
  protected void setUp() {
    textElement = new TextElement("test");
    writtenText = null;
  }
  
  public void testConstruction() {
    assertNotNull("1", textElement);
    assertEquals("2", textElement.getText(), "test");
  }
  
  public void testWrite() throws Exception {
    textElement.write(new TestJspWriter(), null);
    assertEquals("1", writtenText, "test");
  }
  
  class TestJspWriter extends JspWriter {
    protected TestJspWriter() {super(0, false);}
    public void newLine() throws IOException {}
    public void print(boolean arg0) throws IOException {}
    public void print(char arg0) throws IOException {}
    public void print(int arg0) throws IOException {}
    public void print(long arg0) throws IOException {}
    public void print(float arg0) throws IOException {}
    public void print(double arg0) throws IOException {}
    public void print(char[] arg0) throws IOException {}
    public void print(String arg0) throws IOException {}
    public void print(Object arg0) throws IOException {}
    public void println() throws IOException {}
    public void println(boolean arg0) throws IOException {}
    public void println(char arg0) throws IOException {}
    public void println(int arg0) throws IOException {}
    public void println(long arg0) throws IOException {}
    public void println(float arg0) throws IOException {}
    public void println(double arg0) throws IOException {}
    public void println(char[] arg0) throws IOException {}
    public void println(String arg0) throws IOException {}
    public void println(Object arg0) throws IOException {}
    public void clear() throws IOException {}
    public void clearBuffer() throws IOException {}
    public void flush() throws IOException {}
    public void close() throws IOException {}
    public int getRemaining() {return 0;}
    public void write(char[] cbuf, int off, int len) throws IOException {
      writtenText = new String(cbuf).trim();
    }
  }

}

⌨️ 快捷键说明

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