Multifile support causes problems for testing refactorings
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.
Submitted by Maartje on 26 July 2011 at 09:24
refactoring Id: “Rename” = rename-refactoring
input
identifier: “new name” = ""
asts = collect-asts-for-renaming
Issue Log
#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?
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