Exemplo n.º 1
0
  @Before
  public void init() {
    AdempiereTestHelper.get().init();

    calloutFactory = new MockedCalloutFactory();

    calloutExecutor = new CalloutExecutor(Env.getCtx(), 0);
    calloutExecutor.setCalloutFactory(calloutFactory);

    this.field = new PlainCalloutField();
    field.setAD_Column_ID(POJOLookupMap.get().nextId(I_AD_Column.Table_Name));
  }
  /**
   * Called after a test failed. It:
   *
   * <ul>
   *   <li>dump database content
   * </ul>
   */
  @Override
  protected void failed(final Throwable e, final Description description) {
    POJOLookupMap.get().dumpStatus("After test failed: " + description.getDisplayName());

    //
    // Dump retained context values
    for (final Entry<String, Object> entry : context.entrySet()) {
      final String name = entry.getKey();
      final Object value = entry.getValue();
      System.out.println("\n" + name + ": " + value);
    }
  }
 /**
  * Called after a test finished (successful or not). It:
  *
  * <ul>
  *   <li>clears database content
  * </ul>
  */
 @Override
 protected void finished(final Description description) {
   POJOLookupMap.get().clear();
   context.clear();
 }