Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 36804 invoked from network); 20 Jun 2003 21:14:00 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 20 Jun 2003 21:14:00 -0000 Received: (qmail 22078 invoked by uid 97); 20 Jun 2003 21:16:24 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 22071 invoked from network); 20 Jun 2003 21:16:24 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 20 Jun 2003 21:16:24 -0000 Received: (qmail 36546 invoked by uid 500); 20 Jun 2003 21:13:57 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 36521 invoked from network); 20 Jun 2003 21:13:56 -0000 Received: from mail05b.webhosting-verizon.net (209.238.3.61) by daedalus.apache.org with SMTP; 20 Jun 2003 21:13:56 -0000 Received: from www.dunbarconsulting.org (209.238.233.120) by mail05b.webhosting-verizon.net (RS ver 1.0.83vs) with SMTP id 0260513632 for ; Fri, 20 Jun 2003 17:13:53 -0400 (EDT) From: "Brian E. Dunbar" To: "Jakarta Commons Developers List" Subject: RE: [Configuration]Missing Jars for Build and Bug with ClassPropertiesConfiguration Date: Fri, 20 Jun 2003 17:14:01 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0018_01C3374F.5842C220" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <4C47F66C98B28B4F903120350DEF05B06CB37F@hqexch01.upstate.com> X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Loop-Detect: 1 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0018_01C3374F.5842C220 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Eric, I have made the changes and provided a test case as you suggested. The files I have attached contain the following: maven.xml-Added copy target to copy the test.properties file to testClasspath.properties at the root of the classpath. project.xml-removed the TestClassProperties from being excluded from tests. TestClassPropertiesConfiguration.java-Added new unit test to test loading from the classpath in various path formats. TestBasePropertiesConfiguration.java-Added a test to test properties that reference another property using the ${property} notation. This was unrelated to the original changes that I proposed. test.properties-Added two properties for testing references to previous properties. If you put the above changes in place and run maven you can see that it fails the tests. Place the following files in place and everything should test OK. ClassPropertiesConfiguration.java-Changes to first attempt to load the properties file via the provided class. If that fails it attempts to load from the classloader. Let me know if you have any questions, Brian Dunbar -----Original Message----- From: EPugh@upstate.com [mailto:EPugh@upstate.com] Sent: Thursday, June 19, 2003 9:14 PM To: commons-dev@jakarta.apache.org Subject: RE: [Configuration]Missing Jars for Build and Bug with ClassPrope rtiesConfiguration I just committed an update build.xml that worked fine. Plus a bunch of other small fixes. You may want to grab that to work from. Eric Pugh -----Original Message----- From: EPugh@upstate.com [mailto:EPugh@upstate.com] Sent: Thursday, June 19, 2003 6:06 PM To: commons-dev@jakarta.apache.org Subject: RE: [Configuration]Missing Jars for Build and Bug with ClassPrope rtiesConfiguration Well, I have never used that class, so I can definitly NOT venture an opinion! Having said that, if you provide patches to fix the code, and good unit tests to prove the old code works and the new code works, then I would be happy to apply your fixes. What would be great is to first submit a patch that PROVES that properties at the root fails. Then, I can run a test, take your patches, and see that the test case starts passing! Eric Pugh -----Original Message----- From: Brian E. Dunbar [mailto:bdunbar@dunbarconsulting.org] Sent: Thursday, June 19, 2003 6:03 PM To: Jakarta Commons Developers List Subject: RE: [Configuration]Missing Jars for Build and Bug with ClassPropertiesConfiguration Eric, I should have picked up on the fact that it is maven driven given the maven.xml file. Yes, this change would allow you to have properties file found on the classpath either at the root of the classpath or at the package subdirectory. The code and Javadoc currently claims to support both, but the implementation of access them at the root appears to be broken (unless I am missing something). Brian -----Original Message----- From: EPugh@upstate.com [mailto:EPugh@upstate.com] Sent: Thursday, June 19, 2003 5:38 PM To: commons-dev@jakarta.apache.org Subject: RE: [Configuration]Missing Jars for Build and Bug with ClassPropertiesConfiguration Brian, What kinds of errors are you getting. commons-configuration is built using maven. One of maven's target's produces the build.xml file. We really need a message in there, "don't edit this, it is generated by maven!" I regenerated the buid.xml file using maven and was sucessful. If you need an updated build.xml, I can email it to you directly. I'll try and commit it to cvs this evening! I am not sure about Item 2, this is streching my level of understanding. Would this mean though that I could have properties files in both a class sub directory and in the root? eric -----Original Message----- From: Brian E. Dunbar [mailto:bdunbar@dunbarconsulting.org] Sent: Thursday, June 19, 2003 5:28 PM To: commons-dev@jakarta.apache.org Subject: [Configuration]Missing Jars for Build and Bug with ClassPropertiesConfiguration Item 1: I was building commons-configuration from scratch and it was having problems retrieving some of the jar files from ibiblio. I made fixes to the build.xml file to add/modify some lines to get it to work. My fixed build.xml is attached. Item 2: The ClassPropertiesConfiguration seems to only be able to load properties files from within the package of the class passed into the constructor. I have been unable to successfully load a properties file from the root of the classpath by placing a "/" at the beginning of the name (as the source code indicates one should do). The source code indicates that the Javadoc for loading resources says that all URL's start with a "/", but I am unable to find that in the javadoc for ClassLoader and in testing I have been unable to get ClassLoader to load a file that beings with a "/". If I am correct, I propose that ClassPropertiesConfiguration be changed as described below. In my experience it is more likely that properties files need to be loaded from the root of the classpath then from a specific package within the classpath (but that is my experience). Use the classloader of class that is provided by the constructor. Add a constructor that indicates whether to use relative or absolute. Change getPropertyStream to utilize the relative or absolute flag. Add a test case that checks that absolute paths work. I will gladly submit a patch to do the above if what I propose makes sense. Brian Dunbar --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org ------=_NextPart_000_0018_01C3374F.5842C220 Content-Type: text/xml; name="maven.xml" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="maven.xml" =20 ------=_NextPart_000_0018_01C3374F.5842C220 Content-Type: text/xml; name="project.xml" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="project.xml" 3 commons-configuration commons-configuration 1.0-dev-3.20030607.194155 Apache Software Foundation http://jakarta.apache.org/ /images/jakarta-logo-blue.gif 2001 org.apache.commons.configuration Common ConfigurationTools jakarta Tools to assist in the reading of configuration/preferences files in various formats http://jakarta.apache.org/commons/sandbox/configuration/ = http://nagoya.apache.org/scarab/servlet/scarab/ jakarta.apache.org = /www/jakarta.apache.org/commons/sandbox/configuration/ = /www/jakarta.apache.org/builds/jakarta-commons-san= dbox/ = scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakart= a-commons-sandbox = http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/configuration/= Configuration List commons-dev-subscribe@jakarta.apache.org = commons-dev-unsubscribe@jakarta.apache.org = http://nagoya.apache.org/eyebrowse/SummarizeList?listName=3Dcomm= ons-dev@jakarta.apache.org Daniel Rall dlr dlr@finemaltcoding.com CollabNet, Inc. Jason van Zyl jvanzyl jason@zenplex.com Zenplex Martin Poeschl mpoeschl mpoeschl@marmot.at tucana.at dIon Gillard dion dion@multitask.com.au Multitask Consulting Henning P. Schmiedehausen henning hps@intermeta.de INTERMETA - Gesellschaft fuer Mehrwertdienste = mbH Eric Pugh epugh epugh@upstate.com upstate.com commons-collections 2.1 =20 true =20 commons-lang 1.0.1 =20 true =20 commons-logging 1.0.2 =20 true =20 dom4j 1.3 =20 true =20 commons-digester =20 1.5 =20 true =20 =20 commons-beanutils =20 1.5 =20 true =20 =20 xerces 2.2.1 http://xml.apache.org/xerces2-j/ =20 true =20 xml-apis 2.0.2 http://xml.apache.org/commons/ =20 true =20 commons-dev@jakarta.apache.org src/java src/test **/*Test*.java **/TestBasePropertiesConfiguration.java **/NonStringTestHolder.java conf *.properties conf * ------=_NextPart_000_0018_01C3374F.5842C220 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org ------=_NextPart_000_0018_01C3374F.5842C220--