Skip to content

Commit cd47476

Browse files
authored
fix: TODOs in Deprecated.js (#240)
1 parent 29bc850 commit cd47476

File tree

8 files changed

+19
-51
lines changed

8 files changed

+19
-51
lines changed

lib/Deprecated.js

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,6 @@ class iNetwork {
796796
DNS_listening_port: data[27]._,
797797
Host_name: data[28]._,
798798
Domain_name: data[29]._,
799-
Reserved: data[30]._,
800799
Domain_search_list: data[31]._,
801800
};
802801
} else { rtValue = str; }
@@ -1217,17 +1216,13 @@ class iObj {
12171216
Adopted_data_update: data[21]._,
12181217
Adopted_data_delete: data[22]._,
12191218
Adopted_data_execute: data[23]._,
1220-
Reserved: data[24]._,
12211219
Adopted_object_alter: data[25]._,
12221220
Adopted_object_reference: data[26]._,
1223-
// Reserved: data[27]._, // TODO: duplicate key
12241221
Data_execute: data[28]._,
1225-
// Reserved: data[29]._, // TODO: duplicate key
12261222
Object_alter: data[30]._,
12271223
Object_reference: data[31]._,
12281224
ASP_device_name_of_library: data[32]._,
12291225
ASP_device_name_of_object: data[33]._,
1230-
// Reserved: data[34]._, // TODO: duplicate key
12311226
Offset_to_group_information_table: data[35]._,
12321227
Number_of_group_table_entries_returned: data[36]._,
12331228
};
@@ -1530,7 +1525,6 @@ class iObj {
15301525
Text_description: data[17]._,
15311526
Type_of_program: data[18]._,
15321527
'Teraspace_storage-enabled_program': data[19]._,
1533-
Reserved: data[20]._,
15341528
Minimum_number_of_parameters: data[21]._,
15351529
Maximum_number_of_parameters: data[22]._,
15361530
Program_size: data[23]._,
@@ -1548,13 +1542,11 @@ class iObj {
15481542
Program_domain: data[35]._,
15491543
Conversion_required: data[36]._,
15501544
Conversion_details: data[37]._,
1551-
// Reserved: data[38]._, // TODO: duplicate
15521545
Optimization: data[39]._,
15531546
Paging_pool: data[40]._,
15541547
'Update_program_automatic_storage_area_(PASA)': data[41]._,
15551548
'Clear_program_automatic_storage_area_(PASA)': data[42]._,
15561549
Paging_amount: data[43]._,
1557-
// Reserved: data[38]._, // TODO: duplicate
15581550
Program_entry_procedure_module: data[45]._,
15591551
Program_entry_procedure_module_library: data[46]._,
15601552
Activation_group_attribute: data[47]._,
@@ -1715,7 +1707,6 @@ class iObj {
17151707
Teraspace_storage_enabled_modules: data[26]._,
17161708
Storage_model: data[27]._,
17171709
'Uses_argument_optimization_(ARGOPT)': data[28]._,
1718-
"Reserved_'00'X": data[29]._,
17191710
Service_program_state: data[30]._,
17201711
Service_program_domain: data[31]._,
17211712
Associated_space_size: data[32]._,
@@ -1728,7 +1719,6 @@ class iObj {
17281719
Conversion_required: data[39]._,
17291720
All_creation_data: data[40]._,
17301721
Conversion_details: data[41]._,
1731-
Reserved: data[42]._,
17321722
Paging_pool: data[43]._,
17331723
Paging_amount: data[44]._,
17341724
};
@@ -1808,12 +1798,10 @@ class iObj {
18081798
rtValue = {
18091799
User_profile_name: data[2]._,
18101800
'Previous_sign-on_date_and_time': data[3]._,
1811-
// Reserved: data[4]._, // TODO: This is a duplicate
18121801
'Sign-on_attempts_not_valid': data[5]._,
18131802
Status: data[6]._,
18141803
Password_change_date: data[7]._,
18151804
No_password_indicator: data[8]._,
1816-
Reserved: data[9]._,
18171805
Password_expiration_interval: data[10]._,
18181806
Date_password_expires: data[11]._,
18191807
Days_until_password_expires: data[12]._,
@@ -1924,7 +1912,6 @@ class iObj {
19241912
Object_existence: data[5]._,
19251913
Object_alter: data[6]._,
19261914
Object_reference: data[7]._,
1927-
Reserved: data[8]._,
19281915
Object_operational: data[9]._,
19291916
Data_read: data[10]._,
19301917
Data_add: data[11]._,
@@ -2116,7 +2103,6 @@ class iProd {
21162103
Server_IPL_required: data[29]._,
21172104
Creation_date_and_time: data[30]._,
21182105
Technology_refresh_PTF: data[31]._,
2119-
Reserved: data[32]._,
21202106
};
21212107
} else { rtValue = str; }
21222108

@@ -2232,7 +2218,6 @@ class iProd {
22322218
const { data } = result.myscript.pgm[0].parm[0].ds[0];
22332219

22342220
rtValue = {
2235-
// Reserved: data[2]._, // TODO: Duplicate key
22362221
Product_ID: data[3]._,
22372222
Release_level: data[4]._,
22382223
Product_option: data[5]._,
@@ -2244,14 +2229,12 @@ class iProd {
22442229
Supported_flag: data[11]._,
22452230
Registration_type: data[12]._,
22462231
Registration_value: data[13]._,
2247-
// Reserved: data[14]._, // TODO: Duplicate key
22482232
Offset_to_additional_information: data[15]._,
22492233
Primary_language_load_identifier: data[16]._,
22502234
Minimum_target_release: data[17]._,
22512235
'Minimum_VRM_of_*BASE_required_by_option': data[18]._,
22522236
Requirements_met_between_base_and_option_value: data[19]._,
22532237
Level: data[20]._,
2254-
Reserved: data[21]._,
22552238
};
22562239
} else { rtValue = str; }
22572240

@@ -2767,8 +2750,14 @@ class iWork {
27672750
return false;
27682751
}));
27692752

2770-
// TODO: Throw error
2771-
if (keyValid === false) { return; }
2753+
if (keyValid === false) {
2754+
if (this.reportError) {
2755+
cb(new Error(`Invalid System value: ${sysValue}`), null);
2756+
return;
2757+
}
2758+
cb(null);
2759+
return;
2760+
}
27722761

27732762
let item;
27742763
if (type === '10i0') { item = { type: '10i0', value: 0 }; } else { item = { type, value: '' }; }
@@ -3398,8 +3387,6 @@ const xmlToJson = (xml) => {
33983387
const rtDataRegG = /<data desc='.*?'>[\s\S]*?<\/data>/g;
33993388
const rtDataReg = /<data desc='(.*?)'>([\s\S]*?)<\/data>/;
34003389

3401-
// const dsRegG = /<ds.*?>[\s\S]+?<\/ds>/g; // TODO: Not used
3402-
// const dsReg = /<ds.*?>([\s\S]+?)<\/ds>/; // TODO: Not used
34033390
const dataRegG = /<data[\s\S]*?<\/data>/g;
34043391
const dataReg = /<data.*?type='(.*?)'.*?>([\s\S]*?)<\/data>/;
34053392
const sqlResultG = /<row>[\s\S]+?<\/row>/g;

test/functional/deprecated/iNetworkFunctional.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ describe('iNetwork Functional Tests', () => {
9292
expect(output).to.have.a.property('DNS_listening_port');
9393
expect(output).to.have.a.property('Host_name');
9494
expect(output).to.have.a.property('Domain_name');
95-
expect(output).to.have.a.property('Reserved');
9695
expect(output).to.have.a.property('Domain_search_list');
9796
done();
9897
});

test/functional/deprecated/iObjFunctional.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,13 @@ describe('iObj Functional Tests', () => {
8686
expect(output).to.have.a.property('Adopted_data_update');
8787
expect(output).to.have.a.property('Adopted_data_delete');
8888
expect(output).to.have.a.property('Adopted_data_execute');
89-
expect(output).to.have.a.property('Reserved');
9089
expect(output).to.have.a.property('Adopted_object_alter');
9190
expect(output).to.have.a.property('Adopted_object_reference');
92-
expect(output).to.have.a.property('Reserved');
9391
expect(output).to.have.a.property('Data_execute');
94-
expect(output).to.have.a.property('Reserved');
9592
expect(output).to.have.a.property('Object_alter');
9693
expect(output).to.have.a.property('Object_reference');
9794
expect(output).to.have.a.property('ASP_device_name_of_library');
9895
expect(output).to.have.a.property('ASP_device_name_of_object');
99-
expect(output).to.have.a.property('Reserved');
10096
expect(output).to.have.a.property('Offset_to_group_information_table');
10197
expect(output).to.have.a.property('Number_of_group_table_entries_returned');
10298
done();
@@ -182,7 +178,6 @@ describe('iObj Functional Tests', () => {
182178
expect(output).to.have.a.property('Text_description');
183179
expect(output).to.have.a.property('Type_of_program');
184180
expect(output).to.have.a.property('Teraspace_storage-enabled_program');
185-
expect(output).to.have.a.property('Reserved');
186181
expect(output).to.have.a.property('Minimum_number_of_parameters');
187182
expect(output).to.have.a.property('Maximum_number_of_parameters');
188183
expect(output).to.have.a.property('Program_size');
@@ -200,13 +195,11 @@ describe('iObj Functional Tests', () => {
200195
expect(output).to.have.a.property('Program_domain');
201196
expect(output).to.have.a.property('Conversion_required');
202197
expect(output).to.have.a.property('Conversion_details');
203-
expect(output).to.have.a.property('Reserved');
204198
expect(output).to.have.a.property('Optimization');
205199
expect(output).to.have.a.property('Paging_pool');
206200
expect(output).to.have.a.property('Update_program_automatic_storage_area_(PASA)');
207201
expect(output).to.have.a.property('Clear_program_automatic_storage_area_(PASA)');
208202
expect(output).to.have.a.property('Paging_amount');
209-
expect(output).to.have.a.property('Reserved');
210203
expect(output).to.have.a.property('Program_entry_procedure_module');
211204
expect(output).to.have.a.property('Program_entry_procedure_module_library');
212205
expect(output).to.have.a.property('Activation_group_attribute');
@@ -269,7 +262,6 @@ describe('iObj Functional Tests', () => {
269262
expect(output).to.have.a.property('Teraspace_storage_enabled_modules');
270263
expect(output).to.have.a.property('Storage_model');
271264
expect(output).to.have.a.property('Uses_argument_optimization_(ARGOPT)');
272-
expect(output).to.have.a.property('Reserved_\'00\'X');
273265
expect(output).to.have.a.property('Service_program_state');
274266
expect(output).to.have.a.property('Service_program_domain');
275267
expect(output).to.have.a.property('Associated_space_size');
@@ -282,7 +274,6 @@ describe('iObj Functional Tests', () => {
282274
expect(output).to.have.a.property('Conversion_required');
283275
expect(output).to.have.a.property('All_creation_data');
284276
expect(output).to.have.a.property('Conversion_details');
285-
expect(output).to.have.a.property('Reserved');
286277
expect(output).to.have.a.property('Paging_pool');
287278
expect(output).to.have.a.property('Paging_amount');
288279
done();
@@ -300,12 +291,10 @@ describe('iObj Functional Tests', () => {
300291
expect(output).to.be.an('Object');
301292
expect(output).to.have.a.property('User_profile_name');
302293
expect(output).to.have.a.property('Previous_sign-on_date_and_time');
303-
expect(output).to.have.a.property('Reserved');
304294
expect(output).to.have.a.property('Sign-on_attempts_not_valid');
305295
expect(output).to.have.a.property('Status');
306296
expect(output).to.have.a.property('Password_change_date');
307297
expect(output).to.have.a.property('No_password_indicator');
308-
expect(output).to.have.a.property('Reserved');
309298
expect(output).to.have.a.property('Password_expiration_interval');
310299
expect(output).to.have.a.property('Date_password_expires');
311300
expect(output).to.have.a.property('Days_until_password_expires');
@@ -334,7 +323,6 @@ describe('iObj Functional Tests', () => {
334323
expect(output).to.have.a.property('Object_existence');
335324
expect(output).to.have.a.property('Object_alter');
336325
expect(output).to.have.a.property('Object_reference');
337-
expect(output).to.have.a.property('Reserved');
338326
expect(output).to.have.a.property('Object_operational');
339327
expect(output).to.have.a.property('Data_read');
340328
expect(output).to.have.a.property('Data_add');

test/functional/deprecated/iProdFunctional.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ describe('iProd Functional Tests', () => {
9393
expect(ptf).to.have.a.property('Server_IPL_required');
9494
expect(ptf).to.have.a.property('Creation_date_and_time');
9595
expect(ptf).to.have.a.property('Technology_refresh_PTF');
96-
expect(ptf).to.have.a.property('Reserved');
9796
done();
9897
});
9998
});
@@ -107,7 +106,6 @@ describe('iProd Functional Tests', () => {
107106

108107
prod.getProductInfo('5770DG1', (product) => {
109108
expect(product).to.be.an('Object');
110-
expect(product).to.have.a.property('Reserved');
111109
expect(product).to.have.a.property('Product_ID');
112110
expect(product).to.have.a.property('Release_level');
113111
expect(product).to.have.a.property('Product_option');

test/functional/iNetworkFunctional.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ describe('iNetwork Functional Tests', () => {
6565
expect(output).to.have.a.property('DNS_listening_port');
6666
expect(output).to.have.a.property('Host_name');
6767
expect(output).to.have.a.property('Domain_name');
68-
expect(output).to.have.a.property('Reserved');
6968
expect(output).to.have.a.property('Domain_search_list');
7069
done();
7170
});

test/functional/iObjFunctional.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,13 @@ describe('iObj Functional Tests', () => {
5858
expect(output).to.have.a.property('Adopted_data_update');
5959
expect(output).to.have.a.property('Adopted_data_delete');
6060
expect(output).to.have.a.property('Adopted_data_execute');
61-
expect(output).to.have.a.property('Reserved');
6261
expect(output).to.have.a.property('Adopted_object_alter');
6362
expect(output).to.have.a.property('Adopted_object_reference');
64-
expect(output).to.have.a.property('Reserved');
6563
expect(output).to.have.a.property('Data_execute');
66-
expect(output).to.have.a.property('Reserved');
6764
expect(output).to.have.a.property('Object_alter');
6865
expect(output).to.have.a.property('Object_reference');
6966
expect(output).to.have.a.property('ASP_device_name_of_library');
7067
expect(output).to.have.a.property('ASP_device_name_of_object');
71-
expect(output).to.have.a.property('Reserved');
7268
expect(output).to.have.a.property('Offset_to_group_information_table');
7369
expect(output).to.have.a.property('Number_of_group_table_entries_returned');
7470
done();
@@ -156,7 +152,6 @@ describe('iObj Functional Tests', () => {
156152
expect(output).to.have.a.property('Text_description');
157153
expect(output).to.have.a.property('Type_of_program');
158154
expect(output).to.have.a.property('Teraspace_storage-enabled_program');
159-
expect(output).to.have.a.property('Reserved');
160155
expect(output).to.have.a.property('Minimum_number_of_parameters');
161156
expect(output).to.have.a.property('Maximum_number_of_parameters');
162157
expect(output).to.have.a.property('Program_size');
@@ -174,13 +169,11 @@ describe('iObj Functional Tests', () => {
174169
expect(output).to.have.a.property('Program_domain');
175170
expect(output).to.have.a.property('Conversion_required');
176171
expect(output).to.have.a.property('Conversion_details');
177-
expect(output).to.have.a.property('Reserved');
178172
expect(output).to.have.a.property('Optimization');
179173
expect(output).to.have.a.property('Paging_pool');
180174
expect(output).to.have.a.property('Update_program_automatic_storage_area_(PASA)');
181175
expect(output).to.have.a.property('Clear_program_automatic_storage_area_(PASA)');
182176
expect(output).to.have.a.property('Paging_amount');
183-
expect(output).to.have.a.property('Reserved');
184177
expect(output).to.have.a.property('Program_entry_procedure_module');
185178
expect(output).to.have.a.property('Program_entry_procedure_module_library');
186179
expect(output).to.have.a.property('Activation_group_attribute');
@@ -244,7 +237,6 @@ describe('iObj Functional Tests', () => {
244237
expect(output).to.have.a.property('Teraspace_storage_enabled_modules');
245238
expect(output).to.have.a.property('Storage_model');
246239
expect(output).to.have.a.property('Uses_argument_optimization_(ARGOPT)');
247-
expect(output).to.have.a.property('Reserved_\'00\'X');
248240
expect(output).to.have.a.property('Service_program_state');
249241
expect(output).to.have.a.property('Service_program_domain');
250242
expect(output).to.have.a.property('Associated_space_size');
@@ -257,7 +249,6 @@ describe('iObj Functional Tests', () => {
257249
expect(output).to.have.a.property('Conversion_required');
258250
expect(output).to.have.a.property('All_creation_data');
259251
expect(output).to.have.a.property('Conversion_details');
260-
expect(output).to.have.a.property('Reserved');
261252
expect(output).to.have.a.property('Paging_pool');
262253
expect(output).to.have.a.property('Paging_amount');
263254
done();
@@ -276,12 +267,10 @@ describe('iObj Functional Tests', () => {
276267
expect(output).to.be.an('Object');
277268
expect(output).to.have.a.property('User_profile_name');
278269
expect(output).to.have.a.property('Previous_sign-on_date_and_time');
279-
expect(output).to.have.a.property('Reserved');
280270
expect(output).to.have.a.property('Sign-on_attempts_not_valid');
281271
expect(output).to.have.a.property('Status');
282272
expect(output).to.have.a.property('Password_change_date');
283273
expect(output).to.have.a.property('No_password_indicator');
284-
expect(output).to.have.a.property('Reserved');
285274
expect(output).to.have.a.property('Password_expiration_interval');
286275
expect(output).to.have.a.property('Date_password_expires');
287276
expect(output).to.have.a.property('Days_until_password_expires');
@@ -311,7 +300,6 @@ describe('iObj Functional Tests', () => {
311300
expect(output).to.have.a.property('Object_existence');
312301
expect(output).to.have.a.property('Object_alter');
313302
expect(output).to.have.a.property('Object_reference');
314-
expect(output).to.have.a.property('Reserved');
315303
expect(output).to.have.a.property('Object_operational');
316304
expect(output).to.have.a.property('Data_read');
317305
expect(output).to.have.a.property('Data_add');

test/functional/iProdFunctional.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ describe('iProd Functional Tests', () => {
6565
expect(ptf).to.have.a.property('Server_IPL_required');
6666
expect(ptf).to.have.a.property('Creation_date_and_time');
6767
expect(ptf).to.have.a.property('Technology_refresh_PTF');
68-
expect(ptf).to.have.a.property('Reserved');
6968
done();
7069
});
7170
});
@@ -80,7 +79,6 @@ describe('iProd Functional Tests', () => {
8079
prod.getProductInfo('5770DG1', (error, product) => {
8180
expect(error).to.equal(null);
8281
expect(product).to.be.an('Object');
83-
expect(product).to.have.a.property('Reserved');
8482
expect(product).to.have.a.property('Product_ID');
8583
expect(product).to.have.a.property('Release_level');
8684
expect(product).to.have.a.property('Product_option');

test/functional/iWorkFunctional.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ describe('iWork Functional Tests', () => {
4040
done();
4141
});
4242
});
43+
44+
it('returns an error when the specified system value is invalid', (done) => {
45+
const connection = new Connection(config);
46+
47+
const work = new iWork(connection);
48+
49+
work.getSysValue('invalid', (error) => {
50+
expect(error).to.be.a('error');
51+
done();
52+
});
53+
});
4354
});
4455

4556
describe('getSysStatus', () => {

0 commit comments

Comments
 (0)