@Test public void execute() throws JAXBException, InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { assumeThat(jdbc.getDriver(), not(Resources.ENV_DRIVER)); assumeThat(jdbc.getUrl(), not(Resources.ENV_URL)); assumeThat(PropFileMaps.DEMO, is(true)); demo(); }
public void execute() { Validation validation = new Validation(SchemaUtil.urlToSchema(XSD), srcConn); if (validation.succeed()) { validation.setDocument(srcLoad); if (validation.succeed()) { JdlConnection jdlConnection = null; try { JdbcType jdbc = ObjectFactoryUtil .getJdbcTypeBySrcXml(srcConn); LoadType load = ObjectFactoryUtil .getLoadTypeBySrcXml(srcLoad); jdlConnection = new JdlConnection(jdbc); CsvLoadType csv = load.getCsv(); if (csv != null) { try { CsvLoader csvLoader = new CsvLoader(csv, new File( srcData)); csvLoader.dataInsert(jdlConnection); } catch (FileNotFoundException e) { throw new RuntimeException(e); } } XmlLoadType xml = load.getXml(); if (xml != null) { XmlLoader xPathParsing = new XmlLoader(xml, DomUtil.srcToDocument(srcData)); xPathParsing.dataInsert(jdlConnection); } } catch (JAXBException e) { e.printStackTrace(); } finally { try { if (jdlConnection != null) jdlConnection.closeConnection(); } catch (SQLException e) { log.error("closing connection", e); } } } else { System.err.println(validation.getError()); } } else { System.err.println(validation.getError()); } }
AppJdl { public void execute() { Validation validation = new Validation(SchemaUtil.urlToSchema(XSD), srcConn); if (validation.succeed()) { validation.setDocument(srcLoad); if (validation.succeed()) { JdlConnection jdlConnection = null; try { JdbcType jdbc = ObjectFactoryUtil .getJdbcTypeBySrcXml(srcConn); LoadType load = ObjectFactoryUtil .getLoadTypeBySrcXml(srcLoad); jdlConnection = new JdlConnection(jdbc); CsvLoadType csv = load.getCsv(); if (csv != null) { try { CsvLoader csvLoader = new CsvLoader(csv, new File( srcData)); csvLoader.dataInsert(jdlConnection); } catch (FileNotFoundException e) { throw new RuntimeException(e); } } XmlLoadType xml = load.getXml(); if (xml != null) { XmlLoader xPathParsing = new XmlLoader(xml, DomUtil.srcToDocument(srcData)); xPathParsing.dataInsert(jdlConnection); } } catch (JAXBException e) { e.printStackTrace(); } finally { try { if (jdlConnection != null) jdlConnection.closeConnection(); } catch (SQLException e) { log.error("closing connection", e); } } } else { System.err.println(validation.getError()); } } else { System.err.println(validation.getError()); } } }
AppJdl { public void execute() { Validation validation = new Validation(SchemaUtil.urlToSchema(XSD), srcConn); if (validation.succeed()) { validation.setDocument(srcLoad); if (validation.succeed()) { JdlConnection jdlConnection = null; try { JdbcType jdbc = ObjectFactoryUtil .getJdbcTypeBySrcXml(srcConn); LoadType load = ObjectFactoryUtil .getLoadTypeBySrcXml(srcLoad); jdlConnection = new JdlConnection(jdbc); CsvLoadType csv = load.getCsv(); if (csv != null) { try { CsvLoader csvLoader = new CsvLoader(csv, new File( srcData)); csvLoader.dataInsert(jdlConnection); } catch (FileNotFoundException e) { throw new RuntimeException(e); } } XmlLoadType xml = load.getXml(); if (xml != null) { XmlLoader xPathParsing = new XmlLoader(xml, DomUtil.srcToDocument(srcData)); xPathParsing.dataInsert(jdlConnection); } } catch (JAXBException e) { e.printStackTrace(); } finally { try { if (jdlConnection != null) jdlConnection.closeConnection(); } catch (SQLException e) { log.error("closing connection", e); } } } else { System.err.println(validation.getError()); } } else { System.err.println(validation.getError()); } } AppJdl(String srcConn, String srcData, String srcLoad); }
AppJdl { public void execute() { Validation validation = new Validation(SchemaUtil.urlToSchema(XSD), srcConn); if (validation.succeed()) { validation.setDocument(srcLoad); if (validation.succeed()) { JdlConnection jdlConnection = null; try { JdbcType jdbc = ObjectFactoryUtil .getJdbcTypeBySrcXml(srcConn); LoadType load = ObjectFactoryUtil .getLoadTypeBySrcXml(srcLoad); jdlConnection = new JdlConnection(jdbc); CsvLoadType csv = load.getCsv(); if (csv != null) { try { CsvLoader csvLoader = new CsvLoader(csv, new File( srcData)); csvLoader.dataInsert(jdlConnection); } catch (FileNotFoundException e) { throw new RuntimeException(e); } } XmlLoadType xml = load.getXml(); if (xml != null) { XmlLoader xPathParsing = new XmlLoader(xml, DomUtil.srcToDocument(srcData)); xPathParsing.dataInsert(jdlConnection); } } catch (JAXBException e) { e.printStackTrace(); } finally { try { if (jdlConnection != null) jdlConnection.closeConnection(); } catch (SQLException e) { log.error("closing connection", e); } } } else { System.err.println(validation.getError()); } } else { System.err.println(validation.getError()); } } AppJdl(String srcConn, String srcData, String srcLoad); void execute(); }
AppJdl { public void execute() { Validation validation = new Validation(SchemaUtil.urlToSchema(XSD), srcConn); if (validation.succeed()) { validation.setDocument(srcLoad); if (validation.succeed()) { JdlConnection jdlConnection = null; try { JdbcType jdbc = ObjectFactoryUtil .getJdbcTypeBySrcXml(srcConn); LoadType load = ObjectFactoryUtil .getLoadTypeBySrcXml(srcLoad); jdlConnection = new JdlConnection(jdbc); CsvLoadType csv = load.getCsv(); if (csv != null) { try { CsvLoader csvLoader = new CsvLoader(csv, new File( srcData)); csvLoader.dataInsert(jdlConnection); } catch (FileNotFoundException e) { throw new RuntimeException(e); } } XmlLoadType xml = load.getXml(); if (xml != null) { XmlLoader xPathParsing = new XmlLoader(xml, DomUtil.srcToDocument(srcData)); xPathParsing.dataInsert(jdlConnection); } } catch (JAXBException e) { e.printStackTrace(); } finally { try { if (jdlConnection != null) jdlConnection.closeConnection(); } catch (SQLException e) { log.error("closing connection", e); } } } else { System.err.println(validation.getError()); } } else { System.err.println(validation.getError()); } } AppJdl(String srcConn, String srcData, String srcLoad); void execute(); static final URL XSD; }