Title: Support top-level Kotlin functions in CLI · Issue #1339 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Support top-level Kotlin functions in CLI · Issue #1339 · UnitTestBot/UTBotJava
X Title: Support top-level Kotlin functions in CLI · Issue #1339 · UnitTestBot/UTBotJava
Description: Description Top-level Kotlin functions are supported in plugin right now, but currently they don't work correctly in cli. To Reproduce Launch UtBot from cli for the following file (last argument is samples.BitoperationsKt): package sampl...
Open Graph Description: Description Top-level Kotlin functions are supported in plugin right now, but currently they don't work correctly in cli. To Reproduce Launch UtBot from cli for the following file (last argument is...
X Description: Description Top-level Kotlin functions are supported in plugin right now, but currently they don't work correctly in cli. To Reproduce Launch UtBot from cli for the following file (last argumen...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/1339
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support top-level Kotlin functions in CLI","articleBody":"**Description**\r\n\r\nTop-level Kotlin functions are supported in plugin right now, but currently they don't work correctly in cli.\r\n\r\n**To Reproduce**\r\n\r\nLaunch UtBot from cli for the following file (last argument is `samples.BitoperationsKt`):\r\n\r\n```Kotlin\r\npackage samples\r\n\r\nfun xor(x: Int, y: Int): Boolean {\r\n return x xor y == 0\r\n}\r\n```\r\n\r\n**Expected behavior**\r\n\r\nTests are generated\r\n\r\n**Actual behavior**\r\n\r\nException is thrown\r\n\r\n**Visual proofs (screenshots, logs, images)**\r\n\r\n```\r\njava.lang.UnsupportedOperationException: Packages and file facades are not yet supported in Kotlin reflection. Meanwhile please use Java reflection to inspect this class: class samples.BitoperationsKt\r\n\tat kotlin.reflect.jvm.internal.KClassImpl.reportUnresolvedClass(KClassImpl.kt:310)\r\n\tat kotlin.reflect.jvm.internal.KClassImpl.access$reportUnresolvedClass(KClassImpl.kt:44)\r\n\tat kotlin.reflect.jvm.internal.KClassImpl$Data$descriptor$2.invoke(KClassImpl.kt:56)\r\n\tat kotlin.reflect.jvm.internal.KClassImpl$Data$descriptor$2.invoke(KClassImpl.kt:48)\r\n\tat kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:93)\r\n\tat kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:32)\r\n\tat kotlin.reflect.jvm.internal.KClassImpl$Data.getDescriptor(KClassImpl.kt:48)\r\n\tat kotlin.reflect.jvm.internal.KClassImpl.getDescriptor(KClassImpl.kt:182)\r\n\tat kotlin.reflect.jvm.internal.KClassImpl.isData(KClassImpl.kt:277)\r\n\tat org.utbot.framework.plugin.api.util.IdUtilKt.isData(IdUtil.kt:397)\r\n\tat org.utbot.framework.util.ImplicitlyDeclaredMethodsKt.isKnownImplicitlyDeclaredMethod(ImplicitlyDeclaredMethods.kt:18)\r\n\tat org.utbot.cli.GenerateTestsCommand.run(GenerateTestsCommand.kt:102)\r\n\tat com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:204)\r\n\tat com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:213)\r\n\tat com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:17)\r\n\tat com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:396)\r\n\tat com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:393)\r\n\tat com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:411)\r\n\tat com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:436)\r\n\tat org.utbot.cli.ApplicationKt.main(Application.kt:31)\r\n```","author":{"url":"https://github.com/volivan239","@type":"Person","name":"volivan239"},"datePublished":"2022-11-09T13:08:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1339/UTBotJava/issues/1339"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a709608e-1042-9ea7-270f-e32f3eadaaec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B44C:194D2F:E34D09:127A7A2:698E944F |
| html-safe-nonce | 35bb96ff169564f630d04224fdfd0a70f2cf10485b4e0a315c7dea52ea7947fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDRDOjE5NEQyRjpFMzREMDk6MTI3QTdBMjo2OThFOTQ0RiIsInZpc2l0b3JfaWQiOiI4NjU5MzYxNDE3MjYwODY0NTkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 54190d6509072fc17f97d7cf21786619d55479c449929fbcada857c7a260324b |
| hovercard-subject-tag | issue:1442069911 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/UnitTestBot/UTBotJava/1339/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a9c212229aad756bca34619c07d3a8913ce73fbc181e849cc21ab3772ae1b37e/UnitTestBot/UTBotJava/issues/1339 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a9c212229aad756bca34619c07d3a8913ce73fbc181e849cc21ab3772ae1b37e/UnitTestBot/UTBotJava/issues/1339 |
| og:image:alt | Description Top-level Kotlin functions are supported in plugin right now, but currently they don't work correctly in cli. To Reproduce Launch UtBot from cli for the following file (last argument is... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | volivan239 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb2828a801ee6b7be618f3ac76fbf55def35bbc30f053a9c41bf90210b8b72ba |
| turbo-cache-control | no-preview |
| go-import | github.com/UnitTestBot/UTBotJava git https://github.com/UnitTestBot/UTBotJava.git |
| octolytics-dimension-user_id | 87413538 |
| octolytics-dimension-user_login | UnitTestBot |
| octolytics-dimension-repository_id | 480810501 |
| octolytics-dimension-repository_nwo | UnitTestBot/UTBotJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 480810501 |
| octolytics-dimension-repository_network_root_nwo | UnitTestBot/UTBotJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6b91a7e6e46287d26887e3fb7a4161657bab8f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width