From da2114f9ca2daa199426aa2876cb58420ff6c827 Mon Sep 17 00:00:00 2001 From: yanbasic Date: Mon, 27 Apr 2015 17:44:49 +0800 Subject: [PATCH 1/5] dd --- .project | 11 +++ T1.java | 240 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 251 insertions(+) create mode 100644 .project create mode 100644 T1.java diff --git a/.project b/.project new file mode 100644 index 0000000..8d4d4e2 --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + yanbasic_code_1 + + + + + + + + diff --git a/T1.java b/T1.java new file mode 100644 index 0000000..8603f0a --- /dev/null +++ b/T1.java @@ -0,0 +1,240 @@ +<%@ jet +imports=" + org.talend.core.model.process.INode + org.talend.core.model.process.ElementParameterParser + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.designer.codegen.config.CodeGeneratorArgument +" +%> +<%@ include file="Log4jFileUtil.javajet"%> +<% + class DefaultLog4jCodeGenerateUtil extends DefaultLog4jFileUtil{ + + String connection = ""; + boolean hasInit = false; + String dataAction ; + String dataOperationPrefix; + String useBatchSize; + String batchSize; + String dbSchema; + boolean logCommitCounter = false; + + public DefaultLog4jCodeGenerateUtil(){ + } + + public DefaultLog4jCodeGenerateUtil(INode node) { + super(node); + init(); + } + + public void beforeComponentProcess(INode node){ + this.node = node; + init(); + } + + private void init() { + if(hasInit){ + return; + } + this.cid = node.getUniqueName(); + this.isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")); + String useConn = ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"); + if(useConn == null || "".equals(useConn) || "true".equals(useConn)){ + connection = ElementParameterParser.getValue(node,"__CONNECTION__"); + if(!"".equals(connection)){ + connection = "'" + connection+"' "; + } + } + //for output + dataAction = ElementParameterParser.getValue(node,"__DATA_ACTION__"); + if(dataAction != null && !("").equals(dataAction)){ + logCommitCounter=true; + } + useBatchSize = ElementParameterParser.getValue(node, "__USE_BATCH_SIZE__"); + batchSize =ElementParameterParser.getValue(node, "__BATCH_SIZE__"); + hasInit = true; + } + + public void debugDriverClassName() { + logInfo(node,"debug",cid+" - Driver ClassName: \"+driverClass_"+cid+"+\"."); + } + + public void debugConnectionParams(INode node) { + beforeComponentProcess(node); + debugDriverClassName(); + } + + public void useExistConnection(INode node){ + beforeComponentProcess(node); + if(isLog4jEnabled) { + %> + if(conn_<%=cid%> != null) { + try{ + if(conn_<%=cid%>.getMetaData() != null) { + log.info("<%=cid%> - Uses an existing connection with username '" + conn_<%=cid%>.getMetaData().getUserName() + "'. Connection URL: " + conn_<%=cid%>.getMetaData().getURL() + "."); + } + }catch(java.sql.SQLException ex){ + log.warn(ex.getMessage()); + } + } + <% + } + } + + public void connect(INode node){ + beforeComponentProcess(node); + connect(); + } + + public void connect(){ + connect_begin(); + %> + conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid %>, dbUser_<%=cid%>, dbPwd_<%=cid%>); + <% + connect_end(); + } + + public void connect_begin(){ + logInfo(node,"info",cid+" - Connection attempt to '\" + url_"+cid+" + \"' with the username '\" + dbUser_"+cid+" + \"'."); + } + + public void connect_begin_noUser(){ + logInfo(node,"info",cid+" - Connection attempt to '\" + url_"+cid+" + \"'."); + } + + public void connect_end(){ + logInfo(node,"info",cid+" - Connection to '\" + url_"+cid+" + \"' has succeeded."); + } + + public void rollback(INode node){ + beforeComponentProcess(node); + logInfo(node,"debug",cid+" - Connection "+connection+"starting to rollback."); + %> + conn_<%=cid%>.rollback(); + <% + logInfo(node,"debug",cid+" - Connection "+connection+"rollback has succeeded."); + } + + public void commit(INode node){ + beforeComponentProcess(node); + commit(); + } + + private void commit(){ + commit_begin(); + %> + conn_<%=cid%>.commit(); + <% + commit_end(); + } + + private void commit_begin(){ + if(logCommitCounter){ + logInfo(node,"debug",cid+" - Connection "+connection+"starting to commit \" + commitCounter_"+cid+"+ \" records."); + }else{ + logInfo(node,"debug",cid+" - Connection "+connection+"starting to commit."); + } + } + private void commit_end(){ + logInfo(node,"debug",cid+" - Connection "+connection+"commit has succeeded."); + } + + public void close(INode node){ + beforeComponentProcess(node); + close(); + } + + private void close(){ + close_begin(); + %> + conn_<%=cid%>.close(); + <% + close_end(); + } + + public void close_begin(){ + logInfo(node,"info",cid+" - Closing the connection "+connection+"to the database."); + } + public void close_end(){ + logInfo(node,"info",cid+" - Connection "+connection+"to the database closed."); + } + + public void autoCommit(INode node,boolean autoCommit){ + beforeComponentProcess(node); + logInfo(node,"debug",cid+" - Connection is set auto commit to '"+autoCommit+"'."); + %> + conn_<%=cid%>.setAutoCommit(<%=autoCommit%>); + <% + } + + public void query(INode node){ + beforeComponentProcess(node); + //for input + String dbquery= ElementParameterParser.getValue(node, "__QUERY__"); + dbquery = dbquery.replaceAll("\n"," "); + dbquery = dbquery.replaceAll("\r"," "); + logInfo(node,"info",cid+" - Executing the query: '\" + "+dbquery +" + \"'."); + } + + public void retrieveRecordsCount(INode node){ + beforeComponentProcess(node); + logInfo(node,"info",cid+" - Retrieved records count: \"+nb_line_"+cid+" + \" ."); + } + + public void logError(INode node,String logLevel,String exception){ + beforeComponentProcess(node); + if(isLog4jEnabled){ + %> + log.<%=logLevel%>("<%=cid%> - " + <%=exception%>.getMessage()); + <% + } + } + + public void logError(INode node,String logLevel){ + logError(node,logLevel,"e"); + } + + public void logInfo(INode node,String logLevel,String message){ + beforeComponentProcess(node); + if(isLog4jEnabled){ + %> + log.<%=logLevel%>("<%=message%>"); + <% + } + } + /** + *batchType : + * 1: do not get return value of executeBatch(); + * 2: get return value of executeBatch(); + * + */ + public void executeBatch(INode node,int batchType){ + beforeComponentProcess(node); + boolean logBatch = ("true").equals(useBatchSize) && !("").equals(batchSize) && !("0").equals(batchSize); + if(logBatch){ + logInfo(node,"debug",cid+" - Executing the "+dataAction+" batch."); + } + if(batchType==1){ + %> + pstmt_<%=cid %>.executeBatch(); + <% + }else if(batchType==2){ + boolean isMysqlBatchInsert = false; + if ((node.getUniqueName().contains("tMysqlOutput")||node.getUniqueName().contains("tAmazonMysqlOutput")) && ("INSERT").equals(dataAction)) { + isMysqlBatchInsert = true; + } + %> + int countSum_<%=cid%> = 0; + for(int countEach_<%=cid%>: pstmt_<%=cid %>.executeBatch()) { + countSum_<%=cid%> += (countEach_<%=cid%> < 0 ? 0 : <%=isMysqlBatchInsert? "1" : "countEach_"+cid %>); + } + <% + } + if(logBatch){ + logInfo(node,"debug",cid+" - The "+dataAction+" batch execution has succeeded."); + } + } + } + + DefaultLog4jCodeGenerateUtil log4jCodeGenerateUtil = new DefaultLog4jCodeGenerateUtil(); +%> From cdbe24ba43e4d8aa821d0ef1ac7aa500ca6d554d Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 28 Apr 2015 10:28:18 +0800 Subject: [PATCH 2/5] dgf --- T1.java | 1 - 1 file changed, 1 deletion(-) diff --git a/T1.java b/T1.java index 8603f0a..aa3ee9d 100644 --- a/T1.java +++ b/T1.java @@ -3,7 +3,6 @@ org.talend.core.model.process.INode org.talend.core.model.process.ElementParameterParser org.talend.designer.codegen.config.CodeGeneratorArgument - org.talend.designer.codegen.config.CodeGeneratorArgument " %> <%@ include file="Log4jFileUtil.javajet"%> From a766afd2d171fc43414f782616e0421a282d8ec6 Mon Sep 17 00:00:00 2001 From: yyan Date: Tue, 28 Apr 2015 10:35:11 +0800 Subject: [PATCH 3/5] sdfasd --- T1.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/T1.java b/T1.java index aa3ee9d..6f8d817 100644 --- a/T1.java +++ b/T1.java @@ -3,6 +3,8 @@ org.talend.core.model.process.INode org.talend.core.model.process.ElementParameterParser org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.designer.codegen.config.CodeGeneratorArgument " %> <%@ include file="Log4jFileUtil.javajet"%> From 677d95dea77bb1fc5301c65c5d2734d4b243965b Mon Sep 17 00:00:00 2001 From: Mike Yan Date: Tue, 9 Jun 2015 16:41:06 +0800 Subject: [PATCH 4/5] test1 --- .project | 22 +-- T1.java | 479 ++++++++++++++++++++++++++++--------------------------- 2 files changed, 251 insertions(+), 250 deletions(-) diff --git a/.project b/.project index 1b2c80f..8d4d4e2 100644 --- a/.project +++ b/.project @@ -1,11 +1,11 @@ - - - yanbasic_code_1 - - - - - - - - + + + yanbasic_code_1 + + + + + + + + diff --git a/T1.java b/T1.java index aa3ee9d..1bb27b0 100644 --- a/T1.java +++ b/T1.java @@ -1,239 +1,240 @@ -<%@ jet -imports=" - org.talend.core.model.process.INode - org.talend.core.model.process.ElementParameterParser - org.talend.designer.codegen.config.CodeGeneratorArgument -" -%> -<%@ include file="Log4jFileUtil.javajet"%> -<% - class DefaultLog4jCodeGenerateUtil extends DefaultLog4jFileUtil{ - - String connection = ""; - boolean hasInit = false; - String dataAction ; - String dataOperationPrefix; - String useBatchSize; - String batchSize; - String dbSchema; - boolean logCommitCounter = false; - - public DefaultLog4jCodeGenerateUtil(){ - } - - public DefaultLog4jCodeGenerateUtil(INode node) { - super(node); - init(); - } - - public void beforeComponentProcess(INode node){ - this.node = node; - init(); - } - - private void init() { - if(hasInit){ - return; - } - this.cid = node.getUniqueName(); - this.isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")); - String useConn = ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"); - if(useConn == null || "".equals(useConn) || "true".equals(useConn)){ - connection = ElementParameterParser.getValue(node,"__CONNECTION__"); - if(!"".equals(connection)){ - connection = "'" + connection+"' "; - } - } - //for output - dataAction = ElementParameterParser.getValue(node,"__DATA_ACTION__"); - if(dataAction != null && !("").equals(dataAction)){ - logCommitCounter=true; - } - useBatchSize = ElementParameterParser.getValue(node, "__USE_BATCH_SIZE__"); - batchSize =ElementParameterParser.getValue(node, "__BATCH_SIZE__"); - hasInit = true; - } - - public void debugDriverClassName() { - logInfo(node,"debug",cid+" - Driver ClassName: \"+driverClass_"+cid+"+\"."); - } - - public void debugConnectionParams(INode node) { - beforeComponentProcess(node); - debugDriverClassName(); - } - - public void useExistConnection(INode node){ - beforeComponentProcess(node); - if(isLog4jEnabled) { - %> - if(conn_<%=cid%> != null) { - try{ - if(conn_<%=cid%>.getMetaData() != null) { - log.info("<%=cid%> - Uses an existing connection with username '" + conn_<%=cid%>.getMetaData().getUserName() + "'. Connection URL: " + conn_<%=cid%>.getMetaData().getURL() + "."); - } - }catch(java.sql.SQLException ex){ - log.warn(ex.getMessage()); - } - } - <% - } - } - - public void connect(INode node){ - beforeComponentProcess(node); - connect(); - } - - public void connect(){ - connect_begin(); - %> - conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid %>, dbUser_<%=cid%>, dbPwd_<%=cid%>); - <% - connect_end(); - } - - public void connect_begin(){ - logInfo(node,"info",cid+" - Connection attempt to '\" + url_"+cid+" + \"' with the username '\" + dbUser_"+cid+" + \"'."); - } - - public void connect_begin_noUser(){ - logInfo(node,"info",cid+" - Connection attempt to '\" + url_"+cid+" + \"'."); - } - - public void connect_end(){ - logInfo(node,"info",cid+" - Connection to '\" + url_"+cid+" + \"' has succeeded."); - } - - public void rollback(INode node){ - beforeComponentProcess(node); - logInfo(node,"debug",cid+" - Connection "+connection+"starting to rollback."); - %> - conn_<%=cid%>.rollback(); - <% - logInfo(node,"debug",cid+" - Connection "+connection+"rollback has succeeded."); - } - - public void commit(INode node){ - beforeComponentProcess(node); - commit(); - } - - private void commit(){ - commit_begin(); - %> - conn_<%=cid%>.commit(); - <% - commit_end(); - } - - private void commit_begin(){ - if(logCommitCounter){ - logInfo(node,"debug",cid+" - Connection "+connection+"starting to commit \" + commitCounter_"+cid+"+ \" records."); - }else{ - logInfo(node,"debug",cid+" - Connection "+connection+"starting to commit."); - } - } - private void commit_end(){ - logInfo(node,"debug",cid+" - Connection "+connection+"commit has succeeded."); - } - - public void close(INode node){ - beforeComponentProcess(node); - close(); - } - - private void close(){ - close_begin(); - %> - conn_<%=cid%>.close(); - <% - close_end(); - } - - public void close_begin(){ - logInfo(node,"info",cid+" - Closing the connection "+connection+"to the database."); - } - public void close_end(){ - logInfo(node,"info",cid+" - Connection "+connection+"to the database closed."); - } - - public void autoCommit(INode node,boolean autoCommit){ - beforeComponentProcess(node); - logInfo(node,"debug",cid+" - Connection is set auto commit to '"+autoCommit+"'."); - %> - conn_<%=cid%>.setAutoCommit(<%=autoCommit%>); - <% - } - - public void query(INode node){ - beforeComponentProcess(node); - //for input - String dbquery= ElementParameterParser.getValue(node, "__QUERY__"); - dbquery = dbquery.replaceAll("\n"," "); - dbquery = dbquery.replaceAll("\r"," "); - logInfo(node,"info",cid+" - Executing the query: '\" + "+dbquery +" + \"'."); - } - - public void retrieveRecordsCount(INode node){ - beforeComponentProcess(node); - logInfo(node,"info",cid+" - Retrieved records count: \"+nb_line_"+cid+" + \" ."); - } - - public void logError(INode node,String logLevel,String exception){ - beforeComponentProcess(node); - if(isLog4jEnabled){ - %> - log.<%=logLevel%>("<%=cid%> - " + <%=exception%>.getMessage()); - <% - } - } - - public void logError(INode node,String logLevel){ - logError(node,logLevel,"e"); - } - - public void logInfo(INode node,String logLevel,String message){ - beforeComponentProcess(node); - if(isLog4jEnabled){ - %> - log.<%=logLevel%>("<%=message%>"); - <% - } - } - /** - *batchType : - * 1: do not get return value of executeBatch(); - * 2: get return value of executeBatch(); - * - */ - public void executeBatch(INode node,int batchType){ - beforeComponentProcess(node); - boolean logBatch = ("true").equals(useBatchSize) && !("").equals(batchSize) && !("0").equals(batchSize); - if(logBatch){ - logInfo(node,"debug",cid+" - Executing the "+dataAction+" batch."); - } - if(batchType==1){ - %> - pstmt_<%=cid %>.executeBatch(); - <% - }else if(batchType==2){ - boolean isMysqlBatchInsert = false; - if ((node.getUniqueName().contains("tMysqlOutput")||node.getUniqueName().contains("tAmazonMysqlOutput")) && ("INSERT").equals(dataAction)) { - isMysqlBatchInsert = true; - } - %> - int countSum_<%=cid%> = 0; - for(int countEach_<%=cid%>: pstmt_<%=cid %>.executeBatch()) { - countSum_<%=cid%> += (countEach_<%=cid%> < 0 ? 0 : <%=isMysqlBatchInsert? "1" : "countEach_"+cid %>); - } - <% - } - if(logBatch){ - logInfo(node,"debug",cid+" - The "+dataAction+" batch execution has succeeded."); - } - } - } - - DefaultLog4jCodeGenerateUtil log4jCodeGenerateUtil = new DefaultLog4jCodeGenerateUtil(); -%> +<%@ jet +imports=" + org.talend.core.model.process.INode + org.talend.core.model.process.ElementParameterParser + org.talend.designer.codegen.config.CodeGeneratorArgument + org.talend.designer.codegen.config.CodeGeneratorArgument +" +%> +<%@ include file="Log4jFileUtil.javajet"%> +<% + class DefaultLog4jCodeGenerateUtil extends DefaultLog4jFileUtil{ + + String connection = ""; + boolean hasInit = false; + String dataAction ; + String dataOperationPrefix; + String useBatchSize; + String batchSize; + String dbSchema; + boolean logCommitCounter = false; + + public DefaultLog4jCodeGenerateUtil(){ + } + + public DefaultLog4jCodeGenerateUtil(INode node) { + super(node); + init(); + } + + public void beforeComponentProcess(INode node){ + this.node = node; + init(); + } + + private void init() { + if(hasInit){ + return; + } + this.cid = node.getUniqueName(); + this.isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")); + String useConn = ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"); + if(useConn == null || "".equals(useConn) || "true".equals(useConn)){ + connection = ElementParameterParser.getValue(node,"__CONNECTION__"); + if(!"".equals(connection)){ + connection = "'" + connection+"' "; + } + } + //for output + dataAction = ElementParameterParser.getValue(node,"__DATA_ACTION__"); + if(dataAction != null && !("").equals(dataAction)){ + logCommitCounter=true; + } + useBatchSize = ElementParameterParser.getValue(node, "__USE_BATCH_SIZE__"); + batchSize =ElementParameterParser.getValue(node, "__BATCH_SIZE__"); + hasInit = true; + } + + public void debugDriverClassName() { + logInfo(node,"debug",cid+" - Driver ClassName: \"+driverClass_"+cid+"+\"."); + } + + public void debugConnectionParams(INode node) { + beforeComponentProcess(node); + debugDriverClassName(); + } + + public void useExistConnection(INode node){ + beforeComponentProcess(node); + if(isLog4jEnabled) { + %> + if(conn_<%=cid%> != null) { + try{ + if(conn_<%=cid%>.getMetaData() != null) { + log.info("<%=cid%> - Uses an existing connection with username '" + conn_<%=cid%>.getMetaData().getUserName() + "'. Connection URL: " + conn_<%=cid%>.getMetaData().getURL() + "."); + } + }catch(java.sql.SQLException ex){ + log.warn(ex.getMessage()); + } + } + <% + } + } + + public void connect(INode node){ + beforeComponentProcess(node); + connect(); + } + + public void connect(){ + connect_begin(); + %> + conn_<%=cid%> = java.sql.DriverManager.getConnection(url_<%=cid %>, dbUser_<%=cid%>, dbPwd_<%=cid%>); + <% + connect_end(); + } + + public void connect_begin(){ + logInfo(node,"info",cid+" - Connection attempt to '\" + url_"+cid+" + \"' with the username '\" + dbUser_"+cid+" + \"'."); + } + + public void connect_begin_noUser(){ + logInfo(node,"info",cid+" - Connection attempt to '\" + url_"+cid+" + \"'."); + } + + public void connect_end(){ + logInfo(node,"info",cid+" - Connection to '\" + url_"+cid+" + \"' has succeeded."); + } + + public void rollback(INode node){ + beforeComponentProcess(node); + logInfo(node,"debug",cid+" - Connection "+connection+"starting to rollback."); + %> + conn_<%=cid%>.rollback(); + <% + logInfo(node,"debug",cid+" - Connection "+connection+"rollback has succeeded."); + } + + public void commit(INode node){ + beforeComponentProcess(node); + commit(); + } + + private void commit(){ + commit_begin(); + %> + conn_<%=cid%>.commit(); + <% + commit_end(); + } + + private void commit_begin(){ + if(logCommitCounter){ + logInfo(node,"debug",cid+" - Connection "+connection+"starting to commit \" + commitCounter_"+cid+"+ \" records."); + }else{ + logInfo(node,"debug",cid+" - Connection "+connection+"starting to commit."); + } + } + private void commit_end(){ + logInfo(node,"debug",cid+" - Connection "+connection+"commit has succeeded."); + } + + public void close(INode node){ + beforeComponentProcess(node); + close(); + } + + private void close(){ + close_begin(); + %> + conn_<%=cid%>.close(); + <% + close_end(); + } + + public void close_begin(){ + logInfo(node,"info",cid+" - Closing the connection "+connection+"to the database."); + } + public void close_end(){ + logInfo(node,"info",cid+" - Connection "+connection+"to the database closed."); + } + + public void autoCommit(INode node,boolean autoCommit){ + beforeComponentProcess(node); + logInfo(node,"debug",cid+" - Connection is set auto commit to '"+autoCommit+"'."); + %> + conn_<%=cid%>.setAutoCommit(<%=autoCommit%>); + <% + } + + public void query(INode node){ + beforeComponentProcess(node); + //for input + String dbquery= ElementParameterParser.getValue(node, "__QUERY__"); + dbquery = dbquery.replaceAll("\n"," "); + dbquery = dbquery.replaceAll("\r"," "); + logInfo(node,"info",cid+" - Executing the query: '\" + "+dbquery +" + \"'."); + } + + public void retrieveRecordsCount(INode node){ + beforeComponentProcess(node); + logInfo(node,"info",cid+" - Retrieved records count: \"+nb_line_"+cid+" + \" ."); + } + + public void logError(INode node,String logLevel,String exception){ + beforeComponentProcess(node); + if(isLog4jEnabled){ + %> + log.<%=logLevel%>("<%=cid%> - " + <%=exception%>.getMessage()); + <% + } + } + + public void logError(INode node,String logLevel){ + logError(node,logLevel,"e"); + } + + public void logInfo(INode node,String logLevel,String message){ + beforeComponentProcess(node); + if(isLog4jEnabled){ + %> + log.<%=logLevel%>("<%=message%>"); + <% + } + } + /** + *batchType : + * 1: do not get return value of executeBatch(); + * 2: get return value of executeBatch(); + * + */ + public void executeBatch(INode node,int batchType){ + beforeComponentProcess(node); + boolean logBatch = ("true").equals(useBatchSize) && !("").equals(batchSize) && !("0").equals(batchSize); + if(logBatch){ + logInfo(node,"debug",cid+" - Executing the "+dataAction+" batch."); + } + if(batchType==1){ + %> + pstmt_<%=cid %>.executeBatch(); + <% + }else if(batchType==2){ + boolean isMysqlBatchInsert = false; + if ((node.getUniqueName().contains("tMysqlOutput")||node.getUniqueName().contains("tAmazonMysqlOutput")) && ("INSERT").equals(dataAction)) { + isMysqlBatchInsert = true; + } + %> + int countSum_<%=cid%> = 0; + for(int countEach_<%=cid%>: pstmt_<%=cid %>.executeBatch()) { + countSum_<%=cid%> += (countEach_<%=cid%> < 0 ? 0 : <%=isMysqlBatchInsert? "1" : "countEach_"+cid %>); + } + <% + } + if(logBatch){ + logInfo(node,"debug",cid+" - The "+dataAction+" batch execution has succeeded."); + } + } + } + + DefaultLog4jCodeGenerateUtil log4jCodeGenerateUtil = new DefaultLog4jCodeGenerateUtil(); +%> From 91eb2fba76f5b675792c473ee87a2783e481549f Mon Sep 17 00:00:00 2001 From: Mike Yan Date: Tue, 9 Jun 2015 16:45:32 +0800 Subject: [PATCH 5/5] init gittools project --- main/.classpath | 26 +++++++++++++ main/.project | 23 +++++++++++ .../org.eclipse.core.resources.prefs | 4 ++ main/.settings/org.eclipse.jdt.core.prefs | 5 +++ main/.settings/org.eclipse.m2e.core.prefs | 4 ++ main/pom.xml | 25 ++++++++++++ .../test/githiutools/githiutools/App.java | 13 +++++++ .../test/githiutools/githiutools/AppTest.java | 38 +++++++++++++++++++ 8 files changed, 138 insertions(+) create mode 100644 main/.classpath create mode 100644 main/.project create mode 100644 main/.settings/org.eclipse.core.resources.prefs create mode 100644 main/.settings/org.eclipse.jdt.core.prefs create mode 100644 main/.settings/org.eclipse.m2e.core.prefs create mode 100644 main/pom.xml create mode 100644 main/src/main/java/test/githiutools/githiutools/App.java create mode 100644 main/src/test/java/test/githiutools/githiutools/AppTest.java diff --git a/main/.classpath b/main/.classpath new file mode 100644 index 0000000..0a1dadd --- /dev/null +++ b/main/.classpath @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/.project b/main/.project new file mode 100644 index 0000000..14731da --- /dev/null +++ b/main/.project @@ -0,0 +1,23 @@ + + + githiutools + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/main/.settings/org.eclipse.core.resources.prefs b/main/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f9fe345 --- /dev/null +++ b/main/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/main/.settings/org.eclipse.jdt.core.prefs b/main/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..abec6ca --- /dev/null +++ b/main/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/main/.settings/org.eclipse.m2e.core.prefs b/main/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/main/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/main/pom.xml b/main/pom.xml new file mode 100644 index 0000000..784119e --- /dev/null +++ b/main/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + test.githiutools + githiutools + 0.0.1-SNAPSHOT + jar + + githiutools + http://maven.apache.org + + + UTF-8 + + + + + junit + junit + 3.8.1 + test + + + diff --git a/main/src/main/java/test/githiutools/githiutools/App.java b/main/src/main/java/test/githiutools/githiutools/App.java new file mode 100644 index 0000000..bdc1daf --- /dev/null +++ b/main/src/main/java/test/githiutools/githiutools/App.java @@ -0,0 +1,13 @@ +package test.githiutools.githiutools; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/main/src/test/java/test/githiutools/githiutools/AppTest.java b/main/src/test/java/test/githiutools/githiutools/AppTest.java new file mode 100644 index 0000000..f785fb7 --- /dev/null +++ b/main/src/test/java/test/githiutools/githiutools/AppTest.java @@ -0,0 +1,38 @@ +package test.githiutools.githiutools; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +}