openmainframeproject / cobol-check

A testing framework for Cobol applications
Apache License 2.0
78 stars 28 forks source link

Sign off #263

Closed sam94dion closed 1 year ago

sam94dion commented 1 year ago

Signed-off-by: Samuel sam94dion@gmail.com

sam94dion commented 1 year ago

Hi,

So I did a rebase to avoid signing of all my previous commits. Sorry If that is not the best way. Doing a rebase is what I found on stackoverflow.

Added functionalities :

  1. If you want to test a subprogram but the sub program is passed a linkage section you would want to stub that part for the program to be able to run without dependences.

example:

 LINKAGE SECTION.  
 COPY COPY002.
 PROCEDURE DIVISION.

TO

      * LINKAGE SECTION.

       COPY COPY002.

       PROCEDURE DIVISION.
  1. You might declare SQL cursors within your working-section which will need to be stubbed

example:

           EXEC SQL  
              DECLARE NAME-CUR CURSOR FOR  
              SELECT FIRST_NAME, LAST_NAME FROM TEXEM
           END-EXEC.

TO

      *      EXEC SQL  
      *        DECLARE NAME-CUR CURSOR FOR  
      *        SELECT FIRST_NAME, LAST_NAME FROM TEXEM
      *      END-EXEC.
  1. If you have SQL copybook you might want to use the variables within the copybook but discard other information. example:
       EXEC SQL INCLUDE TEXEM  END-EXEC.

TO

       01  TEXEM.                                                               
           10 FIRST-NAME           PIC X(10).                                   
           10 LAST-NAME            PIC X(10).                                   
           10 TMS-CREA             PIC X(26).     
sam94dion commented 1 year ago

@dakaa16

I didn't want to make a instant of reader in the generate class to use readAsOneStatement() that is why I created the getter()

sam94dion commented 1 year ago

Hi @dakaa16 I'll get those fixed in a bit :) happy new years to you too.

sam94dion commented 1 year ago

Done should be better :)

Rune-Christensen commented 1 year ago

Hi @sam94dion These changes were implemented in pull request https://github.com/openmainframeproject/cobol-check/pull/278 I am therefore closing this PR. Thank you :-)