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