Index: test/models/category.rb
===================================================================
--- test/models/category.rb	(revision 0)
+++ test/models/category.rb	(revision 0)
@@ -0,0 +1,19 @@
+require 'rubygems'
+require 'active_record'
+
+class CreateCategories < ActiveRecord::Migration
+  def self.up
+    create_table "categories", :force => true do |t|
+      t.column :name, :string
+    end
+  end
+
+  def self.down
+    drop_table "categories"
+  end
+end
+
+
+class Category < ActiveRecord::Base
+  has_many :entries
+end
Index: test/models/entry.rb
===================================================================
--- test/models/entry.rb	(revision 518)
+++ test/models/entry.rb	(working copy)
@@ -8,6 +8,8 @@
       t.column :updated_on, :datetime
       t.column :content, :text
       t.column :rating, :decimal, :precision => 10
+      t.column :blog_id, :integer
+      t.column :category_id, :integer
     end
   end
 
@@ -17,4 +19,6 @@
 end
 
 class Entry < ActiveRecord::Base
+  belongs_to :blog
+  belongs_to :category
 end
Index: test/models/blog.rb
===================================================================
--- test/models/blog.rb	(revision 0)
+++ test/models/blog.rb	(revision 0)
@@ -0,0 +1,18 @@
+require 'rubygems'
+require 'active_record'
+
+class CreateBlogs < ActiveRecord::Migration
+  def self.up
+    create_table "blogs", :force => true do |t|
+      t.column :title, :string
+    end    
+  end
+
+  def self.down
+    drop_table "blogs"
+  end
+end
+
+class Blog < ActiveRecord::Base
+  has_many :entries, :include => :category
+end
Index: test/simple.rb
===================================================================
--- test/simple.rb	(revision 518)
+++ test/simple.rb	(working copy)
@@ -1,5 +1,7 @@
 module MigrationSetup
   def setup
+    CreateBlogs.up
+    CreateCategories.up
     CreateEntries.up
     CreateAutoIds.up
 
@@ -7,6 +9,8 @@
   end
 
   def teardown
+    CreateBlogs.down
+    CreateCategories.down
     CreateEntries.down
     CreateAutoIds.down
   end
@@ -16,11 +20,17 @@
   include MigrationSetup
   def setup
     super
+    @blog = Blog.create :title => "ActiveRecord-JDBC"
+    @category = Category.create :name => "First posts"    
     @title = "First post!"
     @content = "Hello from JRuby on Rails!"
     @new_title = "First post updated title"
     @rating = 205
-    Entry.create :title => @title, :content => @content, :rating => @rating
+    Entry.create :title => @title, 
+                 :content => @content, 
+                 :rating => @rating,
+                 :blog => @blog,
+                 :category => @category
   end
 end
 
@@ -112,5 +122,12 @@
     e = Entry.new(:title => @title, :content => @content, :rating => ' ')
     p e.valid?
   end
+  
+  def test_has_many_with_include
+    post = Blog.find(:first).entries.first
+    assert_equal @title, post.title
+    assert_equal @content, post.content
+    assert_equal @rating, post.rating 
+  end
 
 end
Index: test/jdbc_common.rb
===================================================================
--- test/jdbc_common.rb	(revision 518)
+++ test/jdbc_common.rb	(working copy)
@@ -2,5 +2,7 @@
 require 'rubygems'
 require 'models/auto_id'
 require 'models/entry'
+require 'models/blog'
+require 'models/category'
 require 'simple'
 require 'test/unit'
