Sha256: a99541ee3625a515174725531a278b82aaa3a38d607ce54ab53a91388eea1ad6

Contents?: true

Size: 1.55 KB

Versions: 7

Compression:

Stored size: 1.55 KB

Contents

#!/usr/bin/env ruby

require 'TestSetup'
require 'test/unit'
require 'rubygems'
require_gem 'fireruby'

include FireRuby

class DDLTest < Test::Unit::TestCase
   CURDIR  = "#{Dir.getwd}"
   DB_FILE = "#{CURDIR}#{File::SEPARATOR}ddl_unit_test.fdb"
   
   def setup
      if File::exist?(DB_FILE)
         Database.new(DB_FILE).drop(DB_USER_NAME, DB_PASSWORD)
      end
      @database = Database::create(DB_FILE, DB_USER_NAME, DB_PASSWORD, 1024, nil)
   end
   
   def teardown
      if File::exist?(DB_FILE)
         Database.new(DB_FILE).drop(DB_USER_NAME, DB_PASSWORD)
      end
   end
   
   def test01
      @database.connect(DB_USER_NAME, DB_PASSWORD) do |cxn|
         cxn.execute_immediate('CREATE TABLE DDL_TABLE_01 (TABLEID '\
                               'INTEGER NOT NULL, '\
                               'FIELD01 FLOAT, FIELD02 CHAR(50), '\
                               'FIELD03 BIGINT, FIELD04 TIMESTAMP '\
                               'NOT NULL, FIELD05 VARCHAR(600))')

         r = cxn.execute_immediate('SELECT COUNT(*) FROM DDL_TABLE_01')
         assert(r.fetch[0] == 0)
         r.close
         
         cxn.execute_immediate('ALTER TABLE DDL_TABLE_01 ADD PRIMARY KEY '\
                               '(TABLEID)')
                               
         cxn.execute_immediate('CREATE UNIQUE INDEX DDL_TABLE_IDX ON '\
                               'DDL_TABLE_01 (TABLEID)')
                               
         cxn.execute_immediate('DROP INDEX DDL_TABLE_IDX')
         
         cxn.execute_immediate('DROP TABLE DDL_TABLE_01')
      end
   end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fireruby-0.2.2-powerpc-darwin test/DDLTest.rb
fireruby-0.2.2-mswin32 test/DDLTest.rb
fireruby-0.2.2-i586-linux test/DDLTest.rb
fireruby-0.2.1-powerpc-darwin test/DDLTest.rb
fireruby-0.2.1-mswin32 test/DDLTest.rb
fireruby-0.2.0-powerpc-darwin test/DDLTest.rb
fireruby-0.2.0-mswin32 test/DDLTest.rb