Class: Quark::Quark::Test::MethodTest

Inherits:
Object
  • Object
show all
Extended by:
DatawireQuarkCore::Static
Defined in:
lib/quark/test.rb

Constant Summary

Constants included from DatawireQuarkCore::Static

DatawireQuarkCore::Static::Unassigned

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DatawireQuarkCore::Static

_lazy_statics, static, unlazy_statics

Constructor Details

#initialize(klass, method) ⇒ MethodTest

Returns a new instance of MethodTest.



378
379
380
381
382
383
384
385
# File 'lib/quark/test.rb', line 378

def initialize(klass, method)
    
    super(((klass.getName()) + (".")) + (method.getName()))
    (self).klass = klass
    (self).method = method

    nil
end

Instance Attribute Details

#klassObject

Returns the value of attribute klass.



371
372
373
# File 'lib/quark/test.rb', line 371

def klass
  @klass
end

#methodObject

Returns the value of attribute method.



371
372
373
# File 'lib/quark/test.rb', line 371

def method
  @method
end

Instance Method Details

#__init_fields__Object



474
475
476
477
478
479
480
481
# File 'lib/quark/test.rb', line 474

def __init_fields__()
    
    super
    self.klass = nil
    self.method = nil

    nil
end

#_getClassObject



412
413
414
415
416
417
# File 'lib/quark/test.rb', line 412

def _getClass()
    
    return "quark.test.MethodTest"

    nil
end

#_getField(name) ⇒ Object



419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# File 'lib/quark/test.rb', line 419

def _getField(name)
    
    if ((name) == ("ctx"))
        return ::Quark.quark.test.Test.ctx
    end
    if ((name) == ("name"))
        return (self).name
    end
    if ((name) == ("checks"))
        return (self).checks
    end
    if ((name) == ("successes"))
        return (self).successes
    end
    if ((name) == ("failures"))
        return (self).failures
    end
    if ((name) == ("klass"))
        return (self).klass
    end
    if ((name) == ("method"))
        return (self).method
    end
    return nil

    nil
end

#_setField(name, value) ⇒ Object



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# File 'lib/quark/test.rb', line 447

def _setField(name, value)
    
    if ((name) == ("ctx"))
        ::Quark.quark.test.Test.ctx = ::DatawireQuarkCore.cast(value) { ::DatawireQuarkCore::TLS }
    end
    if ((name) == ("name"))
        (self).name = ::DatawireQuarkCore.cast(value) { ::String }
    end
    if ((name) == ("checks"))
        (self).checks = ::DatawireQuarkCore.cast(value) { ::Integer }
    end
    if ((name) == ("successes"))
        (self).successes = ::DatawireQuarkCore.cast(value) { ::DatawireQuarkCore::List }
    end
    if ((name) == ("failures"))
        (self).failures = ::DatawireQuarkCore.cast(value) { ::DatawireQuarkCore::List }
    end
    if ((name) == ("klass"))
        (self).klass = ::DatawireQuarkCore.cast(value) { ::Quark.quark.reflect.QuarkClass }
    end
    if ((name) == ("method"))
        (self).method = ::DatawireQuarkCore.cast(value) { ::Quark.quark.reflect.Method }
    end

    nil
end

#runObject



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/quark/test.rb', line 390

def run()
    
    setup = @klass.getMethod("setup")
    teardown = @klass.getMethod("teardown")
    test = @klass.construct(::DatawireQuarkCore::List.new([]))
    if ((setup) != (nil))
        if (!(::Quark.quark.test.SafeMethodCaller.callMethod(setup, test)))
            ::Quark.quark.test.fail("setup invocation crashed")
        end
    end
    if (!(::Quark.quark.test.SafeMethodCaller.callMethod(@method, test)))
        ::Quark.quark.test.fail("test invocation crashed")
    end
    if ((teardown) != (nil))
        if (!(::Quark.quark.test.SafeMethodCaller.callMethod(teardown, test)))
            ::Quark.quark.test.fail("teardown invocation crashed")
        end
    end

    nil
end