sapnwrfc 0.23-i686-linux → 0.24-i686-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/lib')
2
+ $:.unshift(File.dirname(__FILE__) + '/ext/nwsaprfc')
3
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
4
+ $:.unshift(File.dirname(__FILE__) + '/../ext/nwsaprfc')
5
+
6
+ require 'sapnwrfc'
7
+
8
+ $TEST_FILE = 'test/alternate_sap.yml'
9
+
10
+ require 'test/unit'
11
+ require 'test/unit/assertions'
12
+
13
+ class SAPConfigTest < Test::Unit::TestCase
14
+
15
+
16
+ def setup
17
+ FileUtils.cp('./test/sap.yml', 'sap.yml')
18
+ SAPNW::Base.load_config
19
+ #SAP_LOGGER.warn "program: #{$0}\n"
20
+ end
21
+
22
+ def test_BASIC_00010_Config_Loaded
23
+ assert( SAPNW::Base.config.length >= 5 )
24
+ assert( SAPNW::Base.config['ashost'].length > 3)
25
+ assert( SAPNW::Base.config['sysnr'].length == 2 )
26
+ assert( SAPNW::Base.config['client'].length == 3 )
27
+ assert( SAPNW::Base.config['user'].length >= 2 )
28
+ end
29
+
30
+ def test_BASIC_00020_Alternate_Config
31
+ SAPNW::Base.config_location = $TEST_FILE
32
+ assert( config = SAPNW::Base.load_config )
33
+ #$stderr.print "config length: #{config.length}\n"
34
+ assert( config.length >= 5 )
35
+ assert( SAPNW::Base.config.length >= 5 )
36
+ assert( SAPNW::Base.config['ashost'].length > 3)
37
+ assert( SAPNW::Base.config['sysnr'].length == 2 )
38
+ assert( SAPNW::Base.config['client'].length == 3 )
39
+ assert( SAPNW::Base.config['user'].length >= 2 )
40
+ end
41
+
42
+ def teardown
43
+ end
44
+ end
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/ruby
2
+ $:.unshift(File.dirname(__FILE__) + '/lib')
3
+ $:.unshift(File.dirname(__FILE__) + '/ext/nwsaprfc')
4
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
5
+ $:.unshift(File.dirname(__FILE__) + '/../ext/nwsaprfc')
6
+
7
+ require 'sapnwrfc'
8
+
9
+ $TEST_FILE = ENV.has_key?('SAP_YML') ? ENV['SAP_YML'] : 'sap.yml'
10
+
11
+ require 'test/unit'
12
+ require 'test/unit/assertions'
13
+
14
+ class SAPConnectTest < Test::Unit::TestCase
15
+ def setup
16
+ #SAP_LOGGER.warn "Current DIR: #{Dir.pwd}\n"
17
+ if FileTest.exists?($TEST_FILE)
18
+ SAPNW::Base.config_location = $TEST_FILE
19
+ else
20
+ SAPNW::Base.config_location = 'test/' + $TEST_FILE
21
+ end
22
+ SAPNW::Base.load_config
23
+ #SAP_LOGGER.warn "program: #{$0}\n"
24
+ end
25
+
26
+ def test_BASIC_00010_Basic_Connect
27
+ conn = nil
28
+ begin
29
+ assert(conn = SAPNW::Base.rfc_connect)
30
+ assert(conn.close)
31
+ #assert(conn = SAPNW::Base.rfc_connect(:user => 'developer', :passwd => 'developer'))
32
+ #assert(conn.close)
33
+ rescue SAPNW::RFC::ConnectionException => e
34
+ SAP_LOGGER.warn "ConnectionException ERROR: #{e.inspect} - #{e.error.inspect}\n"
35
+ end
36
+ SAP_LOGGER.warn "end of test 1\n"
37
+ end
38
+
39
+ def test_BASIC_00015_Basic_Connect_Ping
40
+ conn = nil
41
+ begin
42
+ assert(conn = SAPNW::Base.rfc_connect)
43
+ assert(conn.ping)
44
+ assert(conn.close)
45
+ assert(!conn.ping)
46
+ #assert(conn = SAPNW::Base.rfc_connect(:user => 'developer', :passwd => 'developer'))
47
+ #assert(conn.close)
48
+ rescue SAPNW::RFC::ConnectionException => e
49
+ SAP_LOGGER.warn "ConnectionException ERROR: #{e.inspect} - #{e.error.inspect}\n"
50
+ end
51
+ SAP_LOGGER.warn "end of test 1\n"
52
+ end
53
+
54
+ def test_BASIC_00020_Connection_Out_Of_Scope
55
+ 5.times do
56
+ conn = nil
57
+ begin
58
+ assert(conn = SAPNW::Base.rfc_connect)
59
+ rescue SAPNW::RFC::ConnectionException => e
60
+ SAP_LOGGER.warn "ConnectionException ERROR: #{e.inspect} - #{e.error.inspect}\n"
61
+ end
62
+ end
63
+ GC.start
64
+ SAP_LOGGER.warn "end of test 2\n"
65
+ end
66
+
67
+ def test_BASIC_00030_Volume_Connections
68
+ 50.times do
69
+ conn = nil
70
+ assert(conn = SAPNW::Base.rfc_connect)
71
+ end
72
+ GC.start
73
+ SAP_LOGGER.warn "end of test 3.1\n"
74
+ 50.times do
75
+ conn = nil
76
+ assert(conn = SAPNW::Base.rfc_connect)
77
+ end
78
+ GC.start
79
+ SAP_LOGGER.warn "end of test 3.2\n"
80
+ 50.times do
81
+ conn = nil
82
+ assert(conn = SAPNW::Base.rfc_connect)
83
+ end
84
+ GC.start
85
+ SAP_LOGGER.warn "end of test 3.3\n"
86
+ 50.times do
87
+ conn = nil
88
+ assert(conn = SAPNW::Base.rfc_connect)
89
+ end
90
+ GC.start
91
+ SAP_LOGGER.warn "end of test 3.4\n"
92
+ end
93
+
94
+ def test_BASIC_00040_Volume_Connections_With_Close
95
+ 99.times do
96
+ conn = nil
97
+ assert(conn = SAPNW::Base.rfc_connect)
98
+ assert(conn.close)
99
+ end
100
+ SAP_LOGGER.warn "end of test 4\n"
101
+ GC.start
102
+ sleep(5)
103
+ GC.start
104
+ end
105
+
106
+ def teardown
107
+ end
108
+ end
data/test/test_data.rb ADDED
@@ -0,0 +1,165 @@
1
+ #!/usr/bin/ruby
2
+ $KCODE = 'u'
3
+ $:.unshift(File.dirname(__FILE__) + '/lib')
4
+ $:.unshift(File.dirname(__FILE__) + '/ext/nwsaprfc')
5
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
6
+ $:.unshift(File.dirname(__FILE__) + '/../ext/nwsaprfc')
7
+
8
+ require 'sapnwrfc'
9
+
10
+ $ITER = 5
11
+ $INNER = 5
12
+ $TEST_FILE = ENV.has_key?('SAP_YML') ? ENV['SAP_YML'] : 'sap.yml'
13
+
14
+ require 'test/unit'
15
+ require 'test/unit/assertions'
16
+
17
+ class SAPDataTest < Test::Unit::TestCase
18
+ def setup
19
+ #SAP_LOGGER.warn "Current DIR: #{Dir.pwd}\n"
20
+ if FileTest.exists?($TEST_FILE)
21
+ SAPNW::Base.config_location = $TEST_FILE
22
+ else
23
+ SAPNW::Base.config_location = 'test/' + $TEST_FILE
24
+ end
25
+ SAPNW::Base.load_config
26
+ #SAP_LOGGER.warn "program: #{$0}\n"
27
+ begin
28
+ conn = SAPNW::Base.rfc_connect
29
+ fd = conn.discover("Z_TEST_DATA")
30
+ @skip = nil
31
+ rescue SAPNW::RFC::ConnectionException => e
32
+ SAP_LOGGER.warn "Z_TEST_DATA: cant find fuction module - bypass tests (#{e.error.inspect})"
33
+ @skipp = true
34
+ end
35
+ end
36
+
37
+ def test_BASIC_00010_Test_Data
38
+ unless @skip
39
+ $ITER.to_i.times do |iter|
40
+ begin
41
+ assert(conn = SAPNW::Base.rfc_connect)
42
+ attrib = conn.connection_attributes
43
+ SAP_LOGGER.debug "Connection Attributes: #{attrib.inspect}\n"
44
+ fd = conn.discover("Z_TEST_DATA")
45
+ assert(fd.name == "Z_TEST_DATA")
46
+ f = fd.new_function_call
47
+ assert(f.name == "Z_TEST_DATA")
48
+ f.CHAR = "German: öäüÖÄÜß"
49
+ f.INT1 = 123
50
+ f.INT2 = 1234
51
+ f.INT4 = 123456
52
+ f.FLOAT = 123456.00
53
+ f.NUMC = '12345'
54
+ f.DATE = '20060709'
55
+ f.TIME = '200607'
56
+ f.BCD = 200607.123
57
+ f.ISTRUCT = { 'ZCHAR' => "German: öäüÖÄÜß", 'ZINT1' => 54, 'ZINT2' => 134, 'ZIT4' => 123456, 'ZFLT' => 123456.00, 'ZNUMC' => '12345', 'ZDATE' => '20060709', 'ZTIME' => '200607', 'ZBCD' => '200607.123' }
58
+ f.DATA = [{ 'ZCHAR' => "German: öäüÖÄÜß", 'ZINT1' => 54, 'ZINT2' => 134, 'ZIT4' => 123456, 'ZFLT' => 123456.00, 'ZNUMC' => '12345', 'ZDATE' => '20060709', 'ZTIME' => '200607', 'ZBCD' => '200607.123' }]
59
+ #SAP_LOGGER.warn "FunctionCall: #{f.inspect}\n"
60
+ #SAP_LOGGER.warn "FunctionCall PROGRAM_NAME: #{f.PROGRAM_NAME.value}/#{f.parameters['PROGRAM_NAME'].type}\n"
61
+ begin
62
+ f.invoke
63
+ rescue SAPNW::RFC::FunctionCallException => e
64
+ SAP_LOGGER.warn "FunctionCallException on iter #{iter}: #{e.error.inspect}\n"
65
+ raise "gone"
66
+ end
67
+ f.RESULT.each do |row|
68
+ SAP_LOGGER.debug "row: #{row.inspect}"
69
+ end
70
+ f.DATA.each do |row|
71
+ SAP_LOGGER.debug "row: #{row.inspect}"
72
+ end
73
+
74
+ SAP_LOGGER.debug "ECHAR: #{f.ECHAR}"
75
+ SAP_LOGGER.debug "EINT1: #{f.EINT1}"
76
+ SAP_LOGGER.debug "EINT2: #{f.EINT2}"
77
+ SAP_LOGGER.debug "EINT4: #{f.EINT4}"
78
+ SAP_LOGGER.debug "EFLOAT: #{f.EFLOAT}"
79
+ SAP_LOGGER.debug "ENUMC: #{f.ENUMC}"
80
+ SAP_LOGGER.debug "EDATE: #{f.EDATE}"
81
+ SAP_LOGGER.debug "ETIME: #{f.ETIME}"
82
+ SAP_LOGGER.debug "EBCD: #{f.EBCD}"
83
+
84
+ SAP_LOGGER.debug "ESTRUCT: #{f.ESTRUCT.inspect}"
85
+ #assert(conn.close)
86
+ rescue SAPNW::RFC::ConnectionException => e
87
+ SAP_LOGGER.warn "ConnectionException ERROR: #{e.inspect} - #{e.error.inspect}\n"
88
+ end
89
+ GC.start unless iter % 50
90
+ end
91
+ GC.start
92
+ end
93
+ end
94
+
95
+ def test_BASIC_00020_Test_Data
96
+ unless @skip
97
+ begin
98
+ $ITER.times do |cnt|
99
+ assert(conn = SAPNW::Base.rfc_connect)
100
+ attrib = conn.connection_attributes
101
+ SAP_LOGGER.debug "Connection Attributes: #{attrib.inspect}\n"
102
+ fd = conn.discover("Z_TEST_DATA")
103
+ assert(fd.name == "Z_TEST_DATA")
104
+ $INNER.to_i.times do |iter|
105
+ SAP_LOGGER.debug "Start of iteration: #{cnt}/#{iter}"
106
+ f = fd.new_function_call
107
+ assert(f.name == "Z_TEST_DATA")
108
+ f.CHAR = "German: öäüÖÄÜß"
109
+ f.INT1 = 123
110
+ f.INT2 = 1234
111
+ f.INT4 = 123456
112
+ f.FLOAT = 123456.00
113
+ f.NUMC = '12345'
114
+ f.DATE = '20060709'
115
+ f.TIME = '200607'
116
+ f.BCD = 200607.123
117
+ f.ISTRUCT = { 'ZCHAR' => "German: öäüÖÄÜß", 'ZINT1' => 54, 'ZINT2' => 134, 'ZIT4' => 123456, 'ZFLT' => 123456.00, 'ZNUMC' => '12345', 'ZDATE' => '20060709', 'ZTIME' => '200607', 'ZBCD' => '200607.123' }
118
+ f.DATA = [
119
+ { 'ZCHAR' => "German: öäüÖÄÜß", 'ZINT1' => 54, 'ZINT2' => 134, 'ZIT4' => 123456, 'ZFLT' => 123456.00, 'ZNUMC' => '12345', 'ZDATE' => '20060709', 'ZTIME' => '200607', 'ZBCD' => '200607.123' },
120
+ { 'ZCHAR' => "German: öäüÖÄÜß", 'ZINT1' => 54, 'ZINT2' => 134, 'ZIT4' => 123456, 'ZFLT' => 123456.00, 'ZNUMC' => '12345', 'ZDATE' => '20060709', 'ZTIME' => '200607', 'ZBCD' => '200607.123' },
121
+ { 'ZCHAR' => "German: öäüÖÄÜß", 'ZINT1' => 54, 'ZINT2' => 134, 'ZIT4' => 123456, 'ZFLT' => 123456.00, 'ZNUMC' => '12345', 'ZDATE' => '20060709', 'ZTIME' => '200607', 'ZBCD' => '200607.123' },
122
+ { 'ZCHAR' => "German: öäüÖÄÜß", 'ZINT1' => 54, 'ZINT2' => 134, 'ZIT4' => 123456, 'ZFLT' => 123456.00, 'ZNUMC' => '12345', 'ZDATE' => '20060709', 'ZTIME' => '200607', 'ZBCD' => '200607.123' },
123
+ { 'ZCHAR' => "German: öäüÖÄÜß", 'ZINT1' => 54, 'ZINT2' => 134, 'ZIT4' => 123456, 'ZFLT' => 123456.00, 'ZNUMC' => '12345', 'ZDATE' => '20060709', 'ZTIME' => '200607', 'ZBCD' => '200607.123' }
124
+ ]
125
+ #SAP_LOGGER.warn "FunctionCall: #{f.inspect}\n"
126
+ #SAP_LOGGER.warn "FunctionCall PROGRAM_NAME: #{f.PROGRAM_NAME.value}/#{f.parameters['PROGRAM_NAME'].type}\n"
127
+ begin
128
+ f.invoke
129
+ rescue SAPNW::RFC::FunctionCallException => e
130
+ SAP_LOGGER.warn "FunctionCallException on iter #{cnt}/#{iter}: #{e.error.inspect}\n"
131
+ raise "gone"
132
+ end
133
+ f.RESULT.each do |row|
134
+ SAP_LOGGER.debug "row: #{row.inspect}"
135
+ end
136
+ f.DATA.each do |row|
137
+ SAP_LOGGER.debug "row: #{row.inspect}"
138
+ end
139
+
140
+ SAP_LOGGER.debug "ECHAR: #{f.ECHAR}"
141
+ SAP_LOGGER.debug "EINT1: #{f.EINT1}"
142
+ SAP_LOGGER.debug "EINT2: #{f.EINT2}"
143
+ SAP_LOGGER.debug "EINT4: #{f.EINT4}"
144
+ SAP_LOGGER.debug "EFLOAT: #{f.EFLOAT}"
145
+ SAP_LOGGER.debug "ENUMC: #{f.ENUMC}"
146
+ SAP_LOGGER.debug "EDATE: #{f.EDATE}"
147
+ SAP_LOGGER.debug "ETIME: #{f.ETIME}"
148
+ SAP_LOGGER.debug "EBCD: #{f.EBCD}"
149
+
150
+ SAP_LOGGER.debug "ESTRUCT: #{f.ESTRUCT.inspect}"
151
+ GC.start unless iter % 10
152
+ end
153
+ assert(conn.close)
154
+ GC.start
155
+ end
156
+ rescue SAPNW::RFC::ConnectionException => e
157
+ SAP_LOGGER.warn "ConnectionException ERROR: #{e.inspect} - #{e.error.inspect}\n"
158
+ end
159
+ GC.start
160
+ end
161
+ end
162
+
163
+ def teardown
164
+ end
165
+ end
data/test/test_deep.rb ADDED
@@ -0,0 +1,162 @@
1
+ #!/usr/bin/ruby
2
+ $KCODE = 'u'
3
+ $:.unshift(File.dirname(__FILE__) + '/lib')
4
+ $:.unshift(File.dirname(__FILE__) + '/ext/nwsaprfc')
5
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
6
+ $:.unshift(File.dirname(__FILE__) + '/../ext/nwsaprfc')
7
+
8
+ require 'sapnwrfc'
9
+
10
+ $TEST_FILE = ENV.has_key?('SAP_YML') ? ENV['SAP_YML'] : 'sap.yml'
11
+
12
+ $ITER = 50
13
+
14
+ require 'test/unit'
15
+ require 'test/unit/assertions'
16
+
17
+ class SAPDeepTest < Test::Unit::TestCase
18
+ def setup
19
+ #SAP_LOGGER.warn "Current DIR: #{Dir.pwd}\n"
20
+ if FileTest.exists?($TEST_FILE)
21
+ SAPNW::Base.config_location = $TEST_FILE
22
+ else
23
+ SAPNW::Base.config_location = 'test/' + $TEST_FILE
24
+ end
25
+ SAPNW::Base.load_config
26
+ #SAP_LOGGER.warn "program: #{$0}\n"
27
+ end
28
+
29
+ def test_BASIC_00010_Test_Deep
30
+ begin
31
+ $ITER.times do |iter|
32
+ assert(conn = SAPNW::Base.rfc_connect)
33
+ attrib = conn.connection_attributes
34
+ SAP_LOGGER.debug "Connection Attributes: #{attrib.inspect}\n"
35
+ fds = conn.discover("STFC_DEEP_STRUCTURE")
36
+ SAP_LOGGER.debug "Parameters: #{fds.parameters.keys.inspect}\n"
37
+ fs = fds.new_function_call
38
+ fs.IMPORTSTRUCT = { 'I' => 123, 'C' => 'AbCdEf', 'STR' => 'The quick brown fox ...', 'XSTR' => ["deadbeef"].pack("H*") }
39
+ fs.invoke
40
+ SAP_LOGGER.debug "RESPTEXT: #{fs.RESPTEXT.inspect}\n"
41
+ SAP_LOGGER.debug "ECHOSTRUCT: #{fs.ECHOSTRUCT.inspect}\n"
42
+ assert(fs.ECHOSTRUCT['I'] == 123)
43
+ assert(fs.ECHOSTRUCT['C'].rstrip == 'AbCdEf')
44
+ assert(fs.ECHOSTRUCT['STR'] == 'The quick brown fox ...')
45
+ assert(fs.ECHOSTRUCT['XSTR'].unpack("H*").first == 'deadbeef')
46
+ fdt = conn.discover("STFC_DEEP_TABLE")
47
+ SAP_LOGGER.debug "Parameters: #{fdt.parameters.keys.inspect}\n"
48
+ ft = fdt.new_function_call
49
+ ft.IMPORT_TAB = [{ 'I' => 123, 'C' => 'AbCdEf', 'STR' => 'The quick brown fox ...', 'XSTR' => ["deadbeef"].pack("H*") }]
50
+ ft.invoke
51
+ SAP_LOGGER.debug "RESPTEXT: #{ft.RESPTEXT.inspect}\n"
52
+ SAP_LOGGER.debug "EXPORT_TAB: #{ft.EXPORT_TAB.inspect}\n"
53
+ assert(ft.EXPORT_TAB[0]['I'] == 123)
54
+ assert(ft.EXPORT_TAB[0]['C'].rstrip == "AbCdEf")
55
+ assert(ft.EXPORT_TAB[0]['STR'] == 'The quick brown fox ...')
56
+ assert(ft.EXPORT_TAB[1]['C'].rstrip == "Appended")
57
+ ft.EXPORT_TAB.each do |row|
58
+ SAP_LOGGER.debug "XSTR: #{row['XSTR'].unpack("H*")}#\n"
59
+ assert(row['XSTR'].unpack("H*").first == 'deadbeef')
60
+ end
61
+ assert(conn.close)
62
+ GC.start unless iter % 50
63
+ end
64
+ rescue SAPNW::RFC::FunctionCallException => e
65
+ SAP_LOGGER.warn "FunctionCallException: #{e.error.inspect}\n"
66
+ raise "gone"
67
+ end
68
+ end
69
+
70
+ def test_BASIC_00020_Test_Deep
71
+ begin
72
+ assert(conn = SAPNW::Base.rfc_connect)
73
+ attrib = conn.connection_attributes
74
+ SAP_LOGGER.debug "Connection Attributes: #{attrib.inspect}\n"
75
+ fds = conn.discover("STFC_DEEP_STRUCTURE")
76
+ SAP_LOGGER.debug "Parameters: #{fds.parameters.keys.inspect}\n"
77
+ fdt = conn.discover("STFC_DEEP_TABLE")
78
+ SAP_LOGGER.debug "Parameters: #{fdt.parameters.keys.inspect}\n"
79
+ $ITER.times do |iter|
80
+ GC.start unless iter % 50
81
+ fs = fds.new_function_call
82
+ fs.IMPORTSTRUCT = { 'I' => 123, 'C' => 'AbCdEf', 'STR' => 'The quick brown fox ...', 'XSTR' => ["deadbeef"].pack("H*") }
83
+ fs.invoke
84
+ SAP_LOGGER.debug "RESPTEXT: #{fs.RESPTEXT.inspect}\n"
85
+ SAP_LOGGER.debug "ECHOSTRUCT: #{fs.ECHOSTRUCT.inspect}\n"
86
+ assert(fs.ECHOSTRUCT['I'] == 123)
87
+ assert(fs.ECHOSTRUCT['C'].rstrip == 'AbCdEf')
88
+ assert(fs.ECHOSTRUCT['STR'] == 'The quick brown fox ...')
89
+ assert(fs.ECHOSTRUCT['XSTR'].unpack("H*").first == 'deadbeef')
90
+ ft = fdt.new_function_call
91
+ ft.IMPORT_TAB = [{ 'I' => 123, 'C' => 'AbCdEf', 'STR' => 'The quick brown fox ...', 'XSTR' => ["deadbeef"].pack("H*") }]
92
+ ft.invoke
93
+ SAP_LOGGER.debug "RESPTEXT: #{ft.RESPTEXT.inspect}\n"
94
+ SAP_LOGGER.debug "EXPORT_TAB: #{ft.EXPORT_TAB.inspect}\n"
95
+ assert(ft.EXPORT_TAB[0]['I'] == 123)
96
+ assert(ft.EXPORT_TAB[0]['C'].rstrip == "AbCdEf")
97
+ assert(ft.EXPORT_TAB[0]['STR'] == 'The quick brown fox ...')
98
+ ft.EXPORT_TAB.each do |row|
99
+ SAP_LOGGER.debug "XSTR: #{row['XSTR'].unpack("H*")}#\n"
100
+ assert(row['XSTR'].unpack("H*").first == 'deadbeef')
101
+ end
102
+ end
103
+ assert(conn.close)
104
+ rescue SAPNW::RFC::FunctionCallException => e
105
+ SAP_LOGGER.warn "FunctionCallException: #{e.error.inspect}\n"
106
+ raise "gone"
107
+ end
108
+ end
109
+
110
+ def test_BASIC_00030_Test_Deep
111
+ begin
112
+ assert(conn = SAPNW::Base.rfc_connect)
113
+ attrib = conn.connection_attributes
114
+ SAP_LOGGER.debug "Connection Attributes: #{attrib.inspect}\n"
115
+ fdt = conn.discover("STFC_DEEP_TABLE")
116
+ SAP_LOGGER.debug "Parameters: #{fdt.parameters.keys.inspect}\n"
117
+ ft = fdt.new_function_call
118
+ ft.IMPORT_TAB = [{ 'I' => 123, 'C' => 'AbCdEf', 'STR' => 'The quick brown fox ...', 'XSTR' => ["deadbeef"].pack("H*") }]
119
+ ft.invoke
120
+ SAP_LOGGER.debug "RESPTEXT: #{ft.RESPTEXT.inspect}\n"
121
+ SAP_LOGGER.debug "EXPORT_TAB: #{ft.EXPORT_TAB.inspect}\n"
122
+ assert(ft.EXPORT_TAB[0]['I'] == 123)
123
+ assert(ft.EXPORT_TAB[0]['C'].rstrip == "AbCdEf")
124
+ assert(ft.EXPORT_TAB[0]['STR'] == 'The quick brown fox ...')
125
+ assert(ft.EXPORT_TAB[1]['C'].rstrip == "Appended")
126
+ ft.EXPORT_TAB.each do |row|
127
+ SAP_LOGGER.debug "XSTR: #{row['XSTR'].unpack("H*")}#\n"
128
+ assert(row['XSTR'].unpack("H*").first == 'deadbeef')
129
+ end
130
+ assert(conn.close)
131
+ rescue SAPNW::RFC::FunctionCallException => e
132
+ SAP_LOGGER.warn "FunctionCallException: #{e.error.inspect}\n"
133
+ raise "gone"
134
+ end
135
+ end
136
+
137
+ def test_BASIC_00040_Test_Deep
138
+ begin
139
+ assert(conn = SAPNW::Base.rfc_connect)
140
+ attrib = conn.connection_attributes
141
+ SAP_LOGGER.debug "Connection Attributes: #{attrib.inspect}\n"
142
+ fds = conn.discover("STFC_DEEP_STRUCTURE")
143
+ SAP_LOGGER.debug "Parameters: #{fds.parameters.keys.inspect}\n"
144
+ fs = fds.new_function_call
145
+ fs.IMPORTSTRUCT = { 'I' => 123, 'C' => 'AbCdEf', 'STR' => 'The quick brown fox ...', 'XSTR' => ["deadbeef"].pack("H*") }
146
+ fs.invoke
147
+ SAP_LOGGER.debug "RESPTEXT: #{fs.RESPTEXT.inspect}\n"
148
+ SAP_LOGGER.debug "ECHOSTRUCT: #{fs.ECHOSTRUCT.inspect}\n"
149
+ assert(fs.ECHOSTRUCT['I'] == 123)
150
+ assert(fs.ECHOSTRUCT['C'].rstrip == 'AbCdEf')
151
+ assert(fs.ECHOSTRUCT['STR'] == 'The quick brown fox ...')
152
+ assert(fs.ECHOSTRUCT['XSTR'].unpack("H*").first == 'deadbeef')
153
+ assert(conn.close)
154
+ rescue SAPNW::RFC::FunctionCallException => e
155
+ SAP_LOGGER.warn "FunctionCallException: #{e.error.inspect}\n"
156
+ raise "gone"
157
+ end
158
+ end
159
+
160
+ def teardown
161
+ end
162
+ end