jdbc-helper 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -144,8 +144,8 @@ class Connection
144
144
  # @param [Hash] args
145
145
  def initialize(args = {})
146
146
  # Subsequent deletes should not affect the input
147
- @args = args.dup
148
- args = @args.dup
147
+ @args = Marshal.load(Marshal.dump(args))
148
+ args = Marshal.load(Marshal.dump(args))
149
149
 
150
150
  # String/Symbol
151
151
  %w[driver url user password timeout].each do | strk |
data/test/database.yml CHANGED
@@ -5,18 +5,12 @@ mysql:
5
5
  database: test
6
6
  user: root
7
7
  password:
8
-
9
- #oracle:
10
- #driver: oracle.jdbc.driver.OracleDriver
11
- #url: jdbc:oracle:thin:@localhost/svc
12
- #database: test
13
- #user: testuser
14
- #password: testpassword
8
+ timeout: 5
15
9
 
16
10
  oracle:
17
11
  driver: oracle.jdbc.driver.OracleDriver
18
- url: jdbc:oracle:thin:@10.20.253.105/didev
19
- database: wisefn
20
- user: wisefn
21
- password: wisefndb
22
- timeout: 5
12
+ url: jdbc:oracle:thin:@localhost/svc
13
+ database: test
14
+ user: testuser
15
+ password: testpassword
16
+
File without changes
data/test/helper.rb CHANGED
@@ -21,7 +21,9 @@ end
21
21
  module JDBCHelperTestHelper
22
22
  require 'yaml'
23
23
  def config
24
- @db_config ||= YAML.load File.read(File.dirname(__FILE__) + '/database.yml')
24
+ path = File.dirname(__FILE__) + '/database.yml'
25
+ path += '.local' if File.exists?(path + '.local')
26
+ @db_config ||= YAML.load File.read(path)
25
27
  end
26
28
 
27
29
  def create_test_procedure_simple conn, name
@@ -96,6 +96,7 @@ class TestConnection < Test::Unit::TestCase
96
96
  # Integers will be converted to String
97
97
  #conn_info['defaultRowPrefetch'] = 1000
98
98
 
99
+ conn_info.freeze # Non-modifiable!
99
100
  conn = JDBCHelper::Connection.new(conn_info)
100
101
  assert_equal(conn.closed?, false)
101
102
  assert_equal(conn.driver, conn_info[:driver] || conn_info['driver'])
@@ -522,6 +522,28 @@ class TestObjectWrapper < Test::Unit::TestCase
522
522
  end
523
523
  end
524
524
 
525
+ # Test disabled prepared statements
526
+ def test_pstmt_disable
527
+ pend("TODO/TBD") do
528
+ each_connection do |conn|
529
+ create_table conn
530
+ insert conn.table(@table_name)
531
+
532
+ # Batch-enabled object
533
+ conn.table(@table_name).batch
534
+
535
+ 10000.times do |i|
536
+ # Should not fail
537
+ t = conn.table(@table_name)
538
+ t.count("id = #{i}")
539
+ end
540
+
541
+ # OK
542
+ assert true
543
+ end
544
+ end
545
+ end
546
+
525
547
  def test_prepared_statements
526
548
  each_connection do |conn|
527
549
  create_table conn
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jdbc-helper
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.1
5
+ version: 0.6.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Junegunn Choi
@@ -10,8 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-09-05 00:00:00 +09:00
14
- default_executable:
13
+ date: 2011-10-27 00:00:00 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: bundler
@@ -90,14 +89,13 @@ files:
90
89
  - LICENSE.txt
91
90
  - README.markdown
92
91
  - test/database.yml
93
- - test/database.yml.org
92
+ - test/database.yml.local
94
93
  - test/helper.rb
95
94
  - test/performance.rb
96
95
  - test/test_connection.rb
97
96
  - test/test_connectors.rb
98
97
  - test/test_object_wrapper.rb
99
98
  - test/test_sql.rb
100
- has_rdoc: true
101
99
  homepage: http://github.com/junegunn/jdbc-helper
102
100
  licenses:
103
101
  - MIT
@@ -124,13 +122,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
122
  requirements: []
125
123
 
126
124
  rubyforge_project:
127
- rubygems_version: 1.5.1
125
+ rubygems_version: 1.8.11
128
126
  signing_key:
129
127
  specification_version: 3
130
128
  summary: A JDBC helper for JRuby/Database developers.
131
129
  test_files:
132
130
  - test/database.yml
133
- - test/database.yml.org
131
+ - test/database.yml.local
134
132
  - test/helper.rb
135
133
  - test/performance.rb
136
134
  - test/test_connection.rb