Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/nw23001440/262 mock oc feod #474

Merged
merged 8 commits into from
Mar 22, 2024

Conversation

davidepalladino-apuliasoft
Copy link
Collaborator

@davidepalladino-apuliasoft davidepalladino-apuliasoft commented Mar 22, 2024

Description

Firstly, for this task was created an interface for those operators mocked, with a refactoring of previous implementation. Then, created the FeodStmt so that Jariko no longer crashes.

Checklist:

  • There are tests regarding this feature
  • The code follows the Kotlin conventions (run ./gradlew ktlintCheck)
  • The code passes all tests (run ./gradlew check)
  • There is a specific documentation in the docs directory

Copy link
Collaborator

@lanarimarco lanarimarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we implement mock statement like this we have no idea if a codop works because is good or because is silly :-).
My proposal is:

  • Define a MockStatement empty interface
  • All mocked statements should implement that interface
  • Define a new callback function JarikoCallback.onMockStatement: (mockStatement: MockStatement) -> Unit with default implementation: System.err.println("Executing mock.... bla bla bla...");
  • Before of statement.execute if statement is MockStatement invoke MainExecutionContext.getConfiguration().jarikoCallback.onMockStatement(statement)

This way we can log this warning but in addition, we are able to delegate something other to make blocking the codop mock implementation.

If you want to speak at voice I am here.

@davidepalladino-apuliasoft
Copy link
Collaborator Author

If we implement mock statement like this we have no idea if a codop works because is good or because is silly :-). My proposal is:

* Define a  `MockStatement` empty interface

* All mocked statements should implement that interface

* Define a new callback function `JarikoCallback.onMockStatement: (mockStatement: MockStatement) -> Unit` with default implementation: `System.err.println("Executing mock.... bla bla bla...");`

* Before of [statement.execute](https://github.com/smeup/jariko/blob/fa7fc7b84c989c64e7dc713a9f68f8ff7d2645f3/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/internal_interpreter.kt#L414) if statement is `MockStatement` invoke `MainExecutionContext.getConfiguration().jarikoCallback.onMockStatement(statement)`

This way we can log this warning but in addition, we are able to delegate something other to make blocking the codop mock implementation.

If you want to speak at voice I am here.

Could MockStatement extends Statement?

@lanarimarco
Copy link
Collaborator

lanarimarco commented Mar 22, 2024 via email

@davidepalladino-apuliasoft
Copy link
Collaborator Author

Yes Il giorno ven 22 mar 2024 alle ore 15:49 Davide @.> ha scritto:

If we implement mock statement like this we have no idea if a codop works because is good or because is silly :-). My proposal is: * Define a MockStatement empty interface * All mocked statements should implement that interface * Define a new callback function JarikoCallback.onMockStatement: (mockStatement: MockStatement) -> Unit with default implementation: System.err.println("Executing mock.... bla bla bla..."); * Before of statement.execute if statement is MockStatement invoke MainExecutionContext.getConfiguration().jarikoCallback.onMockStatement(statement) This way we can log this warning but in addition, we are able to delegate something other to make blocking the codop mock implementation. If you want to speak at voice I am here. Could MockStatement extends Statement? — Reply to this email directly, view it on GitHub <#474 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJR622U5LXEDJD4G6CR6KI3YZRAG5AVCNFSM6AAAAABFDK2QEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJVGI3DMNZWG4 . You are receiving this because your review was requested.Message ID: @.
>
-- [image: smeup] https://www.smeup.com Marco Lanari R&D Department - Developer Office: 0521940611 <00390521940611> www.smeup.com SMEUP LAB SRL Via Carra, 8 - 43122 Parma (PR) [image: smeup] https://bit.ly/43hyvY0

Ok, the idea is perfect and clean. Check new commits

@lanarimarco lanarimarco self-assigned this Mar 22, 2024
@lanarimarco lanarimarco merged commit 48813ac into develop Mar 22, 2024
1 check passed
@lanarimarco lanarimarco deleted the bugfix/NW23001440/262-mock-oc-feod branch March 22, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants