Configuring Java security policy to allow JUnit? -
i developing java application. want run unit tests in security-restricted jvm block network access.
i added -djava.security.manager=default -djava.security.policy=...file...
options jvm, , security manager effective.
i iterated couple of times running tests, seeing security violation happens, , granting in policy file. now, not getting security violations anymore. instead, this:
------------------------------------------------------- t e s t s ------------------------------------------------------- running org.onebusaway.alexa.authedspeechlettest tests run: 1, failures: 0, errors: 1, skipped: 0, time elapsed: 0.143 sec <<< failure! - in org.onebusaway.alexa.authedspeechlettest org.onebusaway.alexa.authedspeechlettest time elapsed: 0.06 sec <<< error! java.lang.noclassdeffounderror: org.junit.runner.runner @ org.apache.maven.surefire.junit4.junit4provider.execute(junit4provider.java:364) @ org.apache.maven.surefire.junit4.junit4provider.executewithrerun(junit4provider.java:274) @ org.apache.maven.surefire.junit4.junit4provider.executetestset(junit4provider.java:238) @ org.apache.maven.surefire.junit4.junit4provider.invoke(junit4provider.java:161) running org.onebusaway.alexa.mainspeechletemptytest tests run: 1, failures: 0, errors: 1, skipped: 0, time elapsed: 0.001 sec <<< failure! - in org.onebusaway.alexa.mainspeechletemptytest org.onebusaway.alexa.mainspeechletemptytest time elapsed: 0 sec <<< error! java.lang.noclassdeffounderror: org.junit.runner.runner @ org.apache.maven.surefire.junit4.junit4provider.execute(junit4provider.java:364) @ org.apache.maven.surefire.junit4.junit4provider.executewithrerun(junit4provider.java:274) @ org.apache.maven.surefire.junit4.junit4provider.executetestset(junit4provider.java:238) @ org.apache.maven.surefire.junit4.junit4provider.invoke(junit4provider.java:161) results : tests in error: junit4provider.invoke:161->executetestset:238->executewithrerun:274->execute:364 » noclassdeffound junit4provider.invoke:161->executetestset:238->executewithrerun:274->execute:364 » noclassdeffound tests run: 2, failures: 0, errors: 2, skipped: 0
how see security policy violated here? (i tried rerunning -x
, didn't reveal new.)
Comments
Post a Comment