Class: VertxUnit::TestSuiteReport

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

Overview

The test suite reports is basically a stream of events reporting the test suite execution.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)

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

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

+ (Object) j_api_type


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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class


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

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

+ (Object) unwrap(obj)


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

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

+ (Object) wrap(obj)


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

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

Instance Method Details

- (self) end_handler { ... }

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)

95
96
97
98
99
100
101
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_suite_report.rb', line 95

def end_handler
  if block_given?
    @j_del.java_method(:endHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
    return self
  end
  raise ArgumentError, "Invalid arguments when calling end_handler()"
end

- (self) exception_handler { ... }

Set an exception handler, the exception handler reports the test suite errors, it can be called mulitple times before the test ends.

Yields:

  • the exception handler

Returns:

  • (self)

Raises:

  • (ArgumentError)

61
62
63
64
65
66
67
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_suite_report.rb', line 61

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

- (self) fetch(amount = nil)

Fetch the specified amount of elements. If the ReadStream has been paused, reading will recommence with the specified amount of items, otherwise the specified amount will be added to the current stream demand.

Parameters:

  • amount (Fixnum) (defaults to: nil)

Returns:

  • (self)

Raises:

  • (ArgumentError)

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

def fetch(amount=nil)
  if amount.class == Fixnum && !block_given?
    @j_del.java_method(:fetch, [Java::long.java_class]).call(amount)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling fetch(#{amount})"
end

- (self) handler { ... }

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)

70
71
72
73
74
75
76
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_suite_report.rb', line 70

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

- (String) name

Returns the test suite name

Returns:

  • (String)
    the test suite name

Raises:

  • (ArgumentError)

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

def name
  if !block_given?
    if @cached_name != nil
      return @cached_name
    end
    return @cached_name = @j_del.java_method(:name, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling name()"
end

- (self) pause

Returns:

  • (self)

Raises:

  • (ArgumentError)

78
79
80
81
82
83
84
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_suite_report.rb', line 78

def pause
  if !block_given?
    @j_del.java_method(:pause, []).call()
    return self
  end
  raise ArgumentError, "Invalid arguments when calling pause()"
end

- (self) resume

Returns:

  • (self)

Raises:

  • (ArgumentError)

86
87
88
89
90
91
92
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_suite_report.rb', line 86

def resume
  if !block_given?
    @j_del.java_method(:resume, []).call()
    return self
  end
  raise ArgumentError, "Invalid arguments when calling resume()"
end