Class List Method List File List

# Class: VertxUnit::TestContext

Inherits:
  Object
  - Object
  - VertxUnit::TestContext
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb

## Instance Method Summary (collapse)

- - (Object) assert_equals(expected = nil, actual = nil, message = nil)
- - (Object) assert_false(condition = nil, message = nil)
- - (Object) assert_in_range(expected = nil, actual = nil, delta = nil, message = nil)
- - (Object) assert_not_equals(first = nil, second = nil, message = nil)
- - (Object) assert_not_null(expected = nil, message = nil)
- - (Object) assert_null(expected = nil, message = nil)
- - (Object) assert_true(condition = nil, message = nil)
- - (Object) async(count = nil)
- - (Object) async_assert_failure
- - (Object) async_assert_success
- - (Object) exception_handler
- - (Object) fail(param_1 = nil)
- - (Object) get(key = nil)
- - (TestContext) initialize(j_del) constructor
  A new instance of TestContext.
- - (Object) j_del
- - (Object) put(key = nil, value = nil)
- - (Object) remove(key = nil)

## Constructor Details

### - (`TestContext`) initialize(j_del)

Returns a new instance of TestContext

    10
    11
    12
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 10

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) assert_equals(expected = nil, actual = nil, message = nil)

Raises:

- (`ArgumentError`)

    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 114

    def assert_equals(expected=nil,actual=nil,message=nil)
      if (expected.class == String  || expected.class == Hash || expected.class == Array || expected.class == NilClass || expected.class == TrueClass || expected.class == FalseClass || expected.class == Fixnum || expected.class == Float) && (actual.class == String  || actual.class == Hash || actual.class == Array || actual.class == NilClass || actual.class == TrueClass || actual.class == FalseClass || actual.class == Fixnum || actual.class == Float) && !block_given? && message == nil
        @j_del.java_method(:assertEquals, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(expected),::Vertx::Util::Utils.to_object(actual))
        return self
      elsif (expected.class == String  || expected.class == Hash || expected.class == Array || expected.class == NilClass || expected.class == TrueClass || expected.class == FalseClass || expected.class == Fixnum || expected.class == Float) && (actual.class == String  || actual.class == Hash || actual.class == Array || actual.class == NilClass || actual.class == TrueClass || actual.class == FalseClass || actual.class == Fixnum || actual.class == Float) && message.class == String && !block_given?
        @j_del.java_method(:assertEquals, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.String.java_class]).call(::Vertx::Util::Utils.to_object(expected),::Vertx::Util::Utils.to_object(actual),message)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling assert_equals(expected,actual,message)"
    end

### - (`Object`) assert_false(condition = nil, message = nil)

Raises:

- (`ArgumentError`)

    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 98

    def assert_false(condition=nil,message=nil)
      if (condition.class == TrueClass || condition.class == FalseClass) && !block_given? && message == nil
        @j_del.java_method(:assertFalse, [Java::boolean.java_class]).call(condition)
        return self
      elsif (condition.class == TrueClass || condition.class == FalseClass) && message.class == String && !block_given?
        @j_del.java_method(:assertFalse, [Java::boolean.java_class,Java::java.lang.String.java_class]).call(condition,message)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling assert_false(condition,message)"
    end

### - (`Object`) assert_in_range(expected = nil, actual = nil, delta = nil, message = nil)

Raises:

- (`ArgumentError`)

    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 132

    def assert_in_range(expected=nil,actual=nil,delta=nil,message=nil)
      if expected.class == Float && actual.class == Float && delta.class == Float && !block_given? && message == nil
        @j_del.java_method(:assertInRange, [Java::double.java_class,Java::double.java_class,Java::double.java_class]).call(::Vertx::Util::Utils.to_double(expected),::Vertx::Util::Utils.to_double(actual),::Vertx::Util::Utils.to_double(delta))
        return self
      elsif expected.class == Float && actual.class == Float && delta.class == Float && message.class == String && !block_given?
        @j_del.java_method(:assertInRange, [Java::double.java_class,Java::double.java_class,Java::double.java_class,Java::java.lang.String.java_class]).call(::Vertx::Util::Utils.to_double(expected),::Vertx::Util::Utils.to_double(actual),::Vertx::Util::Utils.to_double(delta),message)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling assert_in_range(expected,actual,delta,message)"
    end

### - (`Object`) assert_not_equals(first = nil, second = nil, message = nil)

Raises:

- (`ArgumentError`)

    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 148

    def assert_not_equals(first=nil,second=nil,message=nil)
      if (first.class == String  || first.class == Hash || first.class == Array || first.class == NilClass || first.class == TrueClass || first.class == FalseClass || first.class == Fixnum || first.class == Float) && (second.class == String  || second.class == Hash || second.class == Array || second.class == NilClass || second.class == TrueClass || second.class == FalseClass || second.class == Fixnum || second.class == Float) && !block_given? && message == nil
        @j_del.java_method(:assertNotEquals, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(first),::Vertx::Util::Utils.to_object(second))
        return self
      elsif (first.class == String  || first.class == Hash || first.class == Array || first.class == NilClass || first.class == TrueClass || first.class == FalseClass || first.class == Fixnum || first.class == Float) && (second.class == String  || second.class == Hash || second.class == Array || second.class == NilClass || second.class == TrueClass || second.class == FalseClass || second.class == Fixnum || second.class == Float) && message.class == String && !block_given?
        @j_del.java_method(:assertNotEquals, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.String.java_class]).call(::Vertx::Util::Utils.to_object(first),::Vertx::Util::Utils.to_object(second),message)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling assert_not_equals(first,second,message)"
    end

### - (`Object`) assert_not_null(expected = nil, message = nil)

Raises:

- (`ArgumentError`)

    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 68

    def assert_not_null(expected=nil,message=nil)
      if (expected.class == String  || expected.class == Hash || expected.class == Array || expected.class == NilClass || expected.class == TrueClass || expected.class == FalseClass || expected.class == Fixnum || expected.class == Float) && !block_given? && message == nil
        @j_del.java_method(:assertNotNull, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(expected))
        return self
      elsif (expected.class == String  || expected.class == Hash || expected.class == Array || expected.class == NilClass || expected.class == TrueClass || expected.class == FalseClass || expected.class == Fixnum || expected.class == Float) && message.class == String && !block_given?
        @j_del.java_method(:assertNotNull, [Java::java.lang.Object.java_class,Java::java.lang.String.java_class]).call(::Vertx::Util::Utils.to_object(expected),message)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling assert_not_null(expected,message)"
    end

### - (`Object`) assert_null(expected = nil, message = nil)

Raises:

- (`ArgumentError`)

    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 53

    def assert_null(expected=nil,message=nil)
      if (expected.class == String  || expected.class == Hash || expected.class == Array || expected.class == NilClass || expected.class == TrueClass || expected.class == FalseClass || expected.class == Fixnum || expected.class == Float) && !block_given? && message == nil
        @j_del.java_method(:assertNull, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(expected))
        return self
      elsif (expected.class == String  || expected.class == Hash || expected.class == Array || expected.class == NilClass || expected.class == TrueClass || expected.class == FalseClass || expected.class == Fixnum || expected.class == Float) && message.class == String && !block_given?
        @j_del.java_method(:assertNull, [Java::java.lang.Object.java_class,Java::java.lang.String.java_class]).call(::Vertx::Util::Utils.to_object(expected),message)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling assert_null(expected,message)"
    end

### - (`Object`) assert_true(condition = nil, message = nil)

Raises:

- (`ArgumentError`)

    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 83

    def assert_true(condition=nil,message=nil)
      if (condition.class == TrueClass || condition.class == FalseClass) && !block_given? && message == nil
        @j_del.java_method(:assertTrue, [Java::boolean.java_class]).call(condition)
        return self
      elsif (condition.class == TrueClass || condition.class == FalseClass) && message.class == String && !block_given?
        @j_del.java_method(:assertTrue, [Java::boolean.java_class,Java::java.lang.String.java_class]).call(condition,message)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling assert_true(condition,message)"
    end

### - (`Object`) async(count = nil)

Raises:

- (`ArgumentError`)

    184
    185
    186
    187
    188
    189
    190
    191
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 184

    def async(count=nil)
      if !block_given? && count == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:async, []).call(),::VertxUnit::Async)
      elsif count.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:async, [Java::int.java_class]).call(count),::VertxUnit::Async)
      end
      raise ArgumentError, "Invalid arguments when calling async(count)"
    end

### - (`Object`) async_assert_failure

Raises:

- (`ArgumentError`)

    218
    219
    220
    221
    222
    223
    224
    225
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 218

    def async_assert_failure
      if !block_given?
        return ::Vertx::Util::Utils.to_async_result_handler_proc(@j_del.java_method(:asyncAssertFailure, []).call()) { |val| ::Vertx::Util::Utils.to_object(val) }
      elsif block_given?
        return ::Vertx::Util::Utils.to_async_result_handler_proc(@j_del.java_method(:asyncAssertFailure, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) }))) { |val| ::Vertx::Util::Utils.to_object(val) }
      end
      raise ArgumentError, "Invalid arguments when calling async_assert_failure()"
    end

### - (`Object`) async_assert_success

Raises:

- (`ArgumentError`)

    203
    204
    205
    206
    207
    208
    209
    210
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 203

    def async_assert_success
      if !block_given?
        return ::Vertx::Util::Utils.to_async_result_handler_proc(@j_del.java_method(:asyncAssertSuccess, []).call()) { |val| ::Vertx::Util::Utils.to_object(val) }
      elsif block_given?
        return ::Vertx::Util::Utils.to_async_result_handler_proc(@j_del.java_method(:asyncAssertSuccess, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_object(event)) }))) { |val| ::Vertx::Util::Utils.to_object(val) }
      end
      raise ArgumentError, "Invalid arguments when calling async_assert_success()"
    end

### - (`Object`) exception_handler

Raises:

- (`ArgumentError`)

    227
    228
    229
    230
    231
    232
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 227

    def exception_handler
      if !block_given?
        return ::Vertx::Util::Utils.to_handler_proc(@j_del.java_method(:exceptionHandler, []).call()) { |val| ::Vertx::Util::Utils.to_throwable(val) }
      end
      raise ArgumentError, "Invalid arguments when calling exception_handler()"
    end

### - (`Object`) fail(param_1 = nil)

Raises:

- (`ArgumentError`)

    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 165

    def fail(param_1=nil)
      if !block_given? && param_1 == nil
        return @j_del.java_method(:fail, []).call()
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:fail, [Java::java.lang.String.java_class]).call(param_1)
      elsif param_1.is_a?(Exception) && !block_given?
        return @j_del.java_method(:fail, [Java::JavaLang::Throwable.java_class]).call(::Vertx::Util::Utils.to_throwable(param_1))
      end
      raise ArgumentError, "Invalid arguments when calling fail(param_1)"
    end

### - (`Object`) get(key = nil)

Raises:

- (`ArgumentError`)

    21
    22
    23
    24
    25
    26
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 21

    def get(key=nil)
      if key.class == String && !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:get, [Java::java.lang.String.java_class]).call(key))
      end
      raise ArgumentError, "Invalid arguments when calling get(key)"
    end

### - (`Object`) j_del

    15
    16
    17
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 15

    def j_del
      @j_del
    end

### - (`Object`) put(key = nil, value = nil)

Raises:

- (`ArgumentError`)

    33
    34
    35
    36
    37
    38
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 33

    def put(key=nil,value=nil)
      if key.class == String && (value.class == String  || value.class == Hash || value.class == Array || value.class == NilClass || value.class == TrueClass || value.class == FalseClass || value.class == Fixnum || value.class == Float) && !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:put, [Java::java.lang.String.java_class,Java::java.lang.Object.java_class]).call(key,::Vertx::Util::Utils.to_object(value)))
      end
      raise ArgumentError, "Invalid arguments when calling put(key,value)"
    end

### - (`Object`) remove(key = nil)

Raises:

- (`ArgumentError`)

    42
    43
    44
    45
    46
    47
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_context.rb', line 42

    def remove(key=nil)
      if key.class == String && !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:remove, [Java::java.lang.String.java_class]).call(key))
      end
      raise ArgumentError, "Invalid arguments when calling remove(key)"
    end