Skip to content

Improve sandbox-relative description in generated tests #782

Open
@Markoutte

Description

@Markoutte

Description

After #625 was implemented methods that try to run some unsafe code now generates into tests like this:

@Disabled("Disabled due to sandbox")
public void testPropertyWithBlankString() {
        SecurityCheck securityCheck = new SecurityCheck();
        
        /* This test fails because method [com.company.security.SecurityCheck.property] produces [java.security.AccessControlException: access denied ("java.util.PropertyPermission" "   " "read")]
            java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
            java.security.AccessController.checkPermission(AccessController.java:886)
            java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
            java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1294)
            java.lang.System.getProperty(System.java:719)
            com.company.security.SecurityCheck.property(SecurityCheck.java:32) */
    }

We have several problems with this view:

  1. User have no information how to change settings of security manager
  2. TestNG has no @Disabled annotation
  3. Is it good idea to print stacktrace?

Expected behavior

Generated test should be improved. We can add little doc or even hyperlink to add permissions into correct file.

Metadata

Metadata

Assignees

Labels

ctg-enhancementNew feature, improvement or change request

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions