GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Sandboxed test is not compiling because of illegal unicode escape · Issue #1134 · UnitTestBot/UTBotJava Closed DescriptionDescription Sandboxed test is not compiling because commented stack trace contains "illegal unicode escape". To Reproduce
public class SecurityCheck { public int normalTest(int value) { if (value < 0) { return -value; } return value; } public int read(File path) throws IOException { byte[] bytes = Files.readAllBytes(path.toPath()); return bytes.length; } public int connect(Socket socket) throws IOException { socket.connect(new InetSocketAddress("0.0.0.0", 22)); return 0; } public String property(String key) { return System.getProperty(key); } public String systemExit() { System.exit(0); return "bad"; } }
Expected behavior Project can be successfully build after test generation. Actual behavior SecurityCheckTest is not compiled. C:\Users\<user_name>\UTBotJava\utbot-sample\src\test\java\org\utbot\examples\securitycheck\SecurityCheckTest.java:2823: error: illegal unicode escape /* This test fails because method [org.utbot.examples.securitycheck.SecurityCheck.read] produces [java.security.AccessControlException: access denied ("java.io.FilePermission" "jkmqh\uhauh" "read")] Visual proofs (screenshots, logs, images) There is the following test generated by Fuzzer ///region FUZZER: EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS for method read(java.io.File) @Test @DisplayName("read: path = File(String, String)") @Disabled(value = "Disabled due to sandbox") public void testRead() { SecurityCheck securityCheck = new SecurityCheck(); File path = new File("jkmqh", "uhauh"); /* This test fails because method [org.utbot.examples.securitycheck.SecurityCheck.read] produces [java.security.AccessControlException: access denied ("java.io.FilePermission" "jkmqh\uhauh" "read")] java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) java.base/java.security.AccessController.checkPermission(AccessController.java:897) java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:322) java.base/java.lang.SecurityManager.checkRead(SecurityManager.java:661) java.base/sun.nio.fs.WindowsChannelFactory.open(WindowsChannelFactory.java:299) java.base/sun.nio.fs.WindowsChannelFactory.newFileChannel(WindowsChannelFactory.java:168) java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230) java.base/java.nio.file.Files.newByteChannel(Files.java:371) java.base/java.nio.file.Files.newByteChannel(Files.java:422) java.base/java.nio.file.Files.readAllBytes(Files.java:3206) org.utbot.examples.securitycheck.SecurityCheck.read(SecurityCheck.java:19) */ } ///endregion Environment Windows 10 Pro Additional context Originally posted by @alisevych in #1125 (comment) Activity
MetadataMetadataAssigneesLabelsctg-bugIssue is a bugIssue is a bug TypeProjects
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |