Some refactorings such as renaming affects multiple files in the workspace. On this moment, these files are collected in the refactoring rule. However, this multi-file behaviour should not occur when the refactoring is tested.

possible solutions: 1. define collection of asts as a separate task in .esv file, or 2. find out that refactoring is triggered from .spx file and prevent collecting asts in refactoring definition.


refactoring Id: “Rename” = rename-refactoring
input
identifier: “new name” = ""
asts = collect-asts-for-renaming

Submitted by Maartje on 26 July 2011 at 09:24

On 26 July 2011 at 09:24 Maartje tagged refactoring

On 26 July 2011 at 09:32 Maartje tagged error

On 26 July 2011 at 10:30 Lennart Kats commented:

#1 doesn’t seem very attractive. Some kind of sandbox behavior could be worked out for #2. Which primitives would have to behave differently in “testing” mode?


On 27 July 2011 at 15:29 Tobi Vollebregt commented:

Possible solution 3: implement a way to stub out certain strategies when running tests.

If interested, I have some prototype code for a strategy with-stub(victim, stub, body), which replaces the strategy victim with the strategy stub during the execution of body. (It does this using (ugly) dynamic proxy class generation using javassist + the static instance field all strategies have.)

Log in to post comments