Echtzeitsysteme / java-refactoring-ttc

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

pub_pum1_2, a weird test case #18

Closed GerardPaligot closed 9 years ago

GerardPaligot commented 9 years ago

I got my first test case green with ARTE (\o/) but now, I am on the second test case of the public_pum_1.ttc file and there is something weird. For this test case, the working directory is always example01 and source files in this directory are: ChildClass1.java, ChildClass2.java and ParentClass.java.

In the test case, we declare a not_existing_parent Foo class, and we test than pull up method doesn't work when we apply a pull up method on the method method. There are 2 problems:

  1. Sources of the example don't correspond to the test case. So, my solution applies the refactoring on child classes to pull up the method on the parent class, ParentClass.java.
  2. My output of ARTE for this test case is:
execute --test pub_pum1_2       

####################################################################
####################   Executing public tests.  ####################
####################################################################

Executing test case: "pub_pum1_2"
    Description:
        PUM-NEG: Pull-up from child of a not existing parent class.

SUCCESS: The java program has been compiled.

    Output of execution before refactoring:
        c1:Hello World
        c1:Hello World
        c1:Hello World
        c2:Hello World
        c2:Hello World
        c2:Hello World

sssssssssssssss Triggering Program Graph Generation ssssssssssssssss
avr. 22, 2015 9:52:40 AM fr.inria.SpoonTtc createProgramGraph
INFOS: parse /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example01
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

ssssssssssssss  Triggering Pull-Up Method Refactoring ssssssssssssss
avr. 22, 2015 9:52:40 AM fr.inria.SpoonTtc applyPullUpMethod
INFOS: apply pull up method
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

ssssssssssss  Triggering Synchronization with Java Code ssssssssssss
avr. 22, 2015 9:52:40 AM fr.inria.SpoonTtc synchronizeChanges
INFOS: will print to /var/folders/yd/kdk6_3wn4fvc71sblyjpgnn80000gn/T/tmp_ttc/paper-example01/src
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

SUCCESS: This static check whether a class contains a specific method or field was successful.
SUCCESS: This static check whether a class contains a specific method or field was successful.
FAILURE: The java program does not contain the class "Foo".

    Output of execution after refactoring:
        c1:Hello World
        c1:Hello World
        c1:Hello World
        c2:Hello World
        c2:Hello World
        c2:Hello World

SUCCESS: Output before and after refactoring are equal.

--------------------------------------------------------------------
FAILURE: Test case "pub_pum1_2" has not been executed successfully.
The solution needed 0,004 seconds for execution. 
--------------------------------------------------------------------

####################################################################
####################  Summary of test results.  ####################
####################################################################

The test case "pub_pum1_2" was executed with status "FAILURE".

We can see: The java program does not contain the class "Foo". but Foo doesn't exist in paper-example01. So, we the java program cannot contain the class Foo.

SvenPeldszus commented 9 years ago

Sorry, there was an assertion in the case which caused the trouble. The intention was to check if there is still no parent class after the refactoring - in the former version, this assertion checked the existence of such a class and, therefore, resulted in a FAILURE. An updated version of ARTE is now committed.

GerardPaligot commented 9 years ago

Everything is fine now about this. Thanks.