[test-runner] Injected methods do not provide access to the original (target) object

Bug #1596872 reported by Alexander Tivelkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Opinion
Medium
Unassigned

Bug Description

When a method in a test-runner's TestFixture is injected into some existing class or object the injected code does not have access to the original object it is injected to: in the method's execution context $this will mean the object owning the injected method (e.g. a Fixture), not the object the method is injected to.

Tags: test-runner
Changed in murano:
importance: Undecided → Medium
tags: added: test-runner
Changed in murano:
milestone: none → newton-2
Changed in murano:
milestone: newton-2 → newton-3
Changed in murano:
status: New → Confirmed
Changed in murano:
milestone: newton-3 → newton-rc1
Revision history for this message
Valerii Kovalchuk (vakovalchuk) wrote :

Isn't it done for purpose to be able to call $.assertEqual and to increment counters on Fixture object, like it is done in TomcatTest?

# Mock method to replace the original one
    agentMock:
      Arguments:
        - template:
            Contract: $
        - resources:
            Contract: $
        - timeout:
            Contract: $
            Default: null
      Body:
        - $.log.info('Mocking murano agent')
        - $.assertEqual('Deploy Tomcat', $template.Name)
        - $.agentCallCount: $.agentCallCount + 1

Changed in murano:
status: Confirmed → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.