Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 1.5.0.RC3
Fetching contributors…

Cannot retrieve contributors at this time

16 lines (12 sloc) 0.528 kb
require 'test/unit'
require 'java'
class TestPrimitiveToJava < Test::Unit::TestCase
def test_primitive_conversion
t = Time.now
dc = org.jruby.javasupport.test.DateHolder.new
tz_pattern = t.zone == 'UTC' ? "'UTC'" : "Z"
sdf = java.text.SimpleDateFormat.new("EEE MMM dd HH:mm:ss #{tz_pattern} yyyy", java.util.Locale::ENGLISH)
dc.date = t
assert(t.to_s.eql?(sdf.format(dc.date)), "Ruby time #{t} not converted to java date correctly: #{sdf.format(dc.date)}")
end
end
Jump to Line
Something went wrong with that request. Please try again.