@@ -41,9 +41,25 @@ if (config.transport === 'rest') {
4141 } ;
4242}
4343
44+ let deprecation = null ;
45+ function deprecationHandler ( dep ) {
46+ deprecation = dep ;
47+ }
48+
49+ function getDeprecation ( ) {
50+ const temp = deprecation ;
51+ deprecation = null ;
52+ return temp ;
53+ }
54+
4455describe ( 'iObj Functional Tests' , function ( ) {
4556 before ( function ( ) {
4657 printConfig ( ) ;
58+ process . on ( 'deprecation' , deprecationHandler ) ;
59+ } ) ;
60+
61+ after ( function ( ) {
62+ process . removeAllListeners ( 'deprecation' , deprecationHandler ) ;
4763 } ) ;
4864
4965 describe ( 'constructor' , function ( ) {
@@ -53,6 +69,8 @@ describe('iObj Functional Tests', function () {
5369 const obj = new iObj ( connection ) ;
5470
5571 expect ( obj ) . to . be . instanceOf ( iObj ) ;
72+ expect ( getDeprecation ( ) . message ) . to
73+ . equal ( "As of v1.0, class 'iObj' is deprecated and will be removed at a later time." ) ;
5674 } ) ;
5775 } ) ;
5876
@@ -63,6 +81,8 @@ describe('iObj Functional Tests', function () {
6381 const obj = new iObj ( connection ) ;
6482
6583 obj . retrUsrAuth ( '*PUBLIC' , '*PGM' , 'XMLCGI' , 'QXMLSERV' , ( output ) => {
84+ expect ( getDeprecation ( ) . message ) . to
85+ . equal ( "As of v1.0, 'iObj.retrUsrAuth()' is deprecated and will be removed at a later time." ) ;
6686 expect ( output ) . to . be . an ( 'Object' ) ;
6787 expect ( output ) . to . have . a . property ( 'Object_authority_/_Data_authority' ) ;
6888 expect ( output ) . to . have . a . property ( 'Authorization_list_management' ) ;
@@ -107,6 +127,8 @@ describe('iObj Functional Tests', function () {
107127 const obj = new iObj ( connection ) ;
108128
109129 obj . retrCmdInfo ( 'CRTLIB' , '*LIBL' , ( output ) => {
130+ expect ( getDeprecation ( ) . message ) . to
131+ . equal ( "As of v1.0, 'iObj.retrCmdInfo()' is deprecated and will be removed at a later time." ) ;
110132 expect ( output ) . to . be . an ( 'Object' ) ;
111133 expect ( output ) . to . have . a . property ( 'Command_name' ) ;
112134 expect ( output ) . to . have . a . property ( 'Command_library_name' ) ;
@@ -159,6 +181,8 @@ describe('iObj Functional Tests', function () {
159181 const obj = new iObj ( connection ) ;
160182
161183 obj . retrPgmInfo ( 'XMLCGI' , 'QXMLSERV' , ( output ) => {
184+ expect ( getDeprecation ( ) . message ) . to
185+ . equal ( "As of v1.0, 'iObj.retrPgmInfo()' is deprecated and will be removed at a later time." ) ;
162186 expect ( output ) . to . be . an ( 'Object' ) ;
163187 expect ( output ) . to . have . a . property ( 'Program_name' ) ;
164188 expect ( output ) . to . have . a . property ( 'Program_library_name' ) ;
@@ -233,6 +257,8 @@ describe('iObj Functional Tests', function () {
233257 const obj = new iObj ( connection ) ;
234258
235259 obj . retrSrvPgmInfo ( 'QZSRVSSL' , 'QHTTPSVR' , ( output ) => {
260+ expect ( getDeprecation ( ) . message ) . to
261+ . equal ( "As of v1.0, 'iObj.retrSrvPgmInfo()' is deprecated and will be removed at a later time." ) ;
236262 expect ( output ) . to . be . an ( 'Object' ) ;
237263 expect ( output ) . to . have . a . property ( 'Service_program_name' ) ;
238264 expect ( output ) . to . have . a . property ( 'Service_program_name' ) ;
@@ -288,6 +314,8 @@ describe('iObj Functional Tests', function () {
288314 const obj = new iObj ( connection ) ;
289315
290316 obj . retrUserInfo ( 'QSYS' , ( output ) => {
317+ expect ( getDeprecation ( ) . message ) . to
318+ . equal ( "As of v1.0, 'iObj.retrUserInfo()' is deprecated and will be removed at a later time." ) ;
291319 expect ( output ) . to . be . an ( 'Object' ) ;
292320 expect ( output ) . to . have . a . property ( 'User_profile_name' ) ;
293321 expect ( output ) . to . have . a . property ( 'Previous_sign-on_date_and_time' ) ;
@@ -314,6 +342,8 @@ describe('iObj Functional Tests', function () {
314342 const obj = new iObj ( connection ) ;
315343
316344 obj . retrUserAuthToObj ( '/home' , ( output ) => {
345+ expect ( getDeprecation ( ) . message ) . to
346+ . equal ( "As of v1.0, 'iObj.retrUserAuthToObj()' is deprecated and will be removed at a later time." ) ;
317347 expect ( output ) . to . be . an ( 'Object' ) ;
318348 expect ( output ) . to . have . a . property ( 'Profile_name' ) ;
319349 expect ( output ) . to . have . a . property ( 'User_or_group_indicator' ) ;
@@ -341,6 +371,8 @@ describe('iObj Functional Tests', function () {
341371 const obj = new iObj ( connection ) ;
342372
343373 obj . addToLibraryList ( 'QHTTPSVR' , ( output ) => {
374+ expect ( getDeprecation ( ) . message ) . to
375+ . equal ( "As of v1.0, 'iObj.addToLibraryList()' is deprecated and will be removed at a later time." ) ;
344376 expect ( output ) . to . be . a ( 'boolean' ) . and . to . equal ( true ) ;
345377 done ( ) ;
346378 } ) ;
0 commit comments