You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by cb...@apache.org on 2017/06/25 20:44:09 UTC
svn commit: r1799838 - in
/velocity/engine/trunk/velocity-engine-core/src/test:
java/org/apache/velocity/test/sql/DBHelper.java resources/ds/create-db.sql
Author: cbrisson
Date: Sun Jun 25 20:44:09 2017
New Revision: 1799838
URL: http://svn.apache.org/viewvc?rev=1799838&view=rev
Log:
[engine] Remove unwanted catch clause ; reformat SQL; use current_timestamp
Modified:
velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/sql/DBHelper.java
velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql
Modified: velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/sql/DBHelper.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/sql/DBHelper.java?rev=1799838&r1=1799837&r2=1799838&view=diff
==============================================================================
--- velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/sql/DBHelper.java (original)
+++ velocity/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/sql/DBHelper.java Sun Jun 25 20:44:09 2017
@@ -76,19 +76,10 @@ public class DBHelper
String commands = new String(Files.readAllBytes(Paths.get(fileName)), StandardCharsets.UTF_8);
for (int targetPos = commands.indexOf(';'); targetPos > -1;
- targetPos = commands.indexOf(';')) {
+ targetPos = commands.indexOf(';'))
+ {
String cmd = commands.substring(0, targetPos + 1);
-
- try
- {
- statement.execute(cmd);
- }
- catch (SQLException sqle)
- {
- System.out.println("Statement: " + cmd + ": " +
- sqle.getMessage());
- }
-
+ statement.execute(cmd);
commands = commands.substring(targetPos + 2);
}
}
Modified: velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql?rev=1799838&r1=1799837&r2=1799838&view=diff
==============================================================================
--- velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql (original)
+++ velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql Sun Jun 25 20:44:09 2017
@@ -15,8 +15,7 @@
-- specific language governing permissions and limitations
-- under the License.
-drop table if exists velocity_template_1;
-drop table if exists velocity_template_2;
+drop table if exists velocity_template_varchar;
create table velocity_template_varchar
(
@@ -25,29 +24,31 @@ create table velocity_template_varchar
vt_def VARCHAR(255) not null
);
-create table velocity_template_clob
-(
- vt_id VARCHAR(64) not null primary key,
- vt_timestamp TIMESTAMP,
- vt_def CLOB not null
-);
-
insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES
- ( 'testTemplate1', NOW(), 'I am a test through the data loader');
+ ( 'testTemplate1', current_timestamp, 'I am a test through the data loader');
insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES
- ( 'testTemplate2', NOW(), '$tool.message $tool.add(23, 19)');
+ ( 'testTemplate2', current_timestamp, '$tool.message $tool.add(23, 19)');
insert into velocity_template_varchar (vt_id, vt_def) VALUES
( 'testTemplate3', 'This is a template with a null timestamp');
insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES
- ( 'testTemplate4', NOW(), '#testMacro("foo")');
+ ( 'testTemplate4', current_timestamp, '#testMacro("foo")');
insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES
- ( 'VM_global_library.vm', NOW(), '#macro (testMacro $param) I am a macro using $param #end');
+ ( 'VM_global_library.vm', current_timestamp, '#macro (testMacro $param) I am a macro using $param #end');
-- same templates as clob
+drop table if exists velocity_template_clob;
+
+create table velocity_template_clob
+(
+ vt_id VARCHAR(64) not null primary key,
+ vt_timestamp TIMESTAMP,
+ vt_def CLOB not null
+);
+
insert into velocity_template_clob select * from velocity_template_varchar;