Author: seanahn
Date: Wed Mar 25 19:42:58 2009
New Revision: 758420
URL: http://svn.apache.org/viewvc?rev=758420&view=rev
Log:
Fixed derby test prepare
Modified:
ode/branches/APACHE_ODE_1.X/tasks/nativedb.rake
Modified: ode/branches/APACHE_ODE_1.X/tasks/nativedb.rake
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/tasks/nativedb.rake?rev=758420&r1=758419&r2=758420&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/tasks/nativedb.rake (original)
+++ ode/branches/APACHE_ODE_1.X/tasks/nativedb.rake Wed Mar 25 19:42:58 2009
@@ -52,7 +52,7 @@
drop_tables_sql = "#{task.name}/drop_ode_tables.sql"
ant.get
:src=>"http://git.intalio.com/?p=integr.git;a=blob_plain;f=descriptors/package/#{dbprops[:db]}/ode_tables.sql;hb=#{dbprops[:integr_branch]}",
:dest=> create_tables_sql
- sqls = prepare_sqls(ant, [], :hib, dbprops[:db], drop_tables_sql,
create_tables_sql)
+ sqls = prepare_sqls(taks, ant, [], :hib, dbprops[:db],
drop_tables_sql, create_tables_sql)
# Apply the sql scripts to the database
ant.sql :driver=>dbprops[:driver], :url=>dbprops[:url],
:userid=>dbprops[:userid], :password=>dbprops[:password],
:autocommit=>dbprops[:autocommit] do
@@ -75,7 +75,7 @@
Buildr.ant(name) do |ant|
create_tables_sql = "#{base}/target/#{dbprops[:db]}.sql"
drop_tables_sql = "#{task.name}/drop-#{dbprops[:db]}.sql"
- sqls = prepare_sqls(ant, [], :jpa, dbprops[:db], drop_tables_sql,
create_tables_sql)
+ sqls = prepare_sqls(task, ant, [], :jpa, dbprops[:db],
drop_tables_sql, create_tables_sql)
# Apply the sql scripts to the database
ant.sql :driver=>dbprops[:driver], :url=>dbprops[:url],
:userid=>dbprops[:userid], :password=>dbprops[:password],
:autocommit=>dbprops[:autocommit] do
@@ -132,7 +132,7 @@
end
end
- def prepare_sqls(ant, sql_files, orm, db, drop_tables_sql,
create_tables_sql)
+ def prepare_sqls(task, ant, sql_files, orm, db, drop_tables_sql,
create_tables_sql)
# read the create table sql into a string
create_tables = ""
File.open(create_tables_sql, "r") do |f1|
@@ -164,10 +164,11 @@
# add in the create table sql file
if orm == :hib and db != "sqlserver"
- sql_files |= [create_tables_sql]
+ ant.copy :file=>create_tables_sql, :todir=>task.name
+ sql_files |= ["#{task.name}/#{create_tables_sql}"]
elsif orm == :jpa
ant.copy :file=>create_tables_sql, :todir=>task.name
- sql_files |= ["#{task.name}/#{db}.sql"]
+ sql_files |= ["#{task.name}/#{create_tables_sql}"]
end
sql_files