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

[Enhancement] Add test code for this module [eventmesh-runtime] #869

Open
1 of 2 tasks
Alonexc opened this issue May 17, 2022 · 10 comments
Open
1 of 2 tasks

[Enhancement] Add test code for this module [eventmesh-runtime] #869

Alonexc opened this issue May 17, 2022 · 10 comments
Assignees
Labels
enhancement New feature or request good first issue Issues for first-time contributors Hacktoberfest help wanted Extra attention is needed

Comments

@Alonexc
Copy link
Contributor

Alonexc commented May 17, 2022

Search before asking

  • I had searched in the issues and found no similar issues.

Enhancement Request

Add test code for eventmesh-runtime module.

Describe the solution you'd like

Module name: eventmesh-runtime
Located in: eventmesh-runtime
Task status: ×(unfinished) / √(finished)

Notes: The following classes are only a part of this module. If you want to do some unit tests for this module, you can select some classes in this module for unit testing, but please submit a detailed issue separately and linked to the pr you submitted, because this issue will not be deleted.

Task Status Class Type
× org/apache/eventmesh/runtime/util/EventMeshThreadFactoryImpl.java utils
× org/apache/eventmesh/runtime/util/EventMeshUtil.java utils
× org/apache/eventmesh/runtime/util/HttpTinyClient.java utils
× org/apache/eventmesh/runtime/util/IOTinyUtils.java utils
× org/apache/eventmesh/runtime/util/NetUtils.java utils
× org/apache/eventmesh/runtime/util/RemotingHelper.java utils
× org/apache/eventmesh/runtime/util/WebhookUtil.java utils
× org/apache/eventmesh/runtime/admin/controller/ClientManageController.java controller
× org/apache/eventmesh/runtime/admin/handler/QueryRecommendEventMeshHandler.java handler
× org/apache/eventmesh/runtime/admin/handler/RedirectClientByPathHandler.java handler

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@Alonexc Alonexc added the enhancement New feature or request label May 17, 2022
@xwm1992 xwm1992 added the good first issue Issues for first-time contributors label May 18, 2022
@walterlife
Copy link
Contributor

Please assign to me. I'll try to work on this.

@qqeasonchen
Copy link
Contributor

@walterlife you can reopen a new sub-issue and work on it, this issue will open until the code coverage up to 100%.

@dunchin7
Copy link

Can i work on this?

@hanshal101
Copy link
Contributor

Please assign me I would like to work on this issue.

@Pil0tXia Pil0tXia added the help wanted Extra attention is needed label Jan 10, 2024
@arsenalzp
Copy link
Contributor

Any progress with this issue? I would like to tackle.

@Pil0tXia
Copy link
Member

@arsenalzp You may add missing unit tests under the runtime module.

@arsenalzp
Copy link
Contributor

arsenalzp commented Jan 27, 2024

@arsenalzp You may add missing unit tests under the runtime module.

Hello,
I took some unit tests, however I guess my project was not configured properly because even already merged unit tests code failed with error:

Run the test:

gradle test --tests org.apache.eventmesh.runtime.admin.handler.QueryRecommendEventMeshHandlerTest

Output:

org.mockito.exceptions.base.MockitoException: 
Mockito cannot mock this class: class org.apache.eventmesh.runtime.boot.EventMeshTCPServer.

If you're not sure why you're getting this error, please report to the mailing list.


Java               : 17
JVM vendor name    : Red Hat, Inc.
JVM vendor version : 17.0.8+7
JVM name           : OpenJDK 64-Bit Server VM
JVM version        : 17.0.8+7
JVM info           : mixed mode, sharing
OS name            : Linux
OS version         : 6.2.15-200.fc37.x86_64


You are seeing this disclaimer because Mockito is configured to create inlined mocks.
You can learn about inline mocks and their limitations under item #39 of the Mockito class javadoc.

> Task :eventmesh-runtime:test

QueryRecommendEventMeshHandlerTest > testHandle() FAILED
    org.mockito.exceptions.base.MockitoException at QueryRecommendEventMeshHandlerTest.java:52
        Caused by: org.mockito.exceptions.base.MockitoException at QueryRecommendEventMeshHandlerTest.java:52
            Caused by: java.lang.IllegalStateException at QueryRecommendEventMeshHandlerTest.java:52
                Caused by: java.lang.IllegalArgumentException at QueryRecommendEventMeshHandlerTest.java:52

@Pil0tXia
Copy link
Member

@arsenalzp

JVM version : 17.0.8+7

Please retry using JDK8. If you're still encountering problems, it may be a potential bug and it's welcome to fix it.

@arsenalzp
Copy link
Contributor

@arsenalzp

JVM version : 17.0.8+7

Please retry using JDK8. If you're still encountering problems, it may be a potential bug and it's welcome to fix it.

Hello,
You were right, the issue fixed by using OpenJSK 8

@melisolmez
Copy link
Contributor

Hello, Can I work on this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Issues for first-time contributors Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants