@Test public void printsCompileError(){ toTest.run("System.out."); Assert.assertTrue(viewModel.getText().contains("Compile error:")); }
public void run(String codeToRun) { try { final OperationResult<OneArgAction<ObjectContainer>> result = generator.generateWithBody(codeToRun,preparation.packages()); if(result.wasSuccessful()){ runSnippet(result); } else{ printError(result.getException()); } } catch (Exception e) { throw reThrow(e); } }
ExampleRunner { public void run(String codeToRun) { try { final OperationResult<OneArgAction<ObjectContainer>> result = generator.generateWithBody(codeToRun,preparation.packages()); if(result.wasSuccessful()){ runSnippet(result); } else{ printError(result.getException()); } } catch (Exception e) { throw reThrow(e); } } }
ExampleRunner { public void run(String codeToRun) { try { final OperationResult<OneArgAction<ObjectContainer>> result = generator.generateWithBody(codeToRun,preparation.packages()); if(result.wasSuccessful()){ runSnippet(result); } else{ printError(result.getException()); } } catch (Exception e) { throw reThrow(e); } } private  ExampleRunner(PrintStream writer, RunPreparation preparation, ObjectContainer container); }
ExampleRunner { public void run(String codeToRun) { try { final OperationResult<OneArgAction<ObjectContainer>> result = generator.generateWithBody(codeToRun,preparation.packages()); if(result.wasSuccessful()){ runSnippet(result); } else{ printError(result.getException()); } } catch (Exception e) { throw reThrow(e); } } private  ExampleRunner(PrintStream writer, RunPreparation preparation, ObjectContainer container); static ExampleRunner create(PrintStream writer); static ExampleRunner create(PrintStream writer,RunPreparation preparation); static ExampleRunner create(PrintStream writer,RunPreparation preparation,
                                       ObjectContainer container); void run(String codeToRun); void dispose(); }
ExampleRunner { public void run(String codeToRun) { try { final OperationResult<OneArgAction<ObjectContainer>> result = generator.generateWithBody(codeToRun,preparation.packages()); if(result.wasSuccessful()){ runSnippet(result); } else{ printError(result.getException()); } } catch (Exception e) { throw reThrow(e); } } private  ExampleRunner(PrintStream writer, RunPreparation preparation, ObjectContainer container); static ExampleRunner create(PrintStream writer); static ExampleRunner create(PrintStream writer,RunPreparation preparation); static ExampleRunner create(PrintStream writer,RunPreparation preparation,
                                       ObjectContainer container); void run(String codeToRun); void dispose();  }