Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

root/tags/RELEASE_1_5_0/test/test_digraph.rb

Revision 938, 1.0 kB (checked in by nahi, 5 years ago)

Filename typo fixed.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to author date id revision
Line 
1 require 'test/unit'
2 require 'soap/marshal'
3
4 class Node; include SOAP::Marshallable
5   attr_reader :first, :second, :str
6
7   def initialize(*init_next)
8     @first = init_next[0]
9     @second = init_next[1]
10   end
11 end
12
13 class TestDigraph < Test::Unit::TestCase
14   def setup
15     @n9 = Node.new
16     @n81 = Node.new(@n9)
17     @n82 = Node.new(@n9)
18     @n7 = Node.new(@n81, @n82)
19     @n61 = Node.new(@n7)
20     @n62 = Node.new(@n7)
21     @n5 = Node.new(@n61, @n62)
22     @n41 = Node.new(@n5)
23     @n42 = Node.new(@n5)
24     @n3 = Node.new(@n41, @n42)
25     @n21 = Node.new(@n3)
26     @n22 = Node.new(@n3)
27     @n1 = Node.new(@n21, @n22)
28   end
29
30   def test_marshal
31     f = File.open("digraph_marshalled_string.soap", "wb")
32     SOAP::Marshal.dump(@n1, f)
33     f.close
34     str = File.open("digraph_marshalled_string.soap").read
35     newnode = SOAP::Marshal.unmarshal(str)
36     assert_equal(newnode.first.first.__id__, newnode.second.first.__id__)
37     assert_equal(newnode.first.first.first.first.__id__, newnode.second.first.second.first.__id__)
38   end
39 end
Note: See TracBrowser for help on using the browser.