@Test public void exec_simple() throws Exception { File output = new File(folder.getRoot(), "output.txt"); Info1.schema = new TableInfo.Builder("testing") .withColumn("testing", TypeName.INT) .build(); int status = GenerateCreateTable.execute(new String[] { "--classpath", source(), "--output", output.getPath(), "--include", "testing", }); assertThat(status, is(0)); List<String> stmts = collectStatements(output); assertThat(stmts, hasSize(1)); verify(stmts.get(0)); }
static int execute(String... args) { GenerateCreateTableTask task = new GenerateCreateTableTask(); GenerateCreateTableTask.Configuration conf; try { conf = parseConfiguration(args); } catch (Exception e) { LOG.error(Messages.getString("GenerateCreateTable.errorInvalidArgument"), e); HelpFormatter formatter = new HelpFormatter(); formatter.setWidth(Integer.MAX_VALUE); formatter.printHelp( MessageFormat.format( "java -classpath ... {0}", GenerateCreateTable.class.getName()), OPTIONS, true); return 1; } try { task.perform(conf); } catch (Exception e) { LOG.error(Messages.getString("GenerateCreateTable.errorExecute"), e); return 1; } finally { closeQuiet(conf.classLoader); } return 0; }
GenerateCreateTable { static int execute(String... args) { GenerateCreateTableTask task = new GenerateCreateTableTask(); GenerateCreateTableTask.Configuration conf; try { conf = parseConfiguration(args); } catch (Exception e) { LOG.error(Messages.getString("GenerateCreateTable.errorInvalidArgument"), e); HelpFormatter formatter = new HelpFormatter(); formatter.setWidth(Integer.MAX_VALUE); formatter.printHelp( MessageFormat.format( "java -classpath ... {0}", GenerateCreateTable.class.getName()), OPTIONS, true); return 1; } try { task.perform(conf); } catch (Exception e) { LOG.error(Messages.getString("GenerateCreateTable.errorExecute"), e); return 1; } finally { closeQuiet(conf.classLoader); } return 0; } }
GenerateCreateTable { static int execute(String... args) { GenerateCreateTableTask task = new GenerateCreateTableTask(); GenerateCreateTableTask.Configuration conf; try { conf = parseConfiguration(args); } catch (Exception e) { LOG.error(Messages.getString("GenerateCreateTable.errorInvalidArgument"), e); HelpFormatter formatter = new HelpFormatter(); formatter.setWidth(Integer.MAX_VALUE); formatter.printHelp( MessageFormat.format( "java -classpath ... {0}", GenerateCreateTable.class.getName()), OPTIONS, true); return 1; } try { task.perform(conf); } catch (Exception e) { LOG.error(Messages.getString("GenerateCreateTable.errorExecute"), e); return 1; } finally { closeQuiet(conf.classLoader); } return 0; } private  GenerateCreateTable(); }
GenerateCreateTable { static int execute(String... args) { GenerateCreateTableTask task = new GenerateCreateTableTask(); GenerateCreateTableTask.Configuration conf; try { conf = parseConfiguration(args); } catch (Exception e) { LOG.error(Messages.getString("GenerateCreateTable.errorInvalidArgument"), e); HelpFormatter formatter = new HelpFormatter(); formatter.setWidth(Integer.MAX_VALUE); formatter.printHelp( MessageFormat.format( "java -classpath ... {0}", GenerateCreateTable.class.getName()), OPTIONS, true); return 1; } try { task.perform(conf); } catch (Exception e) { LOG.error(Messages.getString("GenerateCreateTable.errorExecute"), e); return 1; } finally { closeQuiet(conf.classLoader); } return 0; } private  GenerateCreateTable(); static void main(String[] args); }
GenerateCreateTable { static int execute(String... args) { GenerateCreateTableTask task = new GenerateCreateTableTask(); GenerateCreateTableTask.Configuration conf; try { conf = parseConfiguration(args); } catch (Exception e) { LOG.error(Messages.getString("GenerateCreateTable.errorInvalidArgument"), e); HelpFormatter formatter = new HelpFormatter(); formatter.setWidth(Integer.MAX_VALUE); formatter.printHelp( MessageFormat.format( "java -classpath ... {0}", GenerateCreateTable.class.getName()), OPTIONS, true); return 1; } try { task.perform(conf); } catch (Exception e) { LOG.error(Messages.getString("GenerateCreateTable.errorExecute"), e); return 1; } finally { closeQuiet(conf.classLoader); } return 0; } private  GenerateCreateTable(); static void main(String[] args);  }