Class List Method List File List

# Class: VertxUnit::TestSuite

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

## Class Method Summary (collapse)

- + (Object) create(name = nil)

## Instance Method Summary (collapse)

- - (Object) after
- - (Object) after_each
- - (Object) before
- - (Object) before_each
- - (TestSuite) initialize(j_del) constructor
  A new instance of TestSuite.
- - (Object) j_del
- - (Object) run(param_1 = nil, param_2 = nil)
- - (Object) test(name = nil, repeat = nil)

## Constructor Details

### - (`TestSuite`) initialize(j_del)

Returns a new instance of TestSuite

    20
    21
    22
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_suite.rb', line 20

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create(name = nil)

Raises:

- (`ArgumentError`)

    31
    32
    33
    34
    35
    36
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_suite.rb', line 31

    def self.create(name=nil)
      if name.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtUnit::TestSuite.java_method(:create, [Java::java.lang.String.java_class]).call(name),::VertxUnit::TestSuite)
      end
      raise ArgumentError, "Invalid arguments when calling create(name)"
    end

## Instance Method Details

### - (`Object`) after

Raises:

- (`ArgumentError`)

    60
    61
    62
    63
    64
    65
    66
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_suite.rb', line 60

    def after
      if block_given?
        @j_del.java_method(:after, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxUnit::TestContext)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling after()"
    end

### - (`Object`) after_each

Raises:

- (`ArgumentError`)

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

    def after_each
      if block_given?
        @j_del.java_method(:afterEach, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxUnit::TestContext)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling after_each()"
    end

### - (`Object`) before

Raises:

- (`ArgumentError`)

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

    def before
      if block_given?
        @j_del.java_method(:before, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxUnit::TestContext)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling before()"
    end

### - (`Object`) before_each

Raises:

- (`ArgumentError`)

    50
    51
    52
    53
    54
    55
    56
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_suite.rb', line 50

    def before_each
      if block_given?
        @j_del.java_method(:beforeEach, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxUnit::TestContext)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling before_each()"
    end

### - (`Object`) j_del

    25
    26
    27
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_suite.rb', line 25

    def j_del
      @j_del
    end

### - (`Object`) run(param_1 = nil, param_2 = nil)

Raises:

- (`ArgumentError`)

    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-unit/test_suite.rb', line 106

    def run(param_1=nil,param_2=nil)
      if !block_given? && param_1 == nil && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:run, []).call(),::VertxUnit::TestCompletion)
      elsif param_1.class == Hash && !block_given? && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:run, [Java::IoVertxExtUnit::TestOptions.java_class]).call(Java::IoVertxExtUnit::TestOptions.new(::Vertx::Util::Utils.to_json_object(param_1))),::VertxUnit::TestCompletion)
      elsif param_1.class.method_defined?(:j_del) && !block_given? && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:run, [Java::IoVertxCore::Vertx.java_class]).call(param_1.j_del),::VertxUnit::TestCompletion)
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:run, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtUnit::TestOptions.java_class]).call(param_1.j_del,Java::IoVertxExtUnit::TestOptions.new(::Vertx::Util::Utils.to_json_object(param_2))),::VertxUnit::TestCompletion)
      end
      raise ArgumentError, "Invalid arguments when calling run(param_1,param_2)"
    end

### - (`Object`) test(name = nil, repeat = nil)

Raises:

- (`ArgumentError`)

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

    def test(name=nil,repeat=nil)
      if name.class == String && block_given? && repeat == nil
        @j_del.java_method(:test, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxUnit::TestContext)) }))
        return self
      elsif name.class == String && repeat.class == Fixnum && block_given?
        @j_del.java_method(:test, [Java::java.lang.String.java_class,Java::int.java_class,Java::IoVertxCore::Handler.java_class]).call(name,repeat,(Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxUnit::TestContext)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling test(name,repeat)"
    end