コード例 #1
0
 @Test
 public void restoreOldSecurityManager() throws Throwable {
   SecurityManager manager = new ArbitrarySecurityManager();
   setSecurityManager(manager);
   executeRuleWithoutExitCall();
   assertThat(getSecurityManager(), sameInstance(manager));
 }
コード例 #2
0
  @Test
  public void testSystemExit() {

    java.lang.System.setSecurityManager(new SafeExit());

    EvoSuite evosuite = new EvoSuite();

    String targetClass = CallExit.class.getCanonicalName();

    Properties.TARGET_CLASS = targetClass;
    Properties.REPLACE_CALLS = true;

    String[] command = new String[] {"-generateSuite", "-class", targetClass};

    evosuite.parseCommandLine(command);

    assertFalse(SafeExit.calledExit);
  }
コード例 #3
0
 @Test
 public void delegateToOldSecurityManager() throws Throwable {
   SecurityManager manager = new ArbitrarySecurityManager();
   setSecurityManager(manager);
   executeRuleWithStatement(new CheckContext());
 }
コード例 #4
0
 @After
 public void removeSecurity() {
   java.lang.System.setSecurityManager(null);
 }