Exemplo n.º 1
0
  @Test
  public void testAssertDefaultException() {
    Assert assertAction = new Assert();

    assertAction.setAction(new FailAction());

    assertAction.execute(context);
  }
Exemplo n.º 2
0
  @Test(expectedExceptions = CitrusRuntimeException.class)
  @SuppressWarnings({"unchecked", "rawtypes"})
  public void testMissingException() {
    Assert assertAction = new Assert();

    assertAction.setAction(new EchoAction());

    Class exceptionClass = CitrusRuntimeException.class;
    assertAction.setException(exceptionClass);

    assertAction.execute(context);
  }
Exemplo n.º 3
0
  @Test
  @SuppressWarnings({"unchecked", "rawtypes"})
  public void testAssertException() {
    Assert assertAction = new Assert();

    assertAction.setAction(new FailAction());

    Class exceptionClass = CitrusRuntimeException.class;
    assertAction.setException(exceptionClass);

    assertAction.execute(context);
  }
Exemplo n.º 4
0
  @Test(expectedExceptions = CitrusRuntimeException.class)
  @SuppressWarnings({"unchecked", "rawtypes"})
  public void testAssertExceptionWrongMessageCheck() {
    Assert assertAction = new Assert();

    FailAction fail = new FailAction();
    fail.setMessage("This went wrong!");

    assertAction.setAction(fail);

    Class exceptionClass = CitrusRuntimeException.class;
    assertAction.setException(exceptionClass);
    assertAction.setMessage("Excpected error is something else");

    assertAction.execute(context);
  }