Changes between Version 93 and Version 94 of j2p


Ignore:
Timestamp:
07/01/24 10:04:01 (8 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • j2p

    v93 v94  
    187187
    188188== Unit Tests, @Test
    189 In python, a class with tests must textend {{{unittest.TestCase}}}. This allows discovery by the py test tools. However in java, there is no direct way to tell if a class contains tests.
    190 The translator checks for @Test annotations in a class. If there is one, the class is assumed to be a test class and TestCase is added as a superclass to the test.
     189In 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
    191196
    192197