예제 #1
1
 @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);
 }
예제 #2
0
 @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();
   }
 }
예제 #3
0
 @After
 public void tearDown() {
   gateway.shutdown();
 }