Changes between Version 94 and Version 95 of j2p


Ignore:
Timestamp:
07/01/24 10:06:06 (5 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • j2p

    v94 v95  
    186186}}}
    187187
    188 == Unit Tests, @Test
    189 In python, a class with tests must extend {{{unittest.TestCase}}}. This allows discovery by the py test tools. In Python the mechanism is slightly different, requiring the test class to extend TestCase. To support the translation mechanism and make our lives a bit easier, j2p requires all tests to be annotates with @RunWith. Use the following, depending on what kind of test you want to run:
    190 
    191 ||= test type in java =||= use java annotation =||
    192 ||normal @Test methods||@RunWith(JUnit4ClassRunner.class)||
    193 ||parametric test||@RunWith(Parameterized.class)||
    194 
    195 
    196 
    197188
    198189=== More notes:
     
    295286then l is of type List (the Interface) and l.get is a function in the interface which needs to be translated. Note that in general any type of List can end up in l at runtime, the compiler has to compile it such that the compiled code will work regardless (thus using only functions available in python's equivalent of the List class).
    296287
     288
     289
     290=== Unit Tests, @Test
     291The junit-t plugin helps translation of org.junit components.
     292In python, a class with tests must extend {{{unittest.TestCase}}}. This allows discovery by the py test tools. In Python the mechanism is slightly different, requiring the test class to extend TestCase. To support the translation mechanism and make our lives a bit easier, j2p requires all tests to be annotates with @RunWith. Use the following, depending on what kind of test you want to run:
     293
     294||= test type in java =||= use java annotation =||
     295||normal @Test methods||@RunWith(JUnit4ClassRunner.class)||
     296||parametric test||@RunWith(Parameterized.class)||
     297
     298
     299
     300
     301
    297302== Resulting file
    298303