Namespaces:
  ns: test
  =: test
  e: ''

--- # ---------------------------------------------------------------------
# TestStaticsBase class - base class for TestStatics to test how static
# entities work in respect to class inheritance
--- # ---------------------------------------------------------------------
Name: TestStaticsBase

Properties:
  baseStaticProperty:
    Contract: $.string()
    Default: baseStaticProperty
    Usage: Static

  conflictingStaticProperty:
    Contract: $.string()
    Default: 'conflictingStaticProperty-base'
    Usage: Static

--- # ---------------------------------------------------------------------
# TestStatics class - main class for the static tests
--- # ---------------------------------------------------------------------
Name: TestStatics

Extends: TestStaticsBase

Properties:
  staticProperty:
    Contract: $.string()
    Usage: Static
    Default: xxx

  staticDictProperty:
    Contract: {}
    Usage: Static

  conflictingStaticProperty:
    Contract: $.string()
    Default: 'conflictingStaticProperty-child'
    Usage: Static

  instanceProperty:
    Contract: $.int()
    Default: 555

  staticProperty2:
    Contract: $.string()
    Default: staticProperty
    Usage: Static

Methods:
  testStaticTest:
    Usage: Static
    Body:
      Return: $

  testCallStaticMethodOnObject:
    Body:
      Return: $.simpleStaticMethod()

  testCallStaticMethodOnClassName:
    Body:
      Return: :TestStatics.simpleStaticMethod()

  testCallStaticMethodOnInvalidClass:
    Body:
      Return: e:TestUnicode.simpleStaticMethod()

  testCallStaticMethodOnClassNameWithNs:
    Body:
      Return: ns:TestStatics.simpleStaticMethod($.instanceProperty)

  testCallStaticMethodFromAnotherMethod:
    Body:
      Return: ns:TestStatics.simpleStaticMethod2()

  testStaticThis:
    Body:
      Return: $.returnStaticThis()

  testNoAccessToInstanceProperties:
    Body:
      Return: $.accessInstanceProperty()

  testAccessStaticPropertyFromInstanceMethod:
    Body:
      Return: $.staticProperty

  testAccessStaticPropertyFromStaticMethod:
    Body:
      Return: $.accessStaticProperty()

  simpleStaticMethod:
    Usage: Static
    Arguments:
      arg:
        Contract: $.int()
        Default: 0
    Body:
      Return: 123 + $arg

  simpleStaticMethod2:
    Usage: Static
    Body:
      Return: $.simpleStaticMethod() +
        $this.simpleStaticMethod() +
        ns:TestStatics.simpleStaticMethod() +
        :TestStatics.simpleStaticMethod() +
        type('test.TestStatics').simpleStaticMethod()

  returnStaticThis:
    Usage: Static
    Body:
      Return: $

  accessInstanceProperty:
    Usage: Static
    Body:
      Return: $.instanceProperty

  accessStaticProperty:
    Usage: Static
    Body:
      Return: $.staticProperty

  testModifyStaticPropertyUsingDollar:
    Body:
      Return: $.modifyStaticPropertyUsingDollar()

  modifyStaticPropertyUsingDollar:
    Usage: Static
    Body:
      - $.staticProperty: qq
      - Return: $.staticProperty

  testModifyStaticPropertyUsingThis:
    Body:
      Return: $.modifyStaticPropertyUsingThis()

  modifyStaticPropertyUsingThis:
    Usage: Static
    Body:
      - $this.staticProperty: qq
      - Return: $this.staticProperty

  testModifyStaticPropertyUsingClassName:
    Body:
      Return: $.modifyStaticPropertyUsingClassName()

  modifyStaticPropertyUsingClassName:
    Usage: Static
    Body:
      - :TestStatics.staticProperty: qq
      - Return: :TestStatics.staticProperty

  testModifyStaticPropertyUsingNsClassName:
    Body:
      Return: $.modifyStaticPropertyUsingNsClassName()

  modifyStaticPropertyUsingNsClassName:
    Usage: Static
    Body:
      - ns:TestStatics.staticProperty: qq
      - Return: ns:TestStatics.staticProperty

  testModifyStaticPropertyUsingTypeFunc:
    Body:
      Return: $.modifyStaticPropertyUsingTypeFunc()

  modifyStaticPropertyUsingTypeFunc:
    Usage: Static
    Body:
      - type('test.TestStatics').staticProperty: qq
      - Return: type('test.TestStatics').staticProperty

  testModifyStaticDictProperty:
    Body:
      Return: $.modifyStaticDictProperty()

  modifyStaticDictProperty:
    Usage: Static
    Body:
      - :TestStatics.staticDictProperty.key: value
      - Return: $.staticDictProperty

  testPropertyIsStatic:
    Body:
      Return: $.modifyStaticPropertyOnInstance()

  modifyStaticPropertyOnInstance:
    Usage: Static
    Body:
      - $obj1: new(TestStatics)
      - $obj2: new(TestStatics)
      - $obj1.modifyStaticPropertyUsingClassName()
      - Return: $obj2.staticProperty

  testStaticPropertisNotLoaded:
    Body:
      Return: $.staticProperty2

  testTypeIsSingleton:
    Body:
      - $t11: :TestStatics
      - $t12: :TestStatics
      - $t21: ns:TestStatics
      - $t22: ns:TestStatics
      - $t31: type('test.TestStatics')
      - $t32: type('test.TestStatics')
      - Return: $t11 = $t12 and $t21 = $t22 and $t31 = $t32

  testStaticPropertyInheritance:
    Body:
      Return: $.baseStaticProperty +
        :TestStaticsBase.baseStaticProperty +
        :TestStatics.baseStaticProperty

  testStaticPropertyOverride:
    Body:
      Return:
        - $.conflictingStaticProperty
        - :TestStatics.conflictingStaticProperty
        - :TestStaticsBase.conflictingStaticProperty
        - type('test.TestStatics').conflictingStaticProperty
        - type('test.TestStaticsBase').conflictingStaticProperty

  testTypeinfoOfType:
    Body:
      - $typeObj: type('test.TestStatics')
      - $typeInfoOfType: typeinfo($typeObj)
      - $obj: new('TestStatics')
      - Return: typeinfo($obj) = $typeInfoOfType

  testCallPythonStaticMethod:
    Body:
      Return:
        - $.staticPythonMethod(111)
        - :TestStatics.staticPythonMethod(111)
        - ns:TestStatics.staticPythonMethod(111)
        - type('test.TestStatics').staticPythonMethod(111)

  testCallPythonClassMethod:
    Body:
      Return:
        - $.classmethodPythonMethod('!')
        - :TestStatics.classmethodPythonMethod('!')
        - ns:TestStatics.classmethodPythonMethod('!')
        - type('test.TestStatics').classmethodPythonMethod('!')

  testStaticAction:
    Usage: Static
    Body:
      Return: 'It works!'