source: java2python/src/test/java/tudelft/utilities/j2p/t/PersonTest.java@ 391

Last change on this file since 391 was 391, checked in by wouter, 2 years ago

#115 working at translators for annotations

File size: 761 bytes
Line 
1package tudelft.utilities.j2p.t;
2
3import static org.junit.Assert.assertEquals;
4
5import java.io.IOException;
6import java.util.Arrays;
7import java.util.List;
8
9import org.junit.Test;
10
11public class PersonTest extends PyTest {
12
13 private static final String TESTDIR = "src/test/java/";
14 private static final String FULLNAME = "testcode/Person.java";
15
16 @Test
17 public void test()
18 throws IOException, ClassNotFoundException, TranslationException {
19 System.out.println("TRANSLATION:");
20 System.out.println(translate(TESTDIR + FULLNAME).toCode(""));
21 }
22
23 @Test
24 public void runInPython() throws Exception {
25
26 List<String> res = runPython(translate(TESTDIR + FULLNAME),
27 FULLNAME.replace(".java", ".py"));
28 assertEquals(Arrays.asList("Person[Kees]"), res);
29 }
30
31}
Note: See TracBrowser for help on using the repository browser.