@@ -0,0 +1,2321 @@
+/*******************************************************************************%0A * Copyright 2002-2016 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *******************************************************************************/%0Apackage com.github.lothar.security.acl.activation.test;%0A%0Aimport org.springframework.context.ApplicationContext;%0Aimport org.springframework.test.context.TestContext;%0Aimport org.springframework.test.context.support.AbstractTestExecutionListener;%0Aimport org.springframework.util.Assert;%0A%0Aimport com.github.lothar.security.acl.activation.AclSecurityActivator;%0A%0Apublic class AclTestExecutionListener extends AbstractTestExecutionListener %7B%0A%0A  private Status statusDuringTest;%0A%0A  public AclTestExecutionListener() %7B%0A    this(Status.DISABLED);%0A  %7D%0A%0A  public AclTestExecutionListener(Status statusDuringTest) %7B%0A    super();%0A    Assert.notNull(statusDuringTest, %22Status should not be null%22);%0A    this.statusDuringTest = statusDuringTest;%0A  %7D%0A%0A  @Override%0A  public void beforeTestMethod(TestContext testContext) %7B%0A    AclSecurityActivator aclSecurityActivator = aclSecurityActivator(testContext);%0A    aclSecurityActivator.setEnabled(Status.ENABLED.equals(statusDuringTest));%0A  %7D%0A%0A  @Override%0A  public void afterTestMethod(TestContext testContext) %7B%0A    AclSecurityActivator aclSecurityActivator = aclSecurityActivator(testContext);%0A    aclSecurityActivator.setEnabled(Status.DISABLED.equals(statusDuringTest));%0A  %7D%0A%0A  private AclSecurityActivator aclSecurityActivator(TestContext testContext) %7B%0A    ApplicationContext context = testContext.getApplicationContext();%0A    AclSecurityActivator aclSecurityActivator = context.getBean(AclSecurityActivator.class);%0A    return aclSecurityActivator;%0A  %7D%0A%0A  public static enum Status %7B%0A    ENABLED, DISABLED%0A  %7D%0A%7D%0A

Test execution listener fixed #25