assertion.java

来自「基于Junit的 功能和单元测试的的测试工具。只支持Swing.」· Java 代码 · 共 26 行

JAVA
26
字号
package org.uispec4j.assertion;

/**
 * Interface used for defining conditions. These assertions are meant to be used
 * essentially with the {@link UISpecAssert] "assertXxx" and "waitUntil" methods.
 */
public abstract class Assertion {

  /**
   * Returns true if the {@link #check()} method does not fail.
   */
  public final boolean isTrue() {
    try {
      check();
      return true;
    }
    catch (Throwable e) {
      return false;
    }
  }

  /**
   * Throws an exception if the condition is not true.
   */
  public abstract void check() throws Exception;
}

⌨️ 快捷键说明

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