From cfb31332a1227690fbd2d0d86cbbb5ed4255b36f Mon Sep 17 00:00:00 2001 From: Simon Kitching Date: Mon, 17 Apr 2006 03:30:38 +0000 Subject: [PATCH] * Fix bug where unit tests weren't getting executed at all (wrong test class name) * Put both resources in child classloader rather than using parent, to avoid confusion with parentFirst not being supported by PathableClassLoader.getResources. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@394603 13f79535-47bb-0310-9956-ffa450edef68 --- .../config/FirstPriorityConfigTestCase.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/test/org/apache/commons/logging/config/FirstPriorityConfigTestCase.java b/src/test/org/apache/commons/logging/config/FirstPriorityConfigTestCase.java index a6b6a7d..5950e3e 100644 --- a/src/test/org/apache/commons/logging/config/FirstPriorityConfigTestCase.java +++ b/src/test/org/apache/commons/logging/config/FirstPriorityConfigTestCase.java @@ -34,11 +34,10 @@ import org.apache.commons.logging.PathableTestSuite; * This test sets up a classpath where: * * The result should be that the first file is used. */ - public class FirstPriorityConfigTestCase extends TestCase { // ------------------------------------------- JUnit Infrastructure Methods @@ -48,7 +47,7 @@ public class FirstPriorityConfigTestCase extends TestCase { * Return the tests included in this test suite. */ public static Test suite() throws Exception { - Class thisClass = PriorityConfigTestCase.class; + Class thisClass = FirstPriorityConfigTestCase.class; // Determine the URL to this .class file, so that we can then // append the priority dirs to it. For tidiness, load this @@ -73,15 +72,14 @@ public class FirstPriorityConfigTestCase extends TestCase { containerLoader.useSystemLoader("junit."); containerLoader.addLogicalLib("commons-logging"); - URL pri10URL = new URL(baseUrl, "priority10/"); - containerLoader.addURL(pri10URL); - PathableClassLoader webappLoader = new PathableClassLoader(containerLoader); - webappLoader.setParentFirst(false); webappLoader.addLogicalLib("testclasses"); - + URL pri20URL = new URL(baseUrl, "priority20/"); webappLoader.addURL(pri20URL); + + 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. @@ -113,7 +111,5 @@ public class FirstPriorityConfigTestCase extends TestCase { LogFactory instance = LogFactory.getFactory(); String id = (String) instance.getAttribute("configId"); assertEquals("Correct config file loaded", "priority20", id ); - - fail("deliberate failure"); } }