Cover was unable to write any tests for the reasons listed below, but was able to write 1 partial tests to get you started.
Change what sort of tests Cover writes in Change Settings.
Partial tests written: 1
R011 - Sandboxing policy violation: 1
Thank you for raising this - are you able to share the source code, and the log file with us so we can see what could cause the R011 output code. The log file can be found following this page - Log file | Diffblue Docs
We also have some documentation around dealing with this output code which is worth looking at - Working with code R011 | Diffblue Docs
Without log files we are unable to provide any specific advice. However, I would recommend reading our documentation on this output code as there is good guidance on how to deal with this - see page; Working with code R011 | Diffblue Docs
Go through the diffblue docs for Sandbox issue. Also allow option in diffblue settings.
What need to mention in âSandboxed Environment Optionsâ. Can you please help on this?
Our sandboxing policy protects you from a test that could break your system (e.g. a test that deletes files on your disk, calls an external API etc). We have disabled this test because it could be dangerous.
You should look at the test and if you think it is safe you can remove the @Disable annotation and let the test run.
But there is no @disable annotation in java class. can you please more elaborate on this? Any another way so that not disabled the test and create proper junit test cases
Yes create a partial test case but nothing is there is partial test cases. Just create below test case:-
void testcasename(){
// TODO: Complete this test.
// Reason: R011 Sandboxing policy violation.
// Diffblue Cover ran code in your project that tried
// to access JMX APIs.
// Diffblue Coverâs default sandboxing policy disallows this in order to prevent
// your code from damaging your system environment.
// See Output codes | Diffblue Docs to resolve this issue.
}
Thanks - so we didnât write a test because we blocked access to JMX because it could have caused dangerous side effects. In this case we have therefore been unable to create the test so have given you the body of the test for you to complete.
We have discussed internally how to help you with this - In the CLI version you can use the --disable-security-policy option to help in this situation User Manual | Diffblue Docs
Do you have access to the CLI version to try this? If not we can organise this for you
Yes, that is the correct link. We saw you had a trial previously so have extended it until 14/08/22 for you to try the CLI - I will email you directly.
Please let us know if you donât receive my email, or have any further questions
Please run dcover create --disable-security-policy com.example.package.class in the root of the compiled module. Please replace com.example.package.class with the class you want to write tests for