@Before public void setUp() { entryPoint = new ExampleEntryPoint(); gateway = new Gateway(entryPoint); gateway.startup(); command = new ConstructorCommand(); command.init(gateway); sWriter = new StringWriter(); writer = new BufferedWriter(sWriter); }
@Test public void testDefaultConstructor() { String inputCommand = "py4j.examples.Stack\ne\n"; try { command.execute("i", new BufferedReader(new StringReader(inputCommand)), writer); assertEquals("yro0\n", sWriter.toString()); assertTrue(gateway.getObject("o0") instanceof Stack); } catch (Exception e) { e.printStackTrace(); fail(); } }
@After public void tearDown() { gateway.shutdown(); }