Class: VertxUnit::Failure

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/failure.rb

Overview

A failure provides the details of a failure that happened during the execution of a test case.

The failure can be:

  • an assertion failure: an assertion failed
  • an error failure: an expected error occured

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


24
25
26
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/failure.rb', line 24

def @@j_api_type.accept?(obj)
  obj.class == Failure
end

+ (Object) j_api_type



33
34
35
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/failure.rb', line 33

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



36
37
38
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/failure.rb', line 36

def self.j_class
  Java::IoVertxExtUnitReport::Failure.java_class
end

+ (Object) unwrap(obj)



30
31
32
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/failure.rb', line 30

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



27
28
29
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/failure.rb', line 27

def @@j_api_type.wrap(obj)
  Failure.new(obj)
end

Instance Method Details

- (true, false) isError

Returns true if the failure is an error failure otherwise it is an assertion failure

Returns:

  • (true, false)
    true if the failure is an error failure otherwise it is an assertion failure


41
42
43
44
45
46
47
48
49
50
51
52
53
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/failure.rb', line 41

def error?
  if !block_given?
    if @cached_is_error != nil
      return @cached_is_error
    end
    return @cached_is_error = @j_del.java_method(:isError, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling error?()"
  end
end

- (String) message

Returns the error message

Returns:

  • (String)
    the error message


71
72
73
74
75
76
77
78
79
80
81
82
83
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/failure.rb', line 71

def message
  if !block_given?
    if @cached_message != nil
      return @cached_message
    end
    return @cached_message = @j_del.java_method(:message, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling message()"
  end
end

- (String) stackTrace

Returns the stack trace

Returns:

  • (String)
    the stack trace


56
57
58
59
60
61
62
63
64
65
66
67
68
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/failure.rb', line 56

def stack_trace
  if !block_given?
    if @cached_stack_trace != nil
      return @cached_stack_trace
    end
    return @cached_stack_trace = @j_del.java_method(:stackTrace, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling stack_trace()"
  end
end