In the hidden test hiddenProgram2, all ParentClass subclasses ChildClass1 and ChildClass3 (despite its name ChildClass2 doesn't extend ParentClass) have the method def
public void method(){
System.out.println("k="+k);
}
where k is a field of ParentClass. My solution pulls that method but ARTE tells me
ssssssssssssss Triggering Pull-Up Method Refactoring ssssssssssssss
applyPullUpMethod(hidden.program.two.ParentClass, method)
Pulling up method to hidden.program.two.ParentClass
The rule did match!
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
FAILURE: Execution of refactoring has been expected to FAIL. (false-positive)
s
Why should it fail? method() is perfectly pullable, and ARTE itself confirms that the program behaves the same before and after the refactoring (at least when measured by its output).
By the way, what's the meaning of these "hidden" tests? I guess the first thing any solution writer does in her TestInterface implementation class is to copy the source java files ARTE generates into /tmp/ to somewhere else where they won't be deleted. So the only thing you can't see is the assertions it checks. Testing against some black box which just says "yes" or "no" without giving you a hint why it expects something else is really annoying.
In the hidden test
hiddenProgram2
, allParentClass
subclassesChildClass1
andChildClass3
(despite its nameChildClass2
doesn't extendParentClass
) have the method defwhere
k
is a field ofParentClass
. My solution pulls that method but ARTE tells meWhy should it fail?
method()
is perfectly pullable, and ARTE itself confirms that the program behaves the same before and after the refactoring (at least when measured by its output).By the way, what's the meaning of these "hidden" tests? I guess the first thing any solution writer does in her
TestInterface
implementation class is to copy the source java files ARTE generates into/tmp/
to somewhere else where they won't be deleted. So the only thing you can't see is the assertions it checks. Testing against some black box which just says "yes" or "no" without giving you a hint why it expects something else is really annoying.