-
Notifications
You must be signed in to change notification settings - Fork 758
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
[Bug]: java.lang.NullPointerException Using Unit Test #41429
Comments
@ortegafull87 |
Closing since the solution is provided. Please feel free to reopen if the issue still persists. |
This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now. |
Description
I'am Usign wso2 Microgateway and I considering use unit test in my interceptors, The problem is that
migro-gw buil
it scan unit test annoted with@test:Config{}
but when it compile an error is throwed by ballerina-internal.log filethis is the out:
[2023-09-21 18:59:10,583] SEVERE {b7a.log.crash} - null java.lang.NullPointerException at org.ballerinalang.packerina.task.RunTestsTask.createTestJson(RunTestsTask.java:242) at org.ballerinalang.packerina.task.RunTestsTask.execute(RunTestsTask.java:161) at org.ballerinalang.packerina.TaskExecutor.executeTasks(TaskExecutor.java:38) at org.ballerinalang.packerina.cmd.TestCommand.execute(TestCommand.java:404) at java.util.Optional.ifPresent(Optional.java:159) at org.ballerinalang.tool.Main.main(Main.java:57)
This happened on ballerina project too obviously with same ballerina version
1.2.13
I've used
bal dist use
command with 1.2.13 version On macOs 13.5.2 (22G91) version with Intel Processor.and testerina-assertions/testerina_assertions.bal file has source code.
On ballerina project i'am usign this tree file system structure:
And testerina_assertions.ba is:
Please There's no any documentation how to do unit test for 1.2.13 ballerina versions, how can I fix this issue.
[2023-09-21 18:59:10,583] SEVERE {b7a.log.crash} - null java.lang.NullPointerException
Steps to Reproduce
➜ sdk use java 8.322.06.2-amzn
We periodically need to update the local cache. Please run:
$ sdk update
Using java version 8.322.06.2-amzn in this shell.
victorortega ~/D/M/ballerina-pocs ""@""/"" last: 0m 0s
➜ bal --version
jBallerina 1.2.13
Language specification 2020R1
Update Tool 1.3.13
victorortega ~/D/M/ballerina-pocs ""@""/"" last: 0m 0s
➜ bal test -a
Compiling source
victorortega/tests:0.1.0
Creating balos
target/balo/tests-2020r1-any-0.1.0.balo
Running Tests
ballerina: Oh no, something really went wrong. Bad. Sad.
There should be a file named "ballerina-internal.log" in the current directory.
If you are able to share with us the code that broke Ballerina then
we would REALLY appreciate if you would report this to us:
go to https://github.com/ballerina-platform/ballerina-lang/issues and
create a bug report with both this log file and the sample code.
We thank you for helping make us better dancers.
Affected Version(s)
ballerina: 1.2.13
OS, DB, other environment details and versions
ballerina: 1.2.13
Related area
-> Compilation
-> Test
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: