From fa630a430d751ac855d2de70ad876d5d028953e3 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Fri, 14 Nov 2008 06:23:34 +0000 Subject: [PATCH] Removed unused test files --- .../intercept/method/MockAttributes.java | 158 ------------------ core/src/test/resources/log4j.properties | 8 +- .../intercept/method/applicationContext.xml | 55 ------ 3 files changed, 4 insertions(+), 217 deletions(-) delete mode 100644 core/src/test/java/org/springframework/security/intercept/method/MockAttributes.java delete mode 100644 core/src/test/resources/org/springframework/security/intercept/method/applicationContext.xml diff --git a/core/src/test/java/org/springframework/security/intercept/method/MockAttributes.java b/core/src/test/java/org/springframework/security/intercept/method/MockAttributes.java deleted file mode 100644 index 9d776fadb9..0000000000 --- a/core/src/test/java/org/springframework/security/intercept/method/MockAttributes.java +++ /dev/null @@ -1,158 +0,0 @@ -/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.security.intercept.method; - -import org.springframework.security.ITargetObject; -import org.springframework.security.OtherTargetObject; -import org.springframework.security.SecurityConfig; -import org.springframework.security.TargetObject; - -import org.springframework.metadata.Attributes; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - - -/** - * Used by the {@link MethodDefinitionAttributesTests}. - * - * @author Cameron Braid - * @author Ben Alex - */ -public class MockAttributes implements Attributes { - //~ Instance fields ================================================================================================ - - List classAttributes = Arrays.asList(new SecurityConfig[] {new SecurityConfig("MOCK_CLASS")}); - List classMethodAttributesCountLength = Arrays.asList(new String[] {new String("MOCK_CLASS_METHOD_COUNT_LENGTH")}); - List classMethodAttributesMakeLowerCase = Arrays.asList(new SecurityConfig[] { - new SecurityConfig("MOCK_CLASS_METHOD_MAKE_LOWER_CASE") - }); - List classMethodAttributesMakeUpperCase = Arrays.asList(new SecurityConfig[] { - new SecurityConfig("MOCK_CLASS_METHOD_MAKE_UPPER_CASE") - }); - List interfaceAttributes = Arrays.asList(new SecurityConfig[] {new SecurityConfig("MOCK_INTERFACE")}); - List interfaceMethodAttributesCountLength = Arrays.asList(new SecurityConfig[] { - new SecurityConfig("MOCK_INTERFACE_METHOD_COUNT_LENGTH") - }); - List interfaceMethodAttributesMakeLowerCase = Arrays.asList(new SecurityConfig[] { - new SecurityConfig("MOCK_INTERFACE_METHOD_MAKE_LOWER_CASE") - }); - List interfaceMethodAttributesMakeUpperCase = Arrays.asList(new SecurityConfig[] { - new SecurityConfig("MOCK_INTERFACE_METHOD_MAKE_UPPER_CASE"), new SecurityConfig("RUN_AS") - }); - - //~ Methods ======================================================================================================== - - public Collection getAttributes(Class clazz) { - // Emphasise we return null for OtherTargetObject - if (clazz.equals(OtherTargetObject.class)) { - return null; - } - - // interface - if (clazz.equals(ITargetObject.class)) { - return interfaceAttributes; - } - - // class - if (clazz.equals(TargetObject.class)) { - return classAttributes; - } - - return null; - } - - public Collection getAttributes(Method method) { - // interface - if (method.getDeclaringClass().equals(ITargetObject.class)) { - if (method.getName().equals("countLength")) { - return interfaceMethodAttributesCountLength; - } - - if (method.getName().equals("makeLowerCase")) { - return interfaceMethodAttributesMakeLowerCase; - } - - if (method.getName().equals("makeUpperCase")) { - return interfaceMethodAttributesMakeUpperCase; - } - - if (method.getName().equals("publicMakeLowerCase")) { - throw new UnsupportedOperationException("mock support not implemented"); - } - } - - // class - if (method.getDeclaringClass().equals(TargetObject.class)) { - if (method.getName().equals("countLength")) { - return classMethodAttributesCountLength; - } - - if (method.getName().equals("makeLowerCase")) { - return classMethodAttributesMakeLowerCase; - } - - if (method.getName().equals("makeUpperCase")) { - return classMethodAttributesMakeUpperCase; - } - - if (method.getName().equals("publicMakeLowerCase")) { - throw new UnsupportedOperationException("mock support not implemented"); - } - } - - // other target object - if (method.getDeclaringClass().equals(OtherTargetObject.class)) { - if (method.getName().equals("countLength")) { - return classMethodAttributesCountLength; - } - - if (method.getName().equals("makeLowerCase")) { - return classMethodAttributesMakeLowerCase; - } - - if (method.getName().equals("makeUpperCase")) { - return null; // NB - } - - if (method.getName().equals("publicMakeLowerCase")) { - throw new UnsupportedOperationException("mock support not implemented"); - } - } - - return null; - } - - public Collection getAttributes(Class arg0, Class arg1) { - throw new UnsupportedOperationException("mock method not implemented"); - } - - public Collection getAttributes(Field arg0, Class arg1) { - throw new UnsupportedOperationException("mock method not implemented"); - } - - public Collection getAttributes(Field arg0) { - throw new UnsupportedOperationException("mock method not implemented"); - } - - public Collection getAttributes(Method arg0, Class arg1) { - throw new UnsupportedOperationException("mock method not implemented"); - } -} diff --git a/core/src/test/resources/log4j.properties b/core/src/test/resources/log4j.properties index 9157b44c8e..d7d40296e6 100644 --- a/core/src/test/resources/log4j.properties +++ b/core/src/test/resources/log4j.properties @@ -2,13 +2,13 @@ # # $Id$ -log4j.rootCategory=INFO, stdout +log4j.rootLogger=INFO, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d %p %c{1} - %m%n -log4j.category.org.springframework.security=DEBUG -log4j.category.org.springframework.ldap=DEBUG +log4j.logger.org.springframework.security=DEBUG,stdout +log4j.logger.org.springframework.ldap=DEBUG -log4j.category.org.apache.directory.shared.asn1=INFO +log4j.logger.org.apache.directory=ERROR,stdout diff --git a/core/src/test/resources/org/springframework/security/intercept/method/applicationContext.xml b/core/src/test/resources/org/springframework/security/intercept/method/applicationContext.xml deleted file mode 100644 index a358e61ce1..0000000000 --- a/core/src/test/resources/org/springframework/security/intercept/method/applicationContext.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.springframework.security.ITargetObject - - - - - - - - - - -