Author: cbrisson Date: Mon Jun 26 13:33:07 2017 New Revision: 1799915 URL: http://svn.apache.org/viewvc?rev=1799915&view=rev Log: [engine] Keep track of specific SQL grammars for test database creation
Added: velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.derby velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.mysql velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.oracle velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.postgresql velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.sqlserver Added: velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.derby URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.derby?rev=1799915&view=auto ============================================================================== --- velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.derby (added) +++ velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.derby Mon Jun 26 13:33:07 2017 @@ -0,0 +1,54 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"). you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +-- drop table if exists velocity_template_varchar; + +create table velocity_template_varchar +( + vt_id VARCHAR(64) not null primary key, + vt_timestamp TIMESTAMP, + vt_def VARCHAR(255) not null +); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( 'testTemplate1', current_timestamp, 'I am a test through the data loader'); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( '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', current_timestamp, '#testMacro("foo")'); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( '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; Added: velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.mysql URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.mysql?rev=1799915&view=auto ============================================================================== --- velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.mysql (added) +++ velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.mysql Mon Jun 26 13:33:07 2017 @@ -0,0 +1,54 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"). you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +drop table if exists velocity_template_varchar; + +create table velocity_template_varchar +( + vt_id VARCHAR(64) not null primary key, + vt_timestamp DATETIME, + vt_def VARCHAR(255) not null +); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( 'testTemplate1', current_timestamp, 'I am a test through the data loader'); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( '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', current_timestamp, '#testMacro("foo")'); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( '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 DATETIME, + vt_def TEXT not null +); + +insert into velocity_template_clob select * from velocity_template_varchar; Added: velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.oracle URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.oracle?rev=1799915&view=auto ============================================================================== --- velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.oracle (added) +++ velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.oracle Mon Jun 26 13:33:07 2017 @@ -0,0 +1,51 @@ +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE velocity_template_varchar'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; + +create table velocity_template_varchar +( + vt_id VARCHAR(64) not null, + vt_timestamp TIMESTAMP, + vt_def VARCHAR(255) not null +); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( 'testTemplate1', current_timestamp, 'I am a test through the data loader'); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( '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', current_timestamp, '#testMacro("foo")'); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( 'VM_global_library.vm', current_timestamp, '#macro (testMacro $param) I am a macro using $param #end'); + + +-- same templates as clob + +BEGIN + EXECUTE IMMEDIATE 'DROP TABLE velocity_template_clob'; +EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -942 THEN + RAISE; + END IF; +END; + +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; Added: velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.postgresql URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.postgresql?rev=1799915&view=auto ============================================================================== --- velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.postgresql (added) +++ velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.postgresql Mon Jun 26 13:33:07 2017 @@ -0,0 +1,54 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"). you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +drop table if exists velocity_template_varchar; + +create table velocity_template_varchar +( + vt_id VARCHAR(64) not null primary key, + vt_timestamp TIMESTAMP, + vt_def VARCHAR(255) not null +); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( 'testTemplate1', current_timestamp, 'I am a test through the data loader'); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( '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', current_timestamp, '#testMacro("foo")'); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( '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 TEXT not null +); + +insert into velocity_template_clob select * from velocity_template_varchar; Added: velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.sqlserver URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.sqlserver?rev=1799915&view=auto ============================================================================== --- velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.sqlserver (added) +++ velocity/engine/trunk/velocity-engine-core/src/test/resources/ds/create-db.sql.sqlserver Mon Jun 26 13:33:07 2017 @@ -0,0 +1,54 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"). you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + +drop table if exists velocity_template_varchar; + +create table velocity_template_varchar +( + vt_id VARCHAR(64) not null primary key, + vt_timestamp DATETIME, + vt_def VARCHAR(255) not null +); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( 'testTemplate1', current_timestamp, 'I am a test through the data loader'); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( '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', current_timestamp, '#testMacro("foo")'); + +insert into velocity_template_varchar (vt_id, vt_timestamp, vt_def) VALUES + ( '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 DATETIME, + vt_def TEXT not null +); + +insert into velocity_template_clob select * from velocity_template_varchar;