From 2789e087fd33a702ff12fac2f747b8f4e1e26c28 Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Sun, 13 Jan 2013 11:11:32 +0000 Subject: [PATCH] More removal of trailing spaces. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/logging/trunk@1432587 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/logging/AbstractLogTest.java | 12 ++-- .../apache/commons/logging/AltHashtable.java | 8 +-- .../commons/logging/AltHashtableTestCase.java | 18 +++-- .../logging/BadHashtablePropertyTestCase.java | 8 +-- .../logging/BasicOperationsTestCase.java | 34 +++++---- .../commons/logging/DummyException.java | 7 +- .../apache/commons/logging/LoadTestCase.java | 6 +- .../apache/commons/logging/LogTestCase.java | 7 +- .../logging/NullClassLoaderTestCase.java | 6 +- .../commons/logging/PathableClassLoader.java | 7 +- .../commons/logging/PathableTestSuite.java | 7 +- .../commons/logging/SimpleLogTestCase.java | 7 +- .../org/apache/commons/logging/UserClass.java | 12 ++-- .../logging/avalon/AvalonLoggerTestCase.java | 6 +- .../config/FirstPriorityConfigTestCase.java | 14 ++-- .../config/PriorityConfigTestCase.java | 16 ++--- .../logging/impl/WeakHashtableTest.java | 63 ++++++++-------- .../jdk14/CustomConfigAPITestCase.java | 8 +-- .../jdk14/CustomConfigFullTestCase.java | 8 +-- .../logging/jdk14/CustomConfigTestCase.java | 21 +++--- .../logging/jdk14/DefaultConfigTestCase.java | 8 +-- .../commons/logging/jdk14/TestHandler.java | 6 +- .../commons/logging/log4j/StandardTests.java | 30 ++++---- .../log4j12/ApiClasspathStandardTestCase.java | 6 +- .../log4j12/AppClasspathStandardTestCase.java | 8 +-- .../ChildClasspathStandardTestCase.java | 8 +-- .../log4j/log4j12/Log4j12StandardTests.java | 6 +- .../ParentClasspathStandardTestCase.java | 8 +-- .../logging/log4j/log4j12/TestAppender.java | 10 +-- .../logging/logkit/StandardTestCase.java | 8 +-- .../commons/logging/noop/NoOpLogTestCase.java | 12 ++-- .../logging/pathable/ChildFirstTestCase.java | 72 +++++++++---------- .../logging/pathable/GeneralTestCase.java | 26 +++---- .../logging/pathable/ParentFirstTestCase.java | 10 +-- .../logging/security/MockSecurityManager.java | 30 ++++---- .../security/SecurityAllowedTestCase.java | 32 ++++----- .../security/SecurityForbiddenTestCase.java | 32 ++++----- .../logging/servlet/BasicServletTestCase.java | 8 +-- .../logging/simple/CustomConfigTestCase.java | 6 +- .../simple/DateTimeCustomConfigTestCase.java | 26 +++---- .../logging/simple/DecoratedSimpleLog.java | 6 +- .../logging/simple/DefaultConfigTestCase.java | 6 +- .../commons/logging/simple/LogRecord.java | 6 +- .../commons/logging/tccl/BadTCCLTestCase.java | 4 +- .../logging/tccl/NullTCCLTestCase.java | 4 +- .../commons/logging/tccl/custom/MyLog.java | 6 +- .../logging/tccl/custom/MyLogFactoryImpl.java | 6 +- .../tccl/log/TcclDisabledTestCase.java | 6 +- .../logging/tccl/log/TcclEnabledTestCase.java | 8 +-- .../tccl/logfactory/TcclDisabledTestCase.java | 6 +- .../tccl/logfactory/TcclEnabledTestCase.java | 6 +- 51 files changed, 334 insertions(+), 357 deletions(-) diff --git a/src/test/org/apache/commons/logging/AbstractLogTest.java b/src/test/org/apache/commons/logging/AbstractLogTest.java index 2d7a15f..706e5b0 100644 --- a/src/test/org/apache/commons/logging/AbstractLogTest.java +++ b/src/test/org/apache/commons/logging/AbstractLogTest.java @@ -5,17 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; import junit.framework.TestCase; @@ -25,7 +23,7 @@ import junit.framework.TestCase; * Generic tests that can be applied to any log adapter by * subclassing this class and defining method getLogObject * appropriately. - * + * * @author Sean C. Sullivan * @version $Revision$ */ @@ -92,5 +90,5 @@ public abstract class AbstractLogTest extends TestCase { log.warn(log.getClass().getName() + ": warn statement"); log.warn(log.getClass().getName() + ": warn statement w/ null exception", new RuntimeException()); - } + } } diff --git a/src/test/org/apache/commons/logging/AltHashtable.java b/src/test/org/apache/commons/logging/AltHashtable.java index 7ab7d47..ebcbc48 100644 --- a/src/test/org/apache/commons/logging/AltHashtable.java +++ b/src/test/org/apache/commons/logging/AltHashtable.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; @@ -23,7 +23,7 @@ public class AltHashtable extends Hashtable { public static Object lastKey; public static Object lastValue; - + public Object put(Object key, Object value) { lastKey = key; lastValue = value; diff --git a/src/test/org/apache/commons/logging/AltHashtableTestCase.java b/src/test/org/apache/commons/logging/AltHashtableTestCase.java index b1a7c6f..c70d884 100644 --- a/src/test/org/apache/commons/logging/AltHashtableTestCase.java +++ b/src/test/org/apache/commons/logging/AltHashtableTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; @@ -24,8 +24,6 @@ import junit.framework.TestCase; * Test the ability to force the LogFactory class to use some * arbitrary Hashtable implementation to store its mapping from * context-classloader -> LogFactory object. - *

- * This is done by */ public class AltHashtableTestCase extends TestCase { @@ -47,20 +45,20 @@ public class AltHashtableTestCase extends TestCase { *

* This method ensures that the appropriate system property is defined * to force the LogFactory class to use the AltHashtable class as its - * Hashtable implementation for storing factories in. + * Hashtable implementation for storing factories in. *

* This does make the assumption that whatever JVM we are running in * doesn't initialise classes until they are actually referenced (ie the * LogFactory class hasn't been initialised before this method is called). * This is true of all JVMs I know of; and if it isn't then this test will - * fail and someone will tell us. + * fail and someone will tell us. */ public void setUp() { System.setProperty( "org.apache.commons.logging.LogFactory.HashtableImpl", AltHashtable.class.getName()); } - + /** * Verify that initialising the LogFactory class will cause it * to instantiate an object of type specified in system property @@ -75,7 +73,7 @@ public class AltHashtableTestCase extends TestCase { // doesn't change the effectiveness of this test. assertTrue(LogFactory.factories instanceof AltHashtable); } - + /** * Verify that when LogFactory sees a context-classloader for the * first time that it creates a new entry in the LogFactory.factories @@ -86,7 +84,7 @@ public class AltHashtableTestCase extends TestCase { public void testPutCalled() throws Exception { AltHashtable.lastKey = null; AltHashtable.lastValue = null; - + LogFactory.getLog(AltHashtableTestCase.class); ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); assertEquals(contextLoader, AltHashtable.lastKey); diff --git a/src/test/org/apache/commons/logging/BadHashtablePropertyTestCase.java b/src/test/org/apache/commons/logging/BadHashtablePropertyTestCase.java index 8f6ac62..eda6e3f 100644 --- a/src/test/org/apache/commons/logging/BadHashtablePropertyTestCase.java +++ b/src/test/org/apache/commons/logging/BadHashtablePropertyTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; @@ -28,7 +28,7 @@ public class BadHashtablePropertyTestCase extends TestCase { public void testType() { assertTrue(LogFactory.factories instanceof Hashtable); } - + public void testPutCalled() throws Exception { LogFactory.getLog(BadHashtablePropertyTestCase.class); } diff --git a/src/test/org/apache/commons/logging/BasicOperationsTestCase.java b/src/test/org/apache/commons/logging/BasicOperationsTestCase.java index 02eb095..dfadab2 100644 --- a/src/test/org/apache/commons/logging/BasicOperationsTestCase.java +++ b/src/test/org/apache/commons/logging/BasicOperationsTestCase.java @@ -5,25 +5,24 @@ * The ASF licenses this file to You 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.apache.commons.logging; import junit.framework.TestCase; /** - * Tests the basic logging operations to ensure that they all function + * Tests the basic logging operations to ensure that they all function * without exception failure. In other words, that they do no fail by * throwing exceptions. - * This is the minimum requirement for any well behaved logger + * This is the minimum requirement for any well behaved logger * and so this test should be run for each kind. */ public class BasicOperationsTestCase extends TestCase @@ -33,13 +32,13 @@ public class BasicOperationsTestCase extends TestCase Log log = LogFactory.getLog(BasicOperationsTestCase.class); executeIsEnabledTest(log); } - + public void testIsEnabledNamedLog() { Log log = LogFactory.getLog(BasicOperationsTestCase.class.getName()); executeIsEnabledTest(log); - } - + } + public void executeIsEnabledTest(Log log) { try @@ -57,20 +56,19 @@ public class BasicOperationsTestCase extends TestCase fail("Exception thrown: " + t); } } - - + public void testMessageWithoutExceptionClassLog() { Log log = LogFactory.getLog(BasicOperationsTestCase.class); executeMessageWithoutExceptionTest(log); } - + public void testMessageWithoutExceptionNamedLog() { Log log = LogFactory.getLog(BasicOperationsTestCase.class.getName()); executeMessageWithoutExceptionTest(log); - } - + } + public void executeMessageWithoutExceptionTest(Log log) { try @@ -88,19 +86,19 @@ public class BasicOperationsTestCase extends TestCase fail("Exception thrown: " + t); } } - + public void testMessageWithExceptionClassLog() { Log log = LogFactory.getLog(BasicOperationsTestCase.class); executeMessageWithExceptionTest(log); } - + public void testMessageWithExceptionNamedLog() { Log log = LogFactory.getLog(BasicOperationsTestCase.class.getName()); executeMessageWithExceptionTest(log); - } - + } + public void executeMessageWithExceptionTest(Log log) { try diff --git a/src/test/org/apache/commons/logging/DummyException.java b/src/test/org/apache/commons/logging/DummyException.java index 446de24..2f5fdd4 100644 --- a/src/test/org/apache/commons/logging/DummyException.java +++ b/src/test/org/apache/commons/logging/DummyException.java @@ -5,16 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; /** diff --git a/src/test/org/apache/commons/logging/LoadTestCase.java b/src/test/org/apache/commons/logging/LoadTestCase.java index 9236db5..c43aeea 100644 --- a/src/test/org/apache/commons/logging/LoadTestCase.java +++ b/src/test/org/apache/commons/logging/LoadTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; import junit.framework.TestCase; diff --git a/src/test/org/apache/commons/logging/LogTestCase.java b/src/test/org/apache/commons/logging/LogTestCase.java index 13aa1fe..0ac2a6f 100644 --- a/src/test/org/apache/commons/logging/LogTestCase.java +++ b/src/test/org/apache/commons/logging/LogTestCase.java @@ -5,16 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; diff --git a/src/test/org/apache/commons/logging/NullClassLoaderTestCase.java b/src/test/org/apache/commons/logging/NullClassLoaderTestCase.java index edcd873..0e84c1c 100644 --- a/src/test/org/apache/commons/logging/NullClassLoaderTestCase.java +++ b/src/test/org/apache/commons/logging/NullClassLoaderTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; import junit.framework.TestCase; diff --git a/src/test/org/apache/commons/logging/PathableClassLoader.java b/src/test/org/apache/commons/logging/PathableClassLoader.java index a74cf3d..830f652 100644 --- a/src/test/org/apache/commons/logging/PathableClassLoader.java +++ b/src/test/org/apache/commons/logging/PathableClassLoader.java @@ -5,16 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; import java.io.File; diff --git a/src/test/org/apache/commons/logging/PathableTestSuite.java b/src/test/org/apache/commons/logging/PathableTestSuite.java index 4be9302..1a2ca81 100644 --- a/src/test/org/apache/commons/logging/PathableTestSuite.java +++ b/src/test/org/apache/commons/logging/PathableTestSuite.java @@ -5,16 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; import java.util.Properties; diff --git a/src/test/org/apache/commons/logging/SimpleLogTestCase.java b/src/test/org/apache/commons/logging/SimpleLogTestCase.java index 3ee9b7d..cc2fceb 100644 --- a/src/test/org/apache/commons/logging/SimpleLogTestCase.java +++ b/src/test/org/apache/commons/logging/SimpleLogTestCase.java @@ -5,16 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging; import org.apache.commons.logging.impl.SimpleLog; diff --git a/src/test/org/apache/commons/logging/UserClass.java b/src/test/org/apache/commons/logging/UserClass.java index 754bf8e..9013133 100644 --- a/src/test/org/apache/commons/logging/UserClass.java +++ b/src/test/org/apache/commons/logging/UserClass.java @@ -5,23 +5,21 @@ * The ASF licenses this file to You 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.apache.commons.logging; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.impl.LogFactoryImpl; public class UserClass { - /** * Set the ALLOW_FLAWED_CONTEXT feature on the LogFactoryImpl object @@ -33,11 +31,11 @@ public class UserClass { */ public static void setAllowFlawedContext(String state) { LogFactory f = LogFactory.getFactory(); - f.setAttribute(LogFactoryImpl.ALLOW_FLAWED_CONTEXT_PROPERTY, state); + f.setAttribute(LogFactoryImpl.ALLOW_FLAWED_CONTEXT_PROPERTY, state); } public UserClass() { Log log = LogFactory.getLog(LoadTestCase.class); } - + } diff --git a/src/test/org/apache/commons/logging/avalon/AvalonLoggerTestCase.java b/src/test/org/apache/commons/logging/avalon/AvalonLoggerTestCase.java index 405ae7e..732d82b 100644 --- a/src/test/org/apache/commons/logging/avalon/AvalonLoggerTestCase.java +++ b/src/test/org/apache/commons/logging/avalon/AvalonLoggerTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.avalon; import org.apache.avalon.framework.logger.NullLogger; diff --git a/src/test/org/apache/commons/logging/config/FirstPriorityConfigTestCase.java b/src/test/org/apache/commons/logging/config/FirstPriorityConfigTestCase.java index 8700ebc..4725dcd 100644 --- a/src/test/org/apache/commons/logging/config/FirstPriorityConfigTestCase.java +++ b/src/test/org/apache/commons/logging/config/FirstPriorityConfigTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.config; @@ -58,7 +58,7 @@ public class FirstPriorityConfigTestCase extends TestCase { dummy.useExplicitLoader("junit.", Test.class.getClassLoader()); dummy.addLogicalLib("testclasses"); dummy.addLogicalLib("commons-logging"); - + String thisClassPath = thisClass.getName().replace('.', '/') + ".class"; URL baseUrl = dummy.findResource(thisClassPath); @@ -68,7 +68,7 @@ public class FirstPriorityConfigTestCase extends TestCase { PathableClassLoader containerLoader = new PathableClassLoader(null); containerLoader.useExplicitLoader("junit.", Test.class.getClassLoader()); containerLoader.addLogicalLib("commons-logging"); - + PathableClassLoader webappLoader = new PathableClassLoader(containerLoader); webappLoader.addLogicalLib("testclasses"); @@ -77,7 +77,7 @@ public class FirstPriorityConfigTestCase extends TestCase { URL pri10URL = new URL(baseUrl, "priority10/"); webappLoader.addURL(pri10URL); - + // load the test class via webapp loader, and use the webapp loader // as the tccl loader too. Class testClass = webappLoader.loadClass(thisClass.getName()); @@ -113,7 +113,7 @@ public class FirstPriorityConfigTestCase extends TestCase { // context classloader should be thisClassLoader assertEquals(thisClassLoader, contextClassLoader); - + // lfClassLoader should be parent of this classloader assertEquals(lfClassLoader, thisClassLoader.getParent()); assertEquals(PathableClassLoader.class.getName(), diff --git a/src/test/org/apache/commons/logging/config/PriorityConfigTestCase.java b/src/test/org/apache/commons/logging/config/PriorityConfigTestCase.java index 6c7d66a..831e255 100644 --- a/src/test/org/apache/commons/logging/config/PriorityConfigTestCase.java +++ b/src/test/org/apache/commons/logging/config/PriorityConfigTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.config; @@ -65,7 +65,7 @@ public class PriorityConfigTestCase extends TestCase { dummy.useExplicitLoader("junit.", Test.class.getClassLoader()); dummy.addLogicalLib("testclasses"); dummy.addLogicalLib("commons-logging"); - + String thisClassPath = thisClass.getName().replace('.', '/') + ".class"; URL baseUrl = dummy.findResource(thisClassPath); @@ -79,7 +79,7 @@ public class PriorityConfigTestCase extends TestCase { PathableClassLoader containerLoader = new PathableClassLoader(null); containerLoader.useExplicitLoader("junit.", Test.class.getClassLoader()); containerLoader.addLogicalLib("commons-logging"); - + URL pri10URL = new URL(baseUrl, "priority10/"); containerLoader.addURL(pri10URL); @@ -89,13 +89,13 @@ public class PriorityConfigTestCase extends TestCase { URL noPriorityURL = new URL(baseUrl, "nopriority/"); webappLoader.addURL(noPriorityURL); - + URL pri20URL = new URL(baseUrl, "priority20/"); webappLoader.addURL(pri20URL); - + URL pri20aURL = new URL(baseUrl, "priority20a/"); webappLoader.addURL(pri20aURL); - + // load the test class via webapp loader, and use the webapp loader // as the tccl loader too. Class testClass = webappLoader.loadClass(thisClass.getName()); diff --git a/src/test/org/apache/commons/logging/impl/WeakHashtableTest.java b/src/test/org/apache/commons/logging/impl/WeakHashtableTest.java index 1347254..b77ecc9 100644 --- a/src/test/org/apache/commons/logging/impl/WeakHashtableTest.java +++ b/src/test/org/apache/commons/logging/impl/WeakHashtableTest.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.impl; @@ -53,19 +53,18 @@ public class WeakHashtableTest extends TestCase { public WeakHashtableTest(String testName) { super(testName); } - protected void setUp() throws Exception { super.setUp(); weakHashtable = new WeakHashtable(); - + keyOne = new Long(1); keyTwo = new Long(2); keyThree = new Long(3); valueOne = new Long(100); valueTwo = new Long(200); valueThree = new Long(300); - + weakHashtable.put(keyOne, valueOne); weakHashtable.put(keyTwo, valueTwo); weakHashtable.put(keyThree, valueThree); @@ -81,7 +80,7 @@ public class WeakHashtableTest extends TestCase { assertTrue(weakHashtable.contains(new Long(300))); assertFalse(weakHashtable.contains(new Long(400))); } - + /** Tests public boolean containsKey(Object key) */ public void testContainsKey() throws Exception { assertTrue(weakHashtable.containsKey(new Long(1))); @@ -90,9 +89,9 @@ public class WeakHashtableTest extends TestCase { assertFalse(weakHashtable.containsKey(new Long(100))); assertFalse(weakHashtable.containsKey(new Long(200))); assertFalse(weakHashtable.containsKey(new Long(300))); - assertFalse(weakHashtable.containsKey(new Long(400))); + assertFalse(weakHashtable.containsKey(new Long(400))); } - + /** Tests public boolean containsValue(Object value) */ public void testContainsValue() throws Exception { assertFalse(weakHashtable.containsValue(new Long(1))); @@ -101,9 +100,9 @@ public class WeakHashtableTest extends TestCase { assertTrue(weakHashtable.containsValue(new Long(100))); assertTrue(weakHashtable.containsValue(new Long(200))); assertTrue(weakHashtable.containsValue(new Long(300))); - assertFalse(weakHashtable.containsValue(new Long(400))); + assertFalse(weakHashtable.containsValue(new Long(400))); } - + /** Tests public Enumeration elements() */ public void testElements() throws Exception { ArrayList elements = new ArrayList(); @@ -115,7 +114,7 @@ public class WeakHashtableTest extends TestCase { assertTrue(elements.contains(valueTwo)); assertTrue(elements.contains(valueThree)); } - + /** Tests public Set entrySet() */ public void testEntrySet() throws Exception { Set entrySet = weakHashtable.entrySet(); @@ -133,15 +132,15 @@ public class WeakHashtableTest extends TestCase { } } } - - /** Tests public Object get(Object�key) */ + + /** Tests public Object get(Object key) */ public void testGet() throws Exception { assertEquals(valueOne, weakHashtable.get(keyOne)); assertEquals(valueTwo, weakHashtable.get(keyTwo)); assertEquals(valueThree, weakHashtable.get(keyThree)); assertNull(weakHashtable.get(new Long(50))); } - + /** Tests public Enumeration keys() */ public void testKeys() throws Exception { ArrayList keys = new ArrayList(); @@ -151,9 +150,9 @@ public class WeakHashtableTest extends TestCase { assertEquals(3, keys.size()); assertTrue(keys.contains(keyOne)); assertTrue(keys.contains(keyTwo)); - assertTrue(keys.contains(keyThree)); + assertTrue(keys.contains(keyThree)); } - + /** Tests public Set keySet() */ public void testKeySet() throws Exception { Set keySet = weakHashtable.keySet(); @@ -162,14 +161,14 @@ public class WeakHashtableTest extends TestCase { assertTrue(keySet.contains(keyTwo)); assertTrue(keySet.contains(keyThree)); } - + /** Tests public Object put(Object key, Object value) */ public void testPut() throws Exception { Long anotherKey = new Long(2004); weakHashtable.put(anotherKey, new Long(1066)); - + assertEquals(new Long(1066), weakHashtable.get(anotherKey)); - + // Test compliance with the hashtable API re nulls Exception caught = null; try { @@ -188,7 +187,7 @@ public class WeakHashtableTest extends TestCase { } assertNotNull("did not throw an exception adding a null value", caught); } - + /** Tests public void putAll(Map t) */ public void testPutAll() throws Exception { Map newValues = new HashMap(); @@ -199,19 +198,19 @@ public class WeakHashtableTest extends TestCase { Long anotherNewValue = new Long(1815); newValues.put(anotherNewKey, anotherNewValue); weakHashtable.putAll(newValues); - + assertEquals(5, weakHashtable.size()); assertEquals(newValue, weakHashtable.get(newKey)); assertEquals(anotherNewValue, weakHashtable.get(anotherNewKey)); } - - /** Tests public Object remove(Object�key) */ + + /** Tests public Object remove(Object key) */ public void testRemove() throws Exception { weakHashtable.remove(keyOne); assertEquals(2, weakHashtable.size()); assertNull(weakHashtable.get(keyOne)); } - + /** Tests public Collection values() */ public void testValues() throws Exception { Collection values = weakHashtable.values(); @@ -220,7 +219,7 @@ public class WeakHashtableTest extends TestCase { assertTrue(values.contains(valueTwo)); assertTrue(values.contains(valueThree)); } - + public void testRelease() throws Exception { assertNotNull(weakHashtable.get(new Long(1))); ReferenceQueue testQueue = new ReferenceQueue(); @@ -233,7 +232,7 @@ public class WeakHashtableTest extends TestCase { valueOne = null; valueTwo = null; valueThree = null; - + int iterations = 0; int bytz = 2; while(true) { @@ -241,23 +240,23 @@ public class WeakHashtableTest extends TestCase { if(iterations++ > MAX_GC_ITERATIONS){ fail("Max iterations reached before resource released."); } - + if(weakHashtable.get(new Long(1)) == null) { break; - + } else { // create garbage: byte[] b = new byte[bytz]; bytz = bytz * 2; } } - - // some JVMs seem to take a little time to put references on + + // some JVMs seem to take a little time to put references on // the reference queue once the reference has been collected // need to think about whether this is enough to justify // stepping through the collection each time... while(testQueue.poll() == null) {} - + // Test that the released objects are not taking space in the table assertEquals("underlying table not emptied", 0, weakHashtable.size()); } diff --git a/src/test/org/apache/commons/logging/jdk14/CustomConfigAPITestCase.java b/src/test/org/apache/commons/logging/jdk14/CustomConfigAPITestCase.java index 34431aa..afa04d6 100644 --- a/src/test/org/apache/commons/logging/jdk14/CustomConfigAPITestCase.java +++ b/src/test/org/apache/commons/logging/jdk14/CustomConfigAPITestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.jdk14; @@ -54,7 +54,7 @@ public class CustomConfigAPITestCase extends CustomConfigTestCase { PathableClassLoader child = new PathableClassLoader(parent); child.addLogicalLib("testclasses"); child.addLogicalLib("commons-logging"); - + Class testClass = child.loadClass(CustomConfigAPITestCase.class.getName()); return new PathableTestSuite(testClass, child); } diff --git a/src/test/org/apache/commons/logging/jdk14/CustomConfigFullTestCase.java b/src/test/org/apache/commons/logging/jdk14/CustomConfigFullTestCase.java index 310e9c6..86a6232 100644 --- a/src/test/org/apache/commons/logging/jdk14/CustomConfigFullTestCase.java +++ b/src/test/org/apache/commons/logging/jdk14/CustomConfigFullTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.jdk14; @@ -56,7 +56,7 @@ public class CustomConfigFullTestCase extends CustomConfigTestCase { PathableClassLoader child = new PathableClassLoader(parent); child.addLogicalLib("testclasses"); - + Class testClass = child.loadClass(CustomConfigFullTestCase.class.getName()); return new PathableTestSuite(testClass, child); } diff --git a/src/test/org/apache/commons/logging/jdk14/CustomConfigTestCase.java b/src/test/org/apache/commons/logging/jdk14/CustomConfigTestCase.java index 444637f..5679c00 100644 --- a/src/test/org/apache/commons/logging/jdk14/CustomConfigTestCase.java +++ b/src/test/org/apache/commons/logging/jdk14/CustomConfigTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.jdk14; @@ -46,8 +46,7 @@ import org.apache.commons.logging.PathableTestSuite; public class CustomConfigTestCase extends DefaultConfigTestCase { - protected static final String HANDLER_NAME - = "org.apache.commons.logging.jdk14.TestHandler"; + protected static final String HANDLER_NAME = "org.apache.commons.logging.jdk14.TestHandler"; // ----------------------------------------------------------- Constructors @@ -147,9 +146,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase { ClassLoader srcCL = CustomConfigAPITestCase.class.getClassLoader(); byte[] classData = readClass(className, srcCL); - Class[] params = new Class[] { - String.class, classData.getClass(), - Integer.TYPE, Integer.TYPE}; + Class[] params = new Class[] { String.class, classData.getClass(), Integer.TYPE, Integer.TYPE }; Method m = ClassLoader.class.getDeclaredMethod("defineClass", params); Object[] args = new Object[4]; @@ -195,7 +192,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase { cl.useExplicitLoader(HANDLER_NAME, scl); cl.addLogicalLib("commons-logging"); cl.addLogicalLib("testclasses"); - + Class testClass = cl.loadClass(CustomConfigTestCase.class.getName()); return new PathableTestSuite(testClass, cl); } @@ -358,14 +355,14 @@ public class CustomConfigTestCase extends DefaultConfigTestCase { parent = parent.getParent(); } handlers = parent.getHandlers(); - + // The CustomConfig.properties file explicitly defines one handler class - // to be attached to the root logger, so if it isn't there then + // to be attached to the root logger, so if it isn't there then // something is badly wrong... // // Yes this testing is also done in testPristineHandlers but // unfortunately: - // * we need to set up the handlers variable here, + // * we need to set up the handlers variable here, // * we don't want that to be set up incorrectly, as that can // produce weird error messages in other tests, and // * we can't rely on testPristineHandlers being the first diff --git a/src/test/org/apache/commons/logging/jdk14/DefaultConfigTestCase.java b/src/test/org/apache/commons/logging/jdk14/DefaultConfigTestCase.java index 640f51d..446d58d 100644 --- a/src/test/org/apache/commons/logging/jdk14/DefaultConfigTestCase.java +++ b/src/test/org/apache/commons/logging/jdk14/DefaultConfigTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.jdk14; @@ -92,7 +92,7 @@ public class DefaultConfigTestCase extends TestCase { loader.useExplicitLoader("junit.", Test.class.getClassLoader()); loader.addLogicalLib("testclasses"); loader.addLogicalLib("commons-logging"); - + Class testClass = loader.loadClass(DefaultConfigTestCase.class.getName()); return new PathableTestSuite(testClass, loader); } diff --git a/src/test/org/apache/commons/logging/jdk14/TestHandler.java b/src/test/org/apache/commons/logging/jdk14/TestHandler.java index 06ecfce..eb53cee 100644 --- a/src/test/org/apache/commons/logging/jdk14/TestHandler.java +++ b/src/test/org/apache/commons/logging/jdk14/TestHandler.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.jdk14; diff --git a/src/test/org/apache/commons/logging/log4j/StandardTests.java b/src/test/org/apache/commons/logging/log4j/StandardTests.java index 72f9cc6..2f86f74 100644 --- a/src/test/org/apache/commons/logging/log4j/StandardTests.java +++ b/src/test/org/apache/commons/logging/log4j/StandardTests.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.log4j; @@ -51,9 +51,9 @@ public abstract class StandardTests extends TestCase { public Throwable throwable; } - // ------------------------------------------------------------------- + // ------------------------------------------------------------------- // JUnit Infrastructure Methods - // ------------------------------------------------------------------- + // ------------------------------------------------------------------- /** * Set up instance variables required by this test case. @@ -69,9 +69,9 @@ public abstract class StandardTests extends TestCase { LogFactory.releaseAll(); } - // ----------------------------------------------------------- + // ----------------------------------------------------------- // abstract methods - // ----------------------------------------------------------- + // ----------------------------------------------------------- /** * Modify log4j's setup so that all messages actually logged get redirected @@ -81,7 +81,7 @@ public abstract class StandardTests extends TestCase { * can test whether messages are getting properly filtered. */ public abstract void setUpTestAppender(List logEvents) throws Exception; - + // ----------------------------------------------------------- Test Methods /** @@ -154,9 +154,9 @@ public abstract class StandardTests extends TestCase { *

  • logPlainMessages or logExceptionMessages has been * called to log a known number of messages at known levels. * - * + * * @param logEvents is the list of log events received. - * + * * @param thrown False if logPlainMessages was called * (ie the TestAppender is expected to have received * logevents with no associated exception info). True if @@ -164,24 +164,24 @@ public abstract class StandardTests extends TestCase { */ private void checkLoggingEvents(List logEvents, boolean thrown) { LogEvent ev; - + assertEquals("Unexpected number of log events", 4, logEvents.size()); - + ev = (LogEvent) logEvents.get(0); assertEquals("Info message expected", "info", ev.msg); assertEquals("Info level expected", "INFO", ev.level); assertEquals("Exception data incorrect", ev.throwable!=null, thrown); - + ev = (LogEvent) logEvents.get(1); assertEquals("Warn message expected", "warn", ev.msg); assertEquals("Warn level expected", "WARN", ev.level); assertEquals("Exception data incorrect", ev.throwable!=null, thrown); - + ev = (LogEvent) logEvents.get(2); assertEquals("Error message expected", "error", ev.msg); assertEquals("Error level expected", "ERROR", ev.level); assertEquals("Exception data incorrect", ev.throwable!=null, thrown); - + ev = (LogEvent) logEvents.get(3); assertEquals("Fatal message expected", "fatal", ev.msg); assertEquals("Fatal level expected", "FATAL", ev.level); diff --git a/src/test/org/apache/commons/logging/log4j/log4j12/ApiClasspathStandardTestCase.java b/src/test/org/apache/commons/logging/log4j/log4j12/ApiClasspathStandardTestCase.java index cc9364a..1b7bace 100644 --- a/src/test/org/apache/commons/logging/log4j/log4j12/ApiClasspathStandardTestCase.java +++ b/src/test/org/apache/commons/logging/log4j/log4j12/ApiClasspathStandardTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.log4j.log4j12; diff --git a/src/test/org/apache/commons/logging/log4j/log4j12/AppClasspathStandardTestCase.java b/src/test/org/apache/commons/logging/log4j/log4j12/AppClasspathStandardTestCase.java index b8fdfa3..71da059 100644 --- a/src/test/org/apache/commons/logging/log4j/log4j12/AppClasspathStandardTestCase.java +++ b/src/test/org/apache/commons/logging/log4j/log4j12/AppClasspathStandardTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.log4j.log4j12; @@ -39,7 +39,7 @@ public class AppClasspathStandardTestCase extends TestCase { loader.addLogicalLib("testclasses"); loader.addLogicalLib("log4j12"); loader.addLogicalLib("commons-logging"); - + Class testClass = loader.loadClass( "org.apache.commons.logging.log4j.log4j12.Log4j12StandardTests"); return new PathableTestSuite(testClass, loader); diff --git a/src/test/org/apache/commons/logging/log4j/log4j12/ChildClasspathStandardTestCase.java b/src/test/org/apache/commons/logging/log4j/log4j12/ChildClasspathStandardTestCase.java index 4998d2c..2620dbd 100644 --- a/src/test/org/apache/commons/logging/log4j/log4j12/ChildClasspathStandardTestCase.java +++ b/src/test/org/apache/commons/logging/log4j/log4j12/ChildClasspathStandardTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.log4j.log4j12; @@ -42,7 +42,7 @@ public class ChildClasspathStandardTestCase extends TestCase { child.addLogicalLib("testclasses"); child.addLogicalLib("log4j12"); child.addLogicalLib("commons-logging"); - + Class testClass = child.loadClass( "org.apache.commons.logging.log4j.log4j12.Log4j12StandardTests"); return new PathableTestSuite(testClass, child); diff --git a/src/test/org/apache/commons/logging/log4j/log4j12/Log4j12StandardTests.java b/src/test/org/apache/commons/logging/log4j/log4j12/Log4j12StandardTests.java index 69b36c4..a03e74a 100644 --- a/src/test/org/apache/commons/logging/log4j/log4j12/Log4j12StandardTests.java +++ b/src/test/org/apache/commons/logging/log4j/log4j12/Log4j12StandardTests.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.log4j.log4j12; diff --git a/src/test/org/apache/commons/logging/log4j/log4j12/ParentClasspathStandardTestCase.java b/src/test/org/apache/commons/logging/log4j/log4j12/ParentClasspathStandardTestCase.java index 5578a03..3654d92 100644 --- a/src/test/org/apache/commons/logging/log4j/log4j12/ParentClasspathStandardTestCase.java +++ b/src/test/org/apache/commons/logging/log4j/log4j12/ParentClasspathStandardTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.log4j.log4j12; @@ -41,7 +41,7 @@ public class ParentClasspathStandardTestCase extends TestCase { PathableClassLoader child = new PathableClassLoader(parent); child.addLogicalLib("testclasses"); - + Class testClass = child.loadClass( "org.apache.commons.logging.log4j.log4j12.Log4j12StandardTests"); return new PathableTestSuite(testClass, child); diff --git a/src/test/org/apache/commons/logging/log4j/log4j12/TestAppender.java b/src/test/org/apache/commons/logging/log4j/log4j12/TestAppender.java index 649306f..5ad71c8 100644 --- a/src/test/org/apache/commons/logging/log4j/log4j12/TestAppender.java +++ b/src/test/org/apache/commons/logging/log4j/log4j12/TestAppender.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.log4j.log4j12; @@ -51,7 +51,7 @@ public class TestAppender extends AppenderSkeleton { protected void append(LoggingEvent event) { StandardTests.LogEvent lev = new StandardTests.LogEvent(); - + lev.level = event.getLevel().toString(); if (event.getMessage() == null) { @@ -59,7 +59,7 @@ public class TestAppender extends AppenderSkeleton { } else { lev.msg = event.getMessage().toString(); } - + if (event.getThrowableInformation() == null) { lev.throwable = null; } else { diff --git a/src/test/org/apache/commons/logging/logkit/StandardTestCase.java b/src/test/org/apache/commons/logging/logkit/StandardTestCase.java index 478310a..4c1fbd8 100644 --- a/src/test/org/apache/commons/logging/logkit/StandardTestCase.java +++ b/src/test/org/apache/commons/logging/logkit/StandardTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.logkit; @@ -100,7 +100,7 @@ public class StandardTestCase extends AbstractLogTest { /** * Override the abstract method from the parent class so that the - * inherited tests can access the right Log object type. + * inherited tests can access the right Log object type. */ public Log getLogObject() { diff --git a/src/test/org/apache/commons/logging/noop/NoOpLogTestCase.java b/src/test/org/apache/commons/logging/noop/NoOpLogTestCase.java index 1f23fdc..fa54c82 100644 --- a/src/test/org/apache/commons/logging/noop/NoOpLogTestCase.java +++ b/src/test/org/apache/commons/logging/noop/NoOpLogTestCase.java @@ -5,16 +5,16 @@ * The ASF licenses this file to You 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.apache.commons.logging.noop; import java.io.ByteArrayInputStream; @@ -52,10 +52,10 @@ public class NoOpLogTestCase extends AbstractLogTest LogFactory.releaseAll(); System.getProperties().remove("org.apache.commons.logging.Log"); } - + /** * Override the abstract method from the parent class so that the - * inherited tests can access the right Log object type. + * inherited tests can access the right Log object type. */ public Log getLogObject() { diff --git a/src/test/org/apache/commons/logging/pathable/ChildFirstTestCase.java b/src/test/org/apache/commons/logging/pathable/ChildFirstTestCase.java index c3fa87b..1aeb12d 100644 --- a/src/test/org/apache/commons/logging/pathable/ChildFirstTestCase.java +++ b/src/test/org/apache/commons/logging/pathable/ChildFirstTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.pathable; import java.net.URL; @@ -41,7 +41,7 @@ import org.apache.commons.logging.PathableTestSuite; */ public class ChildFirstTestCase extends TestCase { - + /** * Set up a custom classloader hierarchy for this test case. * The hierarchy is: @@ -54,38 +54,38 @@ public class ChildFirstTestCase extends TestCase { public static Test suite() throws Exception { Class thisClass = ChildFirstTestCase.class; ClassLoader thisClassLoader = thisClass.getClassLoader(); - + // Make the parent a direct child of the bootloader to hide all // other classes in the system classpath PathableClassLoader parent = new PathableClassLoader(null); parent.setParentFirst(false); - + // Make the junit classes visible as a special case, as junit // won't be able to call this class at all without this. The // junit classes must be visible from the classloader that loaded // this class, so use that as the source for future access to classes // from the junit package. parent.useExplicitLoader("junit.", thisClassLoader); - + // Make the commons-logging.jar classes visible via the parent parent.addLogicalLib("commons-logging"); - + // Create a child classloader to load the test case through PathableClassLoader child = new PathableClassLoader(parent); child.setParentFirst(false); - + // Obviously, the child classloader needs to have the test classes // in its path! child.addLogicalLib("testclasses"); child.addLogicalLib("commons-logging-adapters"); - + // Create a third classloader to be the context classloader. PathableClassLoader context = new PathableClassLoader(child); context.setParentFirst(false); // reload this class via the child classloader Class testClass = child.loadClass(thisClass.getName()); - + // and return our custom TestSuite class return new PathableTestSuite(testClass, context); } @@ -118,14 +118,14 @@ public class ChildFirstTestCase extends TestCase { assertEquals("Context classloader has unexpected type", PathableClassLoader.class.getName(), contextLoader.getClass().getName()); - + // the classloader that loaded this class is obviously not null ClassLoader thisLoader = this.getClass().getClassLoader(); assertNotNull("thisLoader is null", thisLoader); assertEquals("thisLoader has unexpected type", PathableClassLoader.class.getName(), thisLoader.getClass().getName()); - + // the suite method specified that the context classloader's parent // is the loader that loaded this test case. assertSame("Context classloader is not child of thisLoader", @@ -137,7 +137,7 @@ public class ChildFirstTestCase extends TestCase { assertEquals("Parent classloader has unexpected type", PathableClassLoader.class.getName(), parentLoader.getClass().getName()); - + // parent should have a parent of null assertNull("Parent classloader has non-null parent", parentLoader.getParent()); @@ -155,7 +155,7 @@ public class ChildFirstTestCase extends TestCase { // though it is accessable due to trickery in the PathableClassLoader. Class junitTest = contextLoader.loadClass("junit.framework.Test"); Set ancestorCLs = getAncestorCLs(); - assertFalse("Junit not loaded by ancestor classloader", + assertFalse("Junit not loaded by ancestor classloader", ancestorCLs.contains(junitTest.getClassLoader())); // jcl api classes should be visible only via the parent @@ -166,14 +166,14 @@ public class ChildFirstTestCase extends TestCase { // jcl adapter classes should be visible via both parent and child. However // as the classloaders are child-first we should see the child one. Class log4jClass = contextLoader.loadClass("org.apache.commons.logging.impl.Log4JLogger"); - assertSame("Log4JLogger not loaded via child", + assertSame("Log4JLogger not loaded via child", log4jClass.getClassLoader(), thisLoader); - + // test classes should be visible via the child only Class testClass = contextLoader.loadClass("org.apache.commons.logging.PathableTestSuite"); - assertSame("PathableTestSuite not loaded via child", + assertSame("PathableTestSuite not loaded via child", testClass.getClassLoader(), thisLoader); - + // test loading of class that is not available try { Class noSuchClass = contextLoader.loadClass("no.such.class"); @@ -188,16 +188,16 @@ public class ChildFirstTestCase extends TestCase { assertNull("String class classloader is not null!", stringClass.getClassLoader()); } - + /** * Test that the various flavours of ClassLoader.getResource work as expected. */ public void testResource() { URL resource; - + ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); ClassLoader childLoader = contextLoader.getParent(); - + // getResource where it doesn't exist resource = childLoader.getResource("nosuchfile"); assertNull("Non-null URL returned for invalid resource name", resource); @@ -205,7 +205,7 @@ public class ChildFirstTestCase extends TestCase { // getResource where it is accessable only to parent classloader resource = childLoader.getResource("org/apache/commons/logging/Log.class"); assertNotNull("Unable to locate Log.class resource", resource); - + // getResource where it is accessable only to child classloader resource = childLoader.getResource("org/apache/commons/logging/PathableTestSuite.class"); assertNotNull("Unable to locate PathableTestSuite.class resource", resource); @@ -219,36 +219,36 @@ public class ChildFirstTestCase extends TestCase { assertTrue("Incorrect source for Log4JLogger class", resource.toString().indexOf("/commons-logging-adapters-1.") > 0); } - + /** * Test that the various flavours of ClassLoader.getResources work as expected. */ public void testResources() throws Exception { Enumeration resources; URL[] urls; - + // verify the classloader hierarchy ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); ClassLoader childLoader = contextLoader.getParent(); ClassLoader parentLoader = childLoader.getParent(); ClassLoader bootLoader = parentLoader.getParent(); assertNull("Unexpected classloader hierarchy", bootLoader); - + // getResources where no instances exist resources = childLoader.getResources("nosuchfile"); urls = toURLArray(resources); assertEquals("Non-null URL returned for invalid resource name", 0, urls.length); - + // getResources where the resource only exists in the parent resources = childLoader.getResources("org/apache/commons/logging/Log.class"); urls = toURLArray(resources); assertEquals("Unexpected number of Log.class resources found", 1, urls.length); - + // getResources where the resource only exists in the child resources = childLoader.getResources("org/apache/commons/logging/PathableTestSuite.class"); urls = toURLArray(resources); assertEquals("Unexpected number of PathableTestSuite.class resources found", 1, urls.length); - + // getResources where the resource exists in both. // resources should be returned in order (child-resource, parent-resource). // @@ -257,12 +257,12 @@ public class ChildFirstTestCase extends TestCase { // to override this. So even when child-first is enabled the resource order // is still (parent-resources, child-resources). This test verifies the expected // behaviour - even though it's not the desired behaviour. - + resources = childLoader.getResources("org/apache/commons/logging/impl/Log4JLogger.class"); urls = toURLArray(resources); assertEquals("Unexpected number of Log4JLogger.class resources found", 2, urls.length); - - // There is no gaurantee about the ordering of results returned from getResources + + // There is no guarantee about the ordering of results returned from getResources // To make this test portable across JVMs, sort the string to give them a known order String[] urlsToStrings = new String[2]; urlsToStrings[0] = urls[0].toString(); @@ -292,23 +292,23 @@ public class ChildFirstTestCase extends TestCase { */ public void testResourceAsStream() throws Exception { java.io.InputStream is; - + // verify the classloader hierarchy ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); ClassLoader childLoader = contextLoader.getParent(); ClassLoader parentLoader = childLoader.getParent(); ClassLoader bootLoader = parentLoader.getParent(); assertNull("Unexpected classloader hierarchy", bootLoader); - + // getResourceAsStream where no instances exist is = childLoader.getResourceAsStream("nosuchfile"); assertNull("Invalid resource returned non-null stream", is); - + // getResourceAsStream where resource does exist is = childLoader.getResourceAsStream("org/apache/commons/logging/Log.class"); assertNotNull("Null returned for valid resource", is); is.close(); - + // It would be nice to test parent-first ordering here, but that would require // having a resource with the same name in both the parent and child loaders, // but with different contents. That's a little tricky to set up so we'll diff --git a/src/test/org/apache/commons/logging/pathable/GeneralTestCase.java b/src/test/org/apache/commons/logging/pathable/GeneralTestCase.java index c61a792..86fd475 100644 --- a/src/test/org/apache/commons/logging/pathable/GeneralTestCase.java +++ b/src/test/org/apache/commons/logging/pathable/GeneralTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.pathable; import java.net.URL; @@ -30,25 +30,25 @@ import org.apache.commons.logging.PathableTestSuite; */ public class GeneralTestCase extends TestCase { - + /** * Set up a custom classloader hierarchy for this test case. */ public static Test suite() throws Exception { Class thisClass = GeneralTestCase.class; ClassLoader thisClassLoader = thisClass.getClassLoader(); - + PathableClassLoader loader = new PathableClassLoader(null); loader.useExplicitLoader("junit.", thisClassLoader); loader.addLogicalLib("testclasses"); // reload this class via the child classloader Class testClass = loader.loadClass(thisClass.getName()); - + // and return our custom TestSuite class return new PathableTestSuite(testClass, loader); } - + /** * Verify that a certain system property is not set, then set it. */ @@ -59,7 +59,7 @@ public class GeneralTestCase extends TestCase { prop = System.getProperty("no.such.property"); assertNotNull("no.such.property is unexpectedly undefined", prop); } - + /** * Verify that when a test method modifies the system properties they are * reset before the next test is run. @@ -81,21 +81,21 @@ public class GeneralTestCase extends TestCase { public void testResetProps2() { checkAndSetProperties(); } - + /** * Verify that the context classloader is a custom one, then reset it to * a non-custom one. */ private static void checkAndSetContext() { ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); - assertEquals("ContextLoader is of unexpected type", - contextLoader.getClass().getName(), + assertEquals("ContextLoader is of unexpected type", + contextLoader.getClass().getName(), PathableClassLoader.class.getName()); - + URL[] noUrls = new URL[0]; Thread.currentThread().setContextClassLoader(new URLClassLoader(noUrls)); } - + /** * Verify that when a test method modifies the context classloader it is * reset before the next test is run. diff --git a/src/test/org/apache/commons/logging/pathable/ParentFirstTestCase.java b/src/test/org/apache/commons/logging/pathable/ParentFirstTestCase.java index aeee3b5..f9bf452 100644 --- a/src/test/org/apache/commons/logging/pathable/ParentFirstTestCase.java +++ b/src/test/org/apache/commons/logging/pathable/ParentFirstTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.pathable; import java.net.URL; @@ -41,7 +41,7 @@ import org.apache.commons.logging.PathableTestSuite; */ public class ParentFirstTestCase extends TestCase { - + /** * Set up a custom classloader hierarchy for this test case. * The hierarchy is: @@ -58,7 +58,7 @@ public class ParentFirstTestCase extends TestCase { // Make the parent a direct child of the bootloader to hide all // other classes in the system classpath PathableClassLoader parent = new PathableClassLoader(null); - + // Make the junit classes visible as a special case, as junit // won't be able to call this class at all without this. The // junit classes must be visible from the classloader that loaded diff --git a/src/test/org/apache/commons/logging/security/MockSecurityManager.java b/src/test/org/apache/commons/logging/security/MockSecurityManager.java index 2c74870..eae94c6 100644 --- a/src/test/org/apache/commons/logging/security/MockSecurityManager.java +++ b/src/test/org/apache/commons/logging/security/MockSecurityManager.java @@ -1,22 +1,20 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * 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. - */ - + * 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.apache.commons.logging.security; import java.io.FilePermission; diff --git a/src/test/org/apache/commons/logging/security/SecurityAllowedTestCase.java b/src/test/org/apache/commons/logging/security/SecurityAllowedTestCase.java index 0b31662..9ab7ad9 100644 --- a/src/test/org/apache/commons/logging/security/SecurityAllowedTestCase.java +++ b/src/test/org/apache/commons/logging/security/SecurityAllowedTestCase.java @@ -1,22 +1,20 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * 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. - */ - + * 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.apache.commons.logging.security; import java.io.PrintWriter; @@ -39,7 +37,7 @@ import org.apache.commons.logging.PathableTestSuite; *

    * This class has only one unit test, as we are (in part) checking behaviour in * the static block of the LogFactory class. As that class cannot be unloaded after - * being loaded into a classloader, the only workaround is to use the + * being loaded into a classloader, the only workaround is to use the * PathableClassLoader approach to ensure each test is run in its own * classloader, and use a separate testcase class for each test. */ diff --git a/src/test/org/apache/commons/logging/security/SecurityForbiddenTestCase.java b/src/test/org/apache/commons/logging/security/SecurityForbiddenTestCase.java index e6f40c6..8734337 100644 --- a/src/test/org/apache/commons/logging/security/SecurityForbiddenTestCase.java +++ b/src/test/org/apache/commons/logging/security/SecurityForbiddenTestCase.java @@ -1,22 +1,20 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * 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. - */ - + * 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.apache.commons.logging.security; import java.io.PrintWriter; @@ -42,7 +40,7 @@ import org.apache.commons.logging.PathableTestSuite; *

    * This class has only one unit test, as we are (in part) checking behaviour in * the static block of the LogFactory class. As that class cannot be unloaded after - * being loaded into a classloader, the only workaround is to use the + * being loaded into a classloader, the only workaround is to use the * PathableClassLoader approach to ensure each test is run in its own * classloader, and use a separate testcase class for each test. */ diff --git a/src/test/org/apache/commons/logging/servlet/BasicServletTestCase.java b/src/test/org/apache/commons/logging/servlet/BasicServletTestCase.java index 504b173..e1ecdbb 100644 --- a/src/test/org/apache/commons/logging/servlet/BasicServletTestCase.java +++ b/src/test/org/apache/commons/logging/servlet/BasicServletTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.servlet; @@ -60,7 +60,7 @@ public class BasicServletTestCase extends TestCase { Class testClass = child.loadClass(BasicServletTestCase.class.getName()); return new PathableTestSuite(testClass, tccl); } - + /** * Test that calling ServletContextCleaner.contextDestroyed doesn't crash. * Testing anything else is rather difficult... diff --git a/src/test/org/apache/commons/logging/simple/CustomConfigTestCase.java b/src/test/org/apache/commons/logging/simple/CustomConfigTestCase.java index e192cec..f78804e 100644 --- a/src/test/org/apache/commons/logging/simple/CustomConfigTestCase.java +++ b/src/test/org/apache/commons/logging/simple/CustomConfigTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.simple; diff --git a/src/test/org/apache/commons/logging/simple/DateTimeCustomConfigTestCase.java b/src/test/org/apache/commons/logging/simple/DateTimeCustomConfigTestCase.java index 6619024..5e72718 100644 --- a/src/test/org/apache/commons/logging/simple/DateTimeCustomConfigTestCase.java +++ b/src/test/org/apache/commons/logging/simple/DateTimeCustomConfigTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.simple; @@ -31,7 +31,7 @@ import org.apache.commons.logging.PathableTestSuite; * Tests custom date time format configuration */ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase { - + // ----------------------------------------------------------- Constructors /** @@ -53,7 +53,7 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase { loader.useExplicitLoader("junit.", Test.class.getClassLoader()); loader.addLogicalLib("testclasses"); loader.addLogicalLib("commons-logging"); - + Class testClass = loader.loadClass(thisClass.getName()); return new PathableTestSuite(testClass, loader); } @@ -61,12 +61,12 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase { /** * Set up system properties required by this unit test. Here, we - * set up the props defined in the parent class setProperties method, + * set up the props defined in the parent class setProperties method, * and add a few to configure the SimpleLog class date/time output. */ public void setProperties() { super.setProperties(); - + System.setProperty( "org.apache.commons.logging.simplelog.dateTimeFormat", "dd.mm.yyyy"); @@ -89,17 +89,17 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase { protected void checkDecoratedDateTime() { assertEquals("Expected date format to be set", "dd.mm.yyyy", ((DecoratedSimpleLog) log).getDateTimeFormat()); - // try the formatter Date now = new Date(); - DateFormat formatter = ((DecoratedSimpleLog) log).getDateTimeFormatter(); + DateFormat formatter = ((DecoratedSimpleLog) log).getDateTimeFormatter(); SimpleDateFormat sampleFormatter = new SimpleDateFormat("dd.mm.yyyy"); - assertEquals("Date should be formatters to pattern dd.mm.yyyy", sampleFormatter.format(now), formatter.format(now)); + assertEquals("Date should be formatters to pattern dd.mm.yyyy", + sampleFormatter.format(now), formatter.format(now)); } - + /** Hook for subclassses */ protected void checkShowDateTime() { assertTrue(((DecoratedSimpleLog) log).getShowDateTime()); } - -} \ No newline at end of file + +} diff --git a/src/test/org/apache/commons/logging/simple/DecoratedSimpleLog.java b/src/test/org/apache/commons/logging/simple/DecoratedSimpleLog.java index a780297..c68c2cb 100644 --- a/src/test/org/apache/commons/logging/simple/DecoratedSimpleLog.java +++ b/src/test/org/apache/commons/logging/simple/DecoratedSimpleLog.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.simple; diff --git a/src/test/org/apache/commons/logging/simple/DefaultConfigTestCase.java b/src/test/org/apache/commons/logging/simple/DefaultConfigTestCase.java index a7e1858..f5bccdb 100644 --- a/src/test/org/apache/commons/logging/simple/DefaultConfigTestCase.java +++ b/src/test/org/apache/commons/logging/simple/DefaultConfigTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.simple; diff --git a/src/test/org/apache/commons/logging/simple/LogRecord.java b/src/test/org/apache/commons/logging/simple/LogRecord.java index 3f9f51d..4f1e723 100644 --- a/src/test/org/apache/commons/logging/simple/LogRecord.java +++ b/src/test/org/apache/commons/logging/simple/LogRecord.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.simple; diff --git a/src/test/org/apache/commons/logging/tccl/BadTCCLTestCase.java b/src/test/org/apache/commons/logging/tccl/BadTCCLTestCase.java index 00b5904..7211156 100644 --- a/src/test/org/apache/commons/logging/tccl/BadTCCLTestCase.java +++ b/src/test/org/apache/commons/logging/tccl/BadTCCLTestCase.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You 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. diff --git a/src/test/org/apache/commons/logging/tccl/NullTCCLTestCase.java b/src/test/org/apache/commons/logging/tccl/NullTCCLTestCase.java index d7b5271..ae5ab4a 100644 --- a/src/test/org/apache/commons/logging/tccl/NullTCCLTestCase.java +++ b/src/test/org/apache/commons/logging/tccl/NullTCCLTestCase.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You 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. diff --git a/src/test/org/apache/commons/logging/tccl/custom/MyLog.java b/src/test/org/apache/commons/logging/tccl/custom/MyLog.java index 4f79ab3..214f7b3 100644 --- a/src/test/org/apache/commons/logging/tccl/custom/MyLog.java +++ b/src/test/org/apache/commons/logging/tccl/custom/MyLog.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.tccl.custom; import org.apache.commons.logging.Log; diff --git a/src/test/org/apache/commons/logging/tccl/custom/MyLogFactoryImpl.java b/src/test/org/apache/commons/logging/tccl/custom/MyLogFactoryImpl.java index c46bae4..63d5ac6 100644 --- a/src/test/org/apache/commons/logging/tccl/custom/MyLogFactoryImpl.java +++ b/src/test/org/apache/commons/logging/tccl/custom/MyLogFactoryImpl.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.tccl.custom; diff --git a/src/test/org/apache/commons/logging/tccl/log/TcclDisabledTestCase.java b/src/test/org/apache/commons/logging/tccl/log/TcclDisabledTestCase.java index a12257b..152af3c 100644 --- a/src/test/org/apache/commons/logging/tccl/log/TcclDisabledTestCase.java +++ b/src/test/org/apache/commons/logging/tccl/log/TcclDisabledTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.tccl.log; diff --git a/src/test/org/apache/commons/logging/tccl/log/TcclEnabledTestCase.java b/src/test/org/apache/commons/logging/tccl/log/TcclEnabledTestCase.java index b4fe96b..692b53e 100644 --- a/src/test/org/apache/commons/logging/tccl/log/TcclEnabledTestCase.java +++ b/src/test/org/apache/commons/logging/tccl/log/TcclEnabledTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.tccl.log; @@ -31,7 +31,7 @@ import org.apache.commons.logging.PathableTestSuite; /** * Verify that by default the standard LogFactoryImpl class loads a - * custom Log implementation via the TCCL. + * custom Log implementation via the TCCL. */ public class TcclEnabledTestCase extends TestCase { diff --git a/src/test/org/apache/commons/logging/tccl/logfactory/TcclDisabledTestCase.java b/src/test/org/apache/commons/logging/tccl/logfactory/TcclDisabledTestCase.java index 9b00f54..fc577e3 100644 --- a/src/test/org/apache/commons/logging/tccl/logfactory/TcclDisabledTestCase.java +++ b/src/test/org/apache/commons/logging/tccl/logfactory/TcclDisabledTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.tccl.logfactory; diff --git a/src/test/org/apache/commons/logging/tccl/logfactory/TcclEnabledTestCase.java b/src/test/org/apache/commons/logging/tccl/logfactory/TcclEnabledTestCase.java index a4f232a..58d746b 100644 --- a/src/test/org/apache/commons/logging/tccl/logfactory/TcclEnabledTestCase.java +++ b/src/test/org/apache/commons/logging/tccl/logfactory/TcclEnabledTestCase.java @@ -5,15 +5,15 @@ * The ASF licenses this file to You 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.apache.commons.logging.tccl.logfactory;