jrjackson 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab68c0e2bee027c6cf4eb4559e909ccf4337d07b
4
- data.tar.gz: 5af55667f2aeb5eeccc347e052cf6efa50f33ee4
3
+ metadata.gz: 71dd844306524c528f34236758c2d9f3a534df4e
4
+ data.tar.gz: 6dba6dbcae86b77406a707d8d1511290c7c0eee5
5
5
  SHA512:
6
- metadata.gz: 4a5509ef62f030a7f2d072926a9eecdfae1aa2bc69ba0df8154f3ad39b810e6ba1830ed0db54a205f251dc53b046f9b8fe5400e282aa3308cac78437e89d89b8
7
- data.tar.gz: 90b940cf954d7dc2017cc83697d066fca867737ff75a023a28bd7d0459fa85e393cc225c288b9fc4311bffd7b4cdb916bc672d9e4b49feae29b01ffa6325e563
6
+ metadata.gz: e35c3496ae70730346fc763712b5707fcb99572eb3fab6e3bd1038f8e87e0aac706e5eda573b2fc949d556c1bbbbcffa6b87ad891ea863a7131fe982896af06c
7
+ data.tar.gz: 6f14a1057d5bb57c596b644e2bf2fd2a31476e72e0c12f68636e67afcd8cd7d56d135fa4e2d30a7bee1e6f0c2e781e39c105a3eff3abef8b59ec70d37f6ce08f
@@ -1,3 +1,13 @@
1
+ v0.3.8
2
+ fix for issue 47
3
+ Update Jackson to v 0.6.3
4
+ Change error message to better report failure in issue 46
5
+
6
+ v0.3.7
7
+ fix for issue 46
8
+ Add references to RubyAnySerializer so Jackson can
9
+ use it for Ruby objects nested in Java objects
10
+
1
11
  v0.3.6
2
12
  fix for issue 45
3
13
  use bytelist.begin instead of 0 generating from RubyString
@@ -1,11 +1,11 @@
1
1
  module JrJackson
2
2
  module BuildInfo
3
3
  def self.version
4
- '0.3.7'
4
+ '0.3.8'
5
5
  end
6
6
 
7
7
  def self.release_date
8
- '2015-11-09'
8
+ '2015-12-10'
9
9
  end
10
10
 
11
11
  def self.files
data/pom.xml CHANGED
@@ -30,22 +30,22 @@
30
30
  <dependency>
31
31
  <groupId>com.fasterxml.jackson.core</groupId>
32
32
  <artifactId>jackson-core</artifactId>
33
- <version>2.6.1</version>
33
+ <version>2.6.3</version>
34
34
  </dependency>
35
35
  <dependency>
36
36
  <groupId>com.fasterxml.jackson.core</groupId>
37
37
  <artifactId>jackson-annotations</artifactId>
38
- <version>2.6.1</version>
38
+ <version>2.6.3</version>
39
39
  </dependency>
40
40
  <dependency>
41
41
  <groupId>com.fasterxml.jackson.core</groupId>
42
42
  <artifactId>jackson-databind</artifactId>
43
- <version>2.6.1</version>
43
+ <version>2.6.3</version>
44
44
  </dependency>
45
45
  <dependency>
46
46
  <groupId>com.fasterxml.jackson.module</groupId>
47
47
  <artifactId>jackson-module-afterburner</artifactId>
48
- <version>2.6.1</version>
48
+ <version>2.6.3</version>
49
49
  </dependency>
50
50
  </dependencies>
51
51
  <build>
@@ -95,7 +95,7 @@ public class RubyAnySerializer extends JsonSerializer<IRubyObject> {
95
95
  }
96
96
  return;
97
97
  }
98
- throw new JsonGenerationException("Cannot find Serializer for class: " + rubyObject.getClass().getName());
98
+ throw new JsonGenerationException("Cannot serialize instance of: " + meta.getRealClass().getName());
99
99
  }
100
100
 
101
101
  @Override
@@ -21,6 +21,8 @@ class JrJacksonTest < Test::Unit::TestCase
21
21
  # assert_equal %Q{{"current_time":"#{time_string}"}}, serialized_output
22
22
  # end
23
23
  # end
24
+ class Test::Unit::CustomObj
25
+ end
24
26
 
25
27
  class ToJsonData
26
28
  attr_reader :one, :two, :six
@@ -482,12 +484,17 @@ class JrJacksonTest < Test::Unit::TestCase
482
484
 
483
485
  def test_cannot_serialize_object
484
486
  err = assert_raises(JrJackson::ParseError) { JrJackson::Json.dump({"foo" => Object.new}) }
485
- assert_match /Cannot find Serializer for class: org.jruby.RubyObject/, err.message
487
+ assert_match /Cannot serialize instance of: Object/, err.message
486
488
  end
487
489
 
488
490
  def test_cannot_serialize_basic_object
489
491
  err = assert_raises(JrJackson::ParseError) { JrJackson::Json.dump({"foo" => BasicObject.new}) }
490
- assert_match /Cannot find Serializer for class: org.jruby.RubyBasicObject/, err.message
492
+ assert_match /Cannot serialize instance of: BasicObject/, err.message
493
+ end
494
+
495
+ def test_cannot_serialize_custom_object
496
+ err = assert_raises(JrJackson::ParseError) { JrJackson::Json.dump({"foo" => Test::Unit::CustomObj.new}) }
497
+ assert_match /Cannot serialize instance of: Test::Unit::CustomObj/, err.message
491
498
  end
492
499
 
493
500
  def test_supports_pretty_printing
@@ -513,11 +520,12 @@ class JrJacksonTest < Test::Unit::TestCase
513
520
 
514
521
  def test_can_mix_java_and_ruby_objects
515
522
  json = '{"utf8":"żółć", "moo": "bar", "arr": [2,3,4], "flo": 3.33}'
516
-
517
- expected = '{"mixed":{"arr":[2,3,4],"utf8":"żółć","flo":3.33,"zzz":{"one":1.0,"two":2,"six":6.0},"moo":"bar"}}'
523
+ timeobj = Time.new(2015,11,11,11,11,11).utc
524
+ expected = '{"mixed":{"arr":[2,3,4],"utf8":"żółć","flo":3.33,"zzz":{"one":1.0,"two":2,"six":6.0},"moo":"bar"},"time":"2015-11-11 11:11:11 +0000"}'
518
525
  object = JrJackson::Json.parse_java(json)
519
526
  object["zzz"] = CustomToJson.new(1.0, 2, 6.0)
520
527
  mixed = {"mixed" => object}
528
+ mixed['time'] = timeobj
521
529
  actual = JrJackson::Json.dump(mixed)
522
530
  assert_equal expected, actual
523
531
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jrjackson
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guy Boertje
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-09 00:00:00.000000000 Z
11
+ date: 2015-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement