Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 72601 invoked from network); 9 Apr 2008 18:33:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Apr 2008 18:33:39 -0000 Received: (qmail 84699 invoked by uid 500); 9 Apr 2008 18:33:35 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 84636 invoked by uid 500); 9 Apr 2008 18:33:35 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 84627 invoked by uid 99); 9 Apr 2008 18:33:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2008 11:33:35 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [128.196.133.168] (HELO smtpgate.email.arizona.edu) (128.196.133.168) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2008 18:32:50 +0000 Received: from frodos_amavis (amavis4.email.arizona.edu [10.0.0.207]) by smtpgate.email.arizona.edu (Postfix) with ESMTP id BEF2035A304 for ; Wed, 9 Apr 2008 11:33:00 -0700 (MST) Received: from localhost (brougham.email.arizona.edu [10.0.0.233]) by smtpgate.email.arizona.edu (Postfix) with ESMTP id 3A4DC37DE4A for ; Wed, 9 Apr 2008 11:32:59 -0700 (MST) Received: from zissou.cals.arizona.edu (zissou.cals.arizona.edu [150.135.37.68]) by www.email.arizona.edu (Horde) with HTTP for ; Wed, 9 Apr 2008 11:32:59 -0700 Message-ID: <20080409113259.eg00o8wg8g4ggsg4@www.email.arizona.edu> X-Priority: 3 (Normal) Date: Wed, 9 Apr 2008 11:32:59 -0700 From: lenards@email.arizona.edu To: user@commons.apache.org Subject: Re: Betwixt: BeanReader setup question References: <47F9EC1E.7030308@newsoftwaremarketing.com> <20080407164509.fe1cccc0wgcsswo8@www.email.arizona.edu> <47FB746F.1040803@newsoftwaremarketing.com> <20080408100413.6rj4kg4ssgckwwkg@www.email.arizona.edu> <47FC9243.7090704@newsoftwaremarketing.com> <20080409103807.sz404s0kocok8ocw@www.email.arizona.edu> In-Reply-To: <20080409103807.sz404s0kocok8ocw@www.email.arizona.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.0-cvs X-Virus-Scanned: amavisd-new at email.arizona.edu X-Virus-Checked: Checked by ClamAV on apache.org Nathalie, So I have an example working.... Given the input XML file (me.xml): ---------------------------------- MeElement.java ---------------------------------- public class MeElement { private String id; private String nameA; private String nameC; /* I have getters/setters defined for omitting them here */ } MeElement.betwixt ---------------------------------- Remember that the .betwixt file needs to be in the same directory that your .java file is. Betwixt will pick up both theses files since they're on the classpath together. I'll assume that you have JUnit setup (because we all know that testing is important...even former .NET people like me). So I have a subclass of TestCase with the following method defined: public void testMeDocumentLoad() { try { // this assumes that 'me.xml' is sitting on the classpath InputStream xtnodes = getClass().getResourceAsStream("./me.xml"); BeanReader beanReader = new BeanReader(); beanReader.registerBeanClass(MeElement.class); MeElement root = (MeElement)beanReader.parse(xtnodes); assertNotNull(root); // add further testing to ensure that the bean/pojo has been loaded as expected System.out.println(root); } catch (Exception e) { e.printStackTrace(); System.out.println("exception occured... lame"); } } Betwixt does have log4j capabilities (apparently). I tried to configure it for my unit test but I'm not getting any INFO output. I'm not really too familiar with log4j - so I can't really offer any help. I just was able to confirm that you should be able to get DEBUG/INFO/WARN information about Betwixt via log4j. I hope that helps, Andy /**************************************** * @author: Andrew Lenards * @email: lenards@email.arizona.edu * @title: Systems Programmer, Principal * @project: Tree of Life Web Project * @website: http://tolweb.org/ * @dept: Dept. of Entomology * @school: University of Arizona * @geo-loc: Tucson, AZ 85721 ***************************************/ --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org