source: java2python/src/test/java/tudelft/utilities/j2p/t/ObjectFunctionsTest.java@ 383

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

#115 numerous fixes: UniaryExpression, String.matches, throws, etc. ActionTest now compiles

File size: 830 bytes
Line 
1package tudelft.utilities.j2p.t;
2
3import static org.junit.Assert.assertEquals;
4
5import java.io.IOException;
6import java.util.List;
7
8import org.junit.Test;
9
10public class ObjectFunctionsTest extends PyTest {
11
12 private static final String TESTDIR = "src/test/java/";
13 private static final String FULLNAME = "testcode/ObjectFunctions.java";
14
15 @Test
16 public void test() throws IOException, ClassNotFoundException {
17 System.out.println("TRANSLATION:");
18 System.out.println(translate(TESTDIR + FULLNAME));
19 }
20
21 @Test
22 public void runInPython() throws Exception {
23
24 List<String> res = runPython(translate(TESTDIR + FULLNAME),
25 FULLNAME.replace(".java", ".py"));
26 // we convert to lowercase as python bool is True
27 assertEquals(1, res.size());
28 assertEquals("12true12", res.get(0).toLowerCase());
29 System.out.println(res);
30
31 }
32}
Note: See TracBrowser for help on using the repository browser.