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 tests for it with default settings:
publicclassSecurityCheck {
publicintread() throwsThrowable {
Threadt = newThread("fileRead") {
publicvoidrun() {
try {
newFile("a.txt").createNewFile();
} catch (IOExceptione) {
thrownewRuntimeException(e);
}
}
};
t.start();
Thread.sleep(500);
return10;
}
}- Open the generated test
Expected behavior
Generated test should be disabled due to sandbox.
Actual behavior
The following method is not executed - AccessControlException is thrown (was seen in Concrete executor logs when they were informative) - that's Ok.
But the generated tests are not disabled due to Sandbox. If we run the test - file will be created.
Visual proofs (screenshots, logs, images)
publicclassSecurityCheckTest {
@Test@DisplayName("read: arg_0 = SecurityCheck() -> return 10")
publicvoidtestReadReturns10() throwsThrowable {
SecurityChecksecurityCheck = newSecurityCheck();
intactual = securityCheck.read();
assertEquals(10, actual);
}
}Environment
Windows 10 Pro
IntelliJ IDEA 2022.1.4
JDK 8
Originally posted by @alisevych in #790 (comment)
Description
Tests with unpermitted operation is Threads should be disabled, but they are up.
To Reproduce
Expected behavior
Generated test should be disabled due to sandbox.
Actual behavior
The following method is not executed - AccessControlException is thrown (was seen in Concrete executor logs when they were informative) - that's Ok.
But the generated tests are not disabled due to Sandbox. If we run the test - file will be created.
Visual proofs (screenshots, logs, images)
Environment
Windows 10 Pro
IntelliJ IDEA 2022.1.4
JDK 8
Originally posted by @alisevych in #790 (comment)