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. |
| 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 | |