Class List Method List File List

# Class: VertxUnit::EventBusCollector

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

## Overview

The event bus collector listen to events on the Vert.x event bus and translate them into reports.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxUnit::EventBusCollector) create(vertx = nil, reporter = nil) { ... }
- + (Object) EVENT_TEST_CASE_BEGIN
  Json type field value that signals a test case begins, used as part of the test reporting protocol for the event bus.
- + (Object) EVENT_TEST_CASE_END
  Json type field value that signals a test case ends, used as part of the test reporting protocol for the event bus.
- + (Object) EVENT_TEST_SUITE_BEGIN
  Json type field value that signals a test suite begins, used as part of the test reporting protocol for the event bus.
- + (Object) EVENT_TEST_SUITE_END
  Json type field value that signals a test suite ends, used as part of the test reporting protocol for the event bus.
- + (Object) EVENT_TEST_SUITE_ERROR
  Json type field value that reports a test suite error, used as part of the test reporting protocol for the event bus.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (::Vertx::MessageConsumer) register(address = nil)
  Register the collector as a consumer of the event bus with the specified address.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    21
    22
    23
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/event_bus_collector.rb', line 21

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

### + (`::VertxUnit::EventBusCollector`) create(vertx = nil, reporter = nil) { ... }

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`)

Yields:

Returns:

- (`::VertxUnit::EventBusCollector`)

Raises:

- (`ArgumentError`)

    39
    40
    41
    42
    43
    44
    45
    46
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/event_bus_collector.rb', line 39

    def self.create(vertx=nil,reporter=nil)
      if vertx.class.method_defined?(:j_del) && reporter.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtUnitCollect::EventBusCollector.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtUnitReport::ReportingOptions.java_class]).call(vertx.j_del,Java::IoVertxExtUnitReport::ReportingOptions.new(::Vertx::Util::Utils.to_json_object(reporter))),::VertxUnit::EventBusCollector)
      elsif vertx.class.method_defined?(:j_del) && block_given? && reporter == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtUnitCollect::EventBusCollector.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCore::Handler.java_class]).call(vertx.j_del,(Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxUnit::TestSuiteReport)) })),::VertxUnit::EventBusCollector)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{vertx},#{reporter})"
    end

### + (`Object`) EVENT_TEST_CASE_BEGIN

Json `type` field value that signals a test case begins, used as part of the test reporting protocol for the event bus.

    73
    74
    75
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/event_bus_collector.rb', line 73

    def self.EVENT_TEST_CASE_BEGIN
      Java::IoVertxExtUnitCollect::EventBusCollector.EVENT_TEST_CASE_BEGIN
    end

### + (`Object`) EVENT_TEST_CASE_END

Json `type` field value that signals a test case ends, used as part of the test reporting protocol for the event bus.

    78
    79
    80
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/event_bus_collector.rb', line 78

    def self.EVENT_TEST_CASE_END
      Java::IoVertxExtUnitCollect::EventBusCollector.EVENT_TEST_CASE_END
    end

### + (`Object`) EVENT_TEST_SUITE_BEGIN

Json `type` field value that signals a test suite begins, used as part of the test reporting protocol for the event bus.

    58
    59
    60
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/event_bus_collector.rb', line 58

    def self.EVENT_TEST_SUITE_BEGIN
      Java::IoVertxExtUnitCollect::EventBusCollector.EVENT_TEST_SUITE_BEGIN
    end

### + (`Object`) EVENT_TEST_SUITE_END

Json `type` field value that signals a test suite ends, used as part of the test reporting protocol for the event bus.

    63
    64
    65
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/event_bus_collector.rb', line 63

    def self.EVENT_TEST_SUITE_END
      Java::IoVertxExtUnitCollect::EventBusCollector.EVENT_TEST_SUITE_END
    end

### + (`Object`) EVENT_TEST_SUITE_ERROR

Json `type` field value that reports a test suite error, used as part of the test reporting protocol for the event bus.

    68
    69
    70
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/event_bus_collector.rb', line 68

    def self.EVENT_TEST_SUITE_ERROR
      Java::IoVertxExtUnitCollect::EventBusCollector.EVENT_TEST_SUITE_ERROR
    end

### + (`Object`) j_api_type

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

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

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

    def self.j_class
      Java::IoVertxExtUnitCollect::EventBusCollector.java_class
    end

### + (`Object`) unwrap(obj)

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

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

### + (`Object`) wrap(obj)

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

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

## Instance Method Details

### - (`::Vertx::MessageConsumer`) register(address = nil)

Register the collector as a consumer of the event bus with the specified address.

Parameters:

- address (`String`) (defaults to: `nil`) —
  the registration address

Returns:

- (`::Vertx::MessageConsumer`) —
  the subscribed message consumer

Raises:

- (`ArgumentError`)

    50
    51
    52
    53
    54
    55
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/event_bus_collector.rb', line 50

    def register(address=nil)
      if address.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:register, [Java::java.lang.String.java_class]).call(address),::Vertx::MessageConsumer)
      end
      raise ArgumentError, "Invalid arguments when calling register(#{address})"
    end