Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New feature for global (constructor) mocks: mock instance registratio…
…n callback I implemented this in Javassist first, then migrated the solution to ASM + BB. Actually, the Javassist version only works with '-noverify' because there of Javassist bug jboss-javassist/javassist#328. Status quo: - ConstructorMockRegistry.isMockUnderConstruction() now returns an int instead of a boolean. Negative value means: no mock under construction. Positive values reflect the stack depth of constructors, i.e. 1 means that the top-level constructor (TLC) is currently being executed. This is utilised in order to only call ConstructorMockRegistry.registerMockInstance(this) after the super() returns to the TLC. - ConstructorMockRegistry.mockInstances is a private static Set<Object> in which all new object instances are registered, but it is not being used anywhere yet and does not even have an accessor method. TODO: * 'unregister' method * automatic unregistration if mock class is deactivated * grouping instances by class or class name -> turn the Set into a Map
- Loading branch information
Showing
6 changed files
with
101 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters