haltontype.java

来自「MoMEUnit是一个单元测试的J2ME的应用程序xUnit架构实例。这是来自J」· Java 代码 · 共 73 行

JAVA
73
字号
package org.momeunit.ant.taskdefs;import org.momeunit.ant.core.EnumType;/** * <code>haltonerror</code> and/or <code>haltonfailure</code> attribute * representation. Contains method for accessing attribute value as * <code>boolean</code> {@link #asBoolean()}. Contains method to check * whether to cease tests execution on halt {@link #isWithCease()}. *  * @author Sergio Morozov * @version 1.1.2 */public class HaltOnType extends EnumType{  private final static String[] VALUES = { "true", "yes", "false", "no", "on",      "off", "withcease" };  private final static boolean[] BOOLEAN_VALUES = { true, true, false, false,      true, false, true };  private final static boolean[] WITHCEASE = { false, false, false, false,      false, false, true };  /**   * Instantiates HaltOnType initialized with given value.   *    * @param value   *          HaltOnType to be initialized with.   * @since 1.1.2   */  public HaltOnType(String value)  {    super(value);  }  /*   * (non-Javadoc)   *    * @see org.drmoro.ant.EnumType#getValues()   */  protected String[] getValues()  {    return VALUES;  }  /**   * Returns <code>haltonerror</code>/<code>haltonfailure</code> attribute   * as boolean.   *    * @return <code>true</code> if build process should be stopped on error or   *         failure, <code>false</code> otherwise.   * @since 1.1.2   */  public boolean asBoolean()  {    return BOOLEAN_VALUES[getIndex()];  }  /**   * Checks whether to cease tests execution on halt.   *    * @return <code>true</code> if tests execution should be ceased on halt,   *         <code>false</code> otherwise.   * @since 1.1.2   */  public boolean isWithCease()  {    return WITHCEASE[getIndex()];  }}

⌨️ 快捷键说明

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