R011 - Sandboxing policy violation: 1

user-20231205T122402.log (27.2 KB)
support.log (2.8 MB)
@petersear will it not allow write tests further?

Hi @Namrata_Devhare
Thanks for your question. Diffblue Cover produces an Output Code for each method it did not create a unit test for, in order to help the user understand possible actions they can take to increase the number of unit tests written. R011 - Sandboxing policy violation , as seen in this case, is saying that the code under test has attempted to access the network. Diffblue Cover runs the code under test inside a sandbox in order to avoid the possibility that the code will perform damaging actions on the user’s system. It is possible to configure that behaviour and relax the sandboxing policy. This can be set in the IntelliJ plugin under Diffblue -> Change Settings near the bottom of the Test creation tab. Simply untick Enable sandboxing. (For the CLI, there is the --disable-sandboxing option to dcover create). For more detail, please see Working with code R011 in the Diffblue documentation.
Best regards
Peter

1 Like

@petersear after enabling the sandbox now it shows error that difblue cover is unabe to find test-1
support.log (2.9 MB)
user-20231205T122402.log (27.2 KB)
please tell the further solution

Hi @Namrata_Devhare
From the support log I can see that you have encountered R004: No meaningful assertions found the description for which is “Fields modified by comboLoading() might not have package-private, protected, or public getters.”. In other words, there may be fields needed by the method, which are not accessible in a test context. One way to provide that access would be to add observers to the code which are accessible from a test class.
BTW the specific user log file you sent was for the previous case (before disabling the sandbox). That’s fine because support.log contains all the information we needed. Note that this is larger than the individual/specific log files because it contains information about a number of recent actions. For future reference, the most useful log to help debug similar questions is the specific support log i.e. support-yyyymmddxxxxxxx.log (timestamp shows when the log was created so can be matched to the particular activity).
Best regards
Peter