source: java2python/src/test/java/tudelft/utilities/j2p/t/ObjectFunctionsTest.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: 855 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()
17 throws IOException, ClassNotFoundException, TranslationException {
18 System.out.println("TRANSLATION:");
19 System.out.println(translate(TESTDIR + FULLNAME));
20 }
21
22 @Test
23 public void runInPython() throws Exception {
24
25 List<String> res = runPython(translate(TESTDIR + FULLNAME),
26 FULLNAME.replace(".java", ".py"));
27 // we convert to lowercase as python bool is True
28 assertEquals(1, res.size());
29 assertEquals("12true12", res.get(0).toLowerCase());
30 System.out.println(res);
31
32 }
33}
Note: See TracBrowser for help on using the repository browser.