Echtzeitsysteme / java-refactoring-ttc

Object-oriented Refactoring of Java Programs using Graph Transformation (TTC'2015)
0 stars 0 forks source link

Why should hidden_pum2_2 succeed? #23

Closed tsdh closed 9 years ago

tsdh commented 9 years ago

This test tries applyPullUpMethod(hidden.program.two.ParentClass, second).

ParentClass has the subclasses ChildClass1 and ChildClass3 but only ChildClass1 has a method second(). ChildClass2 also has a second() method but it is no subclass of ParentClass.

Shouldn't the PUM refactoring only be applicable if all subclasses have a declaration of the method to be pulled up?

SvenPeldszus commented 9 years ago

Yes, you are right I think at this point we switched the assertions with the refactoring you had problems with before.

I've fixt it.

tsdh commented 9 years ago

Now I get this output:

Executing hidden test case: "hidden_pum2_2"
    Description:
        Do method calls confuse your solution?

SUCCESS: The java program has been compiled.

    Output of execution before refactoring:
        k=3
        k=3

sssssssssssssss Triggering Program Graph Generation ssssssssssssssss
createProgramGraph(/tmp/tmp_ttc/hiddenProgram2)
Deleting folder /home/horn/tmp/JR
Copying program to /home/horn/tmp/JR/hiddenProgram2
Parsing file /tmp/tmp_ttc/hiddenProgram2/src/hidden/program/two/ParentClass.java... Done
Parsing file /tmp/tmp_ttc/hiddenProgram2/src/hidden/program/two/ChildClass3.java... Done
Parsing file /tmp/tmp_ttc/hiddenProgram2/src/hidden/program/two/ChildClass2.java... Done
Parsing file /tmp/tmp_ttc/hiddenProgram2/src/hidden/program/two/ChildClass1.java... Done
Base-package is hidden
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

ssssssssssssss  Triggering Pull-Up Method Refactoring ssssssssssssss
applyPullUpMethod(hidden.program.two.ParentClass, second)
The rule didn't match!
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

ssssssssssss  Triggering Synchronization with Java Code ssssssssssss
synchronizeChanges(): 0 changes to be applied
Saving resource to /tmp/tmp_ttc/hiddenProgram2/src/hidden/program/two/ParentClass.java
Saving resource to /tmp/tmp_ttc/hiddenProgram2/src/hidden/program/two/ChildClass3.java
Saving resource to /tmp/tmp_ttc/hiddenProgram2/src/hidden/program/two/ChildClass2.java
Saving resource to /tmp/tmp_ttc/hiddenProgram2/src/hidden/program/two/ChildClass1.java
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

SUCCESS: This static check whether a class contains a specific method or field was successful.
FAILURE: Containment of element expected but is not contained. (false-negative)

    Output of execution after refactoring:
        k=3
        k=3

SUCCESS: Output before and after refactoring are equal.

--------------------------------------------------------------------
FAILURE: Test case "hidden_pum2_2" has not been executed successfully.
The solution needed 0.029 seconds for execution. 
--------------------------------------------------------------------

So now I get a SUCCESS because my rule doesn't match. None of the Java sources are modified. But why do I still get a FAILURE: Containment of element expected but is not contained. (false-negative)?

SvenPeldszus commented 9 years ago

Sorry, I introduced a new typo last time I edited the test case.

I've now reviewed all test cases and have hopefully detected all remaining mistakes.

tsdh commented 9 years ago

I think I found another one. I'll open a separate issue for that.

tsdh commented 9 years ago

Ah, no. Error on my side. ;-)