Title: Disable tests with unpermitted operations in Threads · Issue #895 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Disable tests with unpermitted operations in Threads · Issue #895 · UnitTestBot/UTBotJava
X Title: Disable tests with unpermitted operations in Threads · Issue #895 · UnitTestBot/UTBotJava
Description: Description Tests with unpermitted operation is Threads should be disabled, but they are up. To Reproduce IntelliJ IDEA 2022.1.4 with latest UTBot plugin installed Create/open a project with JDK 8/11 Add the following class and generate ...
Open Graph Description: Description Tests with unpermitted operation is Threads should be disabled, but they are up. To Reproduce IntelliJ IDEA 2022.1.4 with latest UTBot plugin installed Create/open a project with JDK 8/...
X Description: Description Tests with unpermitted operation is Threads should be disabled, but they are up. To Reproduce IntelliJ IDEA 2022.1.4 with latest UTBot plugin installed Create/open a project with JDK 8/...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/895
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Disable tests with unpermitted operations in Threads","articleBody":"**Description**\r\n\r\nTests with unpermitted operation is Threads should be disabled, but they are up.\r\n\r\n**To Reproduce**\r\n\r\n1. IntelliJ IDEA 2022.1.4 with latest UTBot plugin installed\r\n2. Create/open a project with JDK 8/11\r\n3. Add the following class and generate tests for it with default settings:\r\n\r\n```java\r\npublic class SecurityCheck {\r\n public int read() throws Throwable {\r\n Thread t = new Thread(\"fileRead\") {\r\n public void run() {\r\n try {\r\n new File(\"a.txt\").createNewFile();\r\n } catch (IOException e) {\r\n throw new RuntimeException(e);\r\n }\r\n }\r\n };\r\n t.start();\r\n Thread.sleep(500);\r\n return 10;\r\n }\r\n}\r\n```\r\n\r\n4. Open the generated test\r\n\r\n**Expected behavior**\r\n\r\nGenerated test should be disabled due to sandbox.\r\n\r\n**Actual behavior**\r\n\r\nThe following method is not executed - AccessControlException is thrown (was seen in Concrete executor logs when they were informative) - that's Ok.\r\nBut the generated tests are not disabled due to Sandbox. If we run the test - file will be created.\r\n\r\n**Visual proofs (screenshots, logs, images)**\r\n\r\n~~~java\r\npublic class SecurityCheckTest {\r\n @Test\r\n @DisplayName(\"read: arg_0 = SecurityCheck() -\u003e return 10\")\r\n public void testReadReturns10() throws Throwable {\r\n SecurityCheck securityCheck = new SecurityCheck();\r\n\r\n int actual = securityCheck.read();\r\n\r\n assertEquals(10, actual);\r\n }\r\n}\r\n~~~\r\n\r\n**Environment**\r\n\r\nWindows 10 Pro\r\nIntelliJ IDEA 2022.1.4\r\nJDK 8\r\n\r\n_Originally posted by @alisevych in https://github.com/UnitTestBot/UTBotJava/issues/790#issuecomment-1228575443_\r\n","author":{"url":"https://github.com/alisevych","@type":"Person","name":"alisevych"},"datePublished":"2022-09-09T11:08:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/895/UTBotJava/issues/895"}
| 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:9629366e-aa15-27dd-fa36-f7680e15a5c7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 916C:E91CA:199919:215AAE:698E7A7B |
| html-safe-nonce | 7c806d0f4c502581b97dde75817f118941150d1dafb42fb37f634031356f9f61 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTZDOkU5MUNBOjE5OTkxOToyMTVBQUU6Njk4RTdBN0IiLCJ2aXNpdG9yX2lkIjoiNTc4NDQ5OTI5NTIyODA1MzcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1a6dbfbf23c45a468c7215dce6367db1773181d33b3a1c3d7761c3f9d938b314 |
| hovercard-subject-tag | issue:1367671350 |
| 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/895/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6b4f08e93a91cbd37d11798824432672dec3fb989d536ce34a84843bb495a2f5/UnitTestBot/UTBotJava/issues/895 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6b4f08e93a91cbd37d11798824432672dec3fb989d536ce34a84843bb495a2f5/UnitTestBot/UTBotJava/issues/895 |
| og:image:alt | Description Tests with unpermitted operation is Threads should be disabled, but they are up. To Reproduce IntelliJ IDEA 2022.1.4 with latest UTBot plugin installed Create/open a project with JDK 8/... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alisevych |
| 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 | f7a12861f7011eecb14bcc4388a767d829a52dfc |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width