Return-Path: Delivered-To: apmail-incubator-abdera-dev-archive@locus.apache.org Received: (qmail 36510 invoked from network); 17 Jun 2006 00:40:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jun 2006 00:40:06 -0000 Received: (qmail 54994 invoked by uid 500); 17 Jun 2006 00:40:06 -0000 Delivered-To: apmail-incubator-abdera-dev-archive@incubator.apache.org Received: (qmail 54972 invoked by uid 500); 17 Jun 2006 00:40:06 -0000 Mailing-List: contact abdera-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: abdera-dev@incubator.apache.org Delivered-To: mailing list abdera-dev@incubator.apache.org Received: (qmail 54963 invoked by uid 99); 17 Jun 2006 00:40:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 17:40:06 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of stephen.duncan@gmail.com designates 66.249.92.173 as permitted sender) Received: from [66.249.92.173] (HELO ug-out-1314.google.com) (66.249.92.173) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2006 17:40:04 -0700 Received: by ug-out-1314.google.com with SMTP id q2so1866771uge for ; Fri, 16 Jun 2006 17:39:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=YKikaRWGNCeLJnppcAgsP94wdpoXhEb5Fpm3QeRdlnYcz/KXh6Lhn25i/gokXcl84HrXLr5Yzxnuqj9HR+D6qC7qKCyeTd14i1+UbsguJHaT7K/zC7OKZY1j88PRCP6tkxeHIVIbvHMFtklcVpvrvQ3eS6ODcgbF35kx+PDh4eg= Received: by 10.78.52.17 with SMTP id z17mr1263683huz; Fri, 16 Jun 2006 17:39:42 -0700 (PDT) Received: by 10.78.53.20 with HTTP; Fri, 16 Jun 2006 17:39:42 -0700 (PDT) Message-ID: Date: Fri, 16 Jun 2006 20:39:42 -0400 From: "Stephen Duncan" To: abdera-dev@incubator.apache.org Subject: Re: Unit Tests in Maven In-Reply-To: <44934C01.4040102@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <44933A14.9000309@gmail.com> <44934C01.4040102@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Ok. I just found where it does exist in ibiblio. So no problems there. The dependency should be: woodstox wstx-asl 2.0.5 runtime However, I just noticed that the tests only run properly if I compile with Eclipse. If I compile with Maven, then NullPointerExceptions are thrown: ------------------------------------------------------------------------------- Test set: org.apache.abdera.test.parser.stax.FOMTest ------------------------------------------------------------------------------- Tests run: 7, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 0.102 sec <<< FAILURE! testParser(org.apache.abdera.test.parser.stax.FOMTest) Time elapsed: 0.001 sec <<< ERROR! org.apache.abdera.parser.ParseException: java.lang.NullPointerException at org.apache.abdera.parser.stax.FOMParser.parse(FOMParser.java:56) at org.apache.abdera.util.AbstractParser.parse(AbstractParser.java:40) at org.apache.abdera.test.parser.stax.FOMTest.testParser(FOMTest.java:51) testWhiteListParseFilter(org.apache.abdera.test.parser.stax.FOMTest) Time elapsed: 0.002 sec <<< ERROR! java.lang.NullPointerException at org.apache.abdera.test.parser.stax.FOMTest.testWhiteListParseFilter(FOMTest.java:122) testBlackListParseFilter(org.apache.abdera.test.parser.stax.FOMTest) Time elapsed: 0.001 sec <<< ERROR! java.lang.NullPointerException at org.apache.abdera.test.parser.stax.FOMTest.testBlackListParseFilter(FOMTest.java:153) testTextFilter(org.apache.abdera.test.parser.stax.FOMTest) Time elapsed: 0.001 sec <<< ERROR! java.lang.NullPointerException at org.apache.abdera.test.parser.stax.FOMTest.testTextFilter(FOMTest.java:198) testXPath(org.apache.abdera.test.parser.stax.FOMTest) Time elapsed: 0.002 sec <<< ERROR! org.apache.abdera.parser.ParseException: java.lang.NullPointerException at org.apache.abdera.parser.stax.FOMParser.parse(FOMParser.java:56) at org.apache.abdera.util.AbstractParser.parse(AbstractParser.java:40) at org.apache.abdera.test.parser.stax.FOMTest.testXPath(FOMTest.java:224) Any ideas on what might cause that? -Stephen On 6/16/06, James M Snell wrote: > Yes, that's the version we need. Eventually, I would much prefer to get > away from Woodstox completely. If there are other Stax implementations > available with compatible licenses, we should explore those as well. > > I'm looking into the class cast exception. > > - James > > Stephen Duncan wrote: > > "If that's the case" -> "If this jar is the one we must use" > > > > -Stephen > > > > On 6/16/06, Stephen Duncan wrote: > >> Ok, I guess the wstx jar in the Maven repository isn't the right > >> version, or doesn't have enough. > >> > >> I installed the one downloaded by the ant build with the following > >> command (within the dependencies directory): > >> > >> mvn install:install-file -DgroupId=wstx -DartifactId=wstx-asl > >> -Dversion=2.0.5 -Dpackaging=jar -Dfile=wstx-asl-2.0.5.jar > >> > >> Then modified the dependency to be: > >> > >> > >> wstx > >> wstx-asl > >> 2.0.5 > >> runtime > >> > >> > >> And am now down to the one class cast exception: > >> > >> org.apache.axiom.om.OMException: java.lang.ClassCastException: > >> org.apache.abdera.parser.stax.FOMDocument > >> at > >> org.apache.abdera.parser.stax.FOMBuilder.next(FOMBuilder.java:315) > >> at > >> org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:552) > >> > >> at > >> org.apache.axiom.om.impl.llom.OMElementImpl.getFirstOMChild(OMElementImpl.java:562) > >> > >> at > >> org.apache.axiom.om.impl.llom.OMElementImpl.getFirstChildWithName(OMElementImpl.java:218) > >> > >> at > >> org.apache.abdera.parser.stax.FOMElement.getTextElement(FOMElement.java:368) > >> > >> at > >> org.apache.abdera.parser.stax.FOMElement.getText(FOMElement.java:433) > >> at > >> org.apache.abdera.parser.stax.FOMSource.getTitle(FOMSource.java:417) > >> at > >> org.apache.abdera.test.parser.stax.FOMTest.testTextFilter(FOMTest.java:202) > >> > >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > >> at > >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > >> > >> at > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > >> > >> at java.lang.reflect.Method.invoke(Method.java:585) > >> at junit.framework.TestCase.runTest(TestCase.java:164) > >> at junit.framework.TestCase.runBare(TestCase.java:130) > >> at junit.framework.TestResult$1.protect(TestResult.java:106) > >> at junit.framework.TestResult.runProtected(TestResult.java:124) > >> at junit.framework.TestResult.run(TestResult.java:109) > >> at junit.framework.TestCase.run(TestCase.java:120) > >> at junit.framework.TestSuite.runTest(TestSuite.java:230) > >> at junit.framework.TestSuite.run(TestSuite.java:225) > >> at > >> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) > >> > >> at > >> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > >> > >> at > >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > >> > >> at > >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > >> > >> at > >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > >> > >> at > >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > >> > >> Caused by: java.lang.ClassCastException: > >> org.apache.abdera.parser.stax.FOMDocument > >> at > >> org.apache.abdera.test.parser.stax.FOMTest$1.filterText(FOMTest.java:184) > >> at > >> org.apache.abdera.parser.stax.FOMBuilder.applyTextFilter(FOMBuilder.java:219) > >> > >> at > >> org.apache.abdera.parser.stax.FOMBuilder.next(FOMBuilder.java:281) > >> ... 25 more > >> > >> If that's the case, we need to look into trying to get the > >> wstx-asl-2.0.5.jar into the Maven repository. > >> > >> -Stephen > >> > >> > >> On 6/16/06, Stephen Duncan wrote: > >> > I tried adding a runtime dependency on wstx (assuming that's woodstox): > >> > > >> > > >> > wstx > >> > wstx > >> > 1.0 > >> > runtime > >> > > >> > > >> > but I got a TON of new errors. Could you try adding that to the > >> > parser pom.xml dependencies, running it, and see if you understand > >> > what might be going on? > >> > > >> > I assume all this is caused by magic decisions on which xml library to > >> > use based on availability? > >> > > >> > -Stephen > >> > > >> > On 6/16/06, James M Snell wrote: > >> > > Two pieces: Axiom and Stax (axiom-impl, axiom-api, stax, woodstox). > >> > > Woodstox won't show up in the build dependency graph but is > >> required at > >> > > run time. > >> > > > >> > > - James > >> > > > >> > > Stephen Duncan wrote: > >> > > > Here's the dependency graph reported by Maven (from the site > >> generated > >> > > > when running "mv n site". The first level (stax, etc.) are direct > >> > > > dependencies, levels below that are transitive dependencies. > >> > > > > >> > > > * org.apache.abdera:abdera-parser:jar > >> > > > o stax:stax-api:jar > >> > > > o stax:stax:jar > >> > > > o ws-commons:axiom-impl:jar > >> > > > o junit:junit:jar > >> > > > o jaxen:jaxen:jar > >> > > > + dom4j:dom4j:jar > >> > > > # pull-parser:pull-parser:jar > >> > > > # jaxme:jaxme-api:jar > >> > > > # xml-apis:xml-apis:jar > >> > > > # msv:xsdlib:jar > >> > > > # xpp3:xpp3:jar > >> > > > + jdom:jdom:jar > >> > > > + xom:xom:jar > >> > > > # org.ccil.cowan.tagsoup:tagsoup:jar > >> > > > # xalan:xalan:jar > >> > > > # com.ibm.icu:icu4j:jar > >> > > > + xerces:xmlParserAPIs:jar > >> > > > + xerces:xercesImpl:jar > >> > > > o org.apache.abdera:abdera-core:jar > >> > > > + geronimo:geronimo-activation:jar > >> > > > # > >> > > > org.apache.geronimo.specs:geronimo-activation_1.0.2_spec:jar > >> > > > # > >> > > > org.apache.geronimo.specs:geronimo-javamail_1.3.1_spec:jar > >> > > > # > >> commons-jelly:commons-jelly-tags-velocity:jar > >> > > > # velocity:velocity:jar > >> > > > * velocity:velocity-dep:jar > >> > > > o commons-logging:commons-logging:jar > >> > > > o ws-commons:axiom-api:jar > >> > > > > >> > > > And here's the chart of the transitive dependencies including > >> versions > >> > > > (sorry for the formatting): > >> > > > > >> > > > compile > >> > > > > >> > > > The following is a list of compile dependencies for this project. > >> > > > These dependencies are required to compile and run the application: > >> > > > GroupId ArtifactId Version Classifier Type Optional > >> > > > com.ibm.icu icu4j 2.6.1 - jar > >> > > > commons-jelly commons-jelly-tags-velocity 1.0 - jar > >> > > > dom4j dom4j 1.5.2 - jar > >> > > > geronimo geronimo-activation 1.0 - jar > >> > > > jaxme jaxme-api 0.3 - jar > >> > > > jdom jdom 1.0 - jar > >> > > > msv xsdlib 20030807 - jar > >> > > > org.apache.geronimo.specs geronimo-activation_1.0.2_spec 1.0 > >> > > > - jar > >> > > > org.apache.geronimo.specs geronimo-javamail_1.3.1_spec > >> 1.0 - > >> > > > jar > >> > > > org.ccil.cowan.tagsoup tagsoup 0.9.7 - jar > >> > > > pull-parser pull-parser 2 - jar > >> > > > velocity velocity 1.4 - jar > >> > > > xalan xalan 2.6.0 - jar > >> > > > xerces xercesImpl 2.8.0 - jar > >> > > > xerces xmlParserAPIs 2.6.2 - jar > >> > > > xml-apis xml-apis 1.0.b2 - jar > >> > > > xom xom 1.0b3 - jar > >> > > > xpp3 xpp3 1.1.3.3 - jar > >> > > > runtime > >> > > > > >> > > > The following is a list of runtime dependencies for this project. > >> > > > These dependencies are required to run the application: > >> > > > GroupId ArtifactId Version Classifier Type Optional > >> > > > velocity velocity-dep 1.4 - jar > >> > > > > >> > > > Any ideas on what I should look at as being responsible for the > >> > > > different XML output? > >> > > > > >> > > > -Stephen > >> > > > > >> > > > On 6/16/06, Stephen Duncan wrote: > >> > > >> There seem to now be two failures. When I first checked out > >> the code, > >> > > >> there were some null pointer exceptions (consistent with a > >> snapshot > >> > > >> from James' website that I was troubleshooting & posting on his > >> > > >> blog), but after updating again to the latest, those went away... > >> > > >> > >> > > >> WIth the Ant build not running the tests, I don't have anything to > >> > > >> compare to to see what is Maven's fault. > >> > > >> > >> > > >> Here are the failures. THe first one has happened for a while: > >> spaces > >> > > >> are included in the output, but weren't when using Ant. Most > >> likely > >> > > >> I'll have to analyze what dependencies are different in Maven from > >> > > >> Ant. Note that when running the tests in Eclipse (set up using > >> > > >> Maven), these same failures still happen. The second error > >> > > >> (ClassCastException) is new... > >> > > >> > >> > > >> -Stephen > >> > > >> > >> > > >> > >> ------------------------------------------------------------------------------- > >> > >> > > >> > >> > > >> Test set: org.apache.abdera.test.parser.stax.FOMTest > >> > > >> > >> ------------------------------------------------------------------------------- > >> > >> > > >> > >> > > >> Tests run: 7, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: > >> 0.196 > >> > > >> sec <<< FAILURE! > >> > > >> testCreate(org.apache.abdera.test.parser.stax.FOMTest) Time > >> elapsed: > >> > > >> 0.023 sec <<< FAILURE! > >> > > >> junit.framework.ComparisonFailure: > >> > > >> expected:<...http://example.org/"[/>John > >> > > >> > >> Doeurn:uuid:60a76c80-d399-11d9-b93C-0003939e0 > >> > > >> af6Bob > >> > > >> Jones >> > > >> term="example"/>re: Atom-Powered > >> Robots > >> > > >> Run Amok >> > > >> e> >> > > >> > >> href="/2003/12/13/atom03/1"/>urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5b >> > >> > > >> > >> > > >> type="text">A response >> > > >> thr="http://purl.org/syndication/thread/1.0" > >> > > >> href="http://example.org/2003/12/13/atom03" > >> > > >> > >> ref="urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"/> >> > >> > > >> > >> > > >> itle type="text">Atom-Powered Robots Run Amok >> > > >> > >> href="http://example.org/2003/12/13/atom03"]/>urn:uuid:122...> > >> > > >> but was:<...http://example.org/"[ > >> > > >> />John > >> > > >> > >> Doeurn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6Bob > >> > >> > > >> > >> > > >> Jones< > >> > > >> a:category term="example" />re: > >> > > >> Atom-Powered Robots Run Amok >> > > >> href="/2003/12/13/atom03/1" />urn:uuid:1225c695-cfb > >> > > >> 8-4ebb-aaaa-80cb323feb5bA > >> > > >> response >> > > >> xmlns:thr="http://purl.org/syndication/thread/1.0" > >> > > >> href="http://example. > >> > > >> org/2003/12/13/atom03" > >> > > >> ref="urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a" > >> > > >> />Atom-Powered Robots Run > >> > > >> Amok >> > > >> ef="http://example.org/2003/12/13/atom03" > >> ]/>urn:uuid:122...> > >> > > >> at junit.framework.Assert.assertEquals(Assert.java:81) > >> > > >> at junit.framework.Assert.assertEquals(Assert.java:87) > >> > > >> at > >> > > >> > >> org.apache.abdera.test.parser.stax.FOMTest.testCreate(FOMTest.java:104) > >> > > >> > >> > > >> testTextFilter(org.apache.abdera.test.parser.stax.FOMTest) Time > >> > > >> elapsed: 0.003 sec <<< ERROR! > >> > > >> org.apache.axiom.om.OMException: java.lang.ClassCastException: > >> > > >> org.apache.abdera.parser.stax.FOMDocument > >> > > >> at > >> > > >> org.apache.abdera.parser.stax.FOMBuilder.next(FOMBuilder.java:315) > >> > > >> at > >> > > >> > >> org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:552) > >> > >> > > >> > >> > > >> at > >> > > >> > >> org.apache.axiom.om.impl.llom.OMElementImpl.getFirstOMChild(OMElementImpl.java:562) > >> > >> > > >> > >> > > >> at > >> > > >> > >> org.apache.axiom.om.impl.llom.OMElementImpl.getFirstChildWithName(OMElementImpl.java:218) > >> > >> > > >> > >> > > >> at > >> > > >> > >> org.apache.abdera.parser.stax.FOMElement.getTextElement(FOMElement.java:368) > >> > >> > > >> > >> > > >> at > >> > > >> > >> org.apache.abdera.parser.stax.FOMElement.getText(FOMElement.java:433) > >> > > >> at > >> > > >> > >> org.apache.abdera.parser.stax.FOMSource.getTitle(FOMSource.java:417) > >> > > >> > >> > > >> > >> > > >> -- > >> > > >> Stephen Duncan Jr > >> > > >> www.stephenduncanjr.com > >> > > >> > >> > > > > >> > > > > >> > > > >> > > >> > > >> > -- > >> > Stephen Duncan Jr > >> > www.stephenduncanjr.com > >> > > >> > >> > >> -- > >> Stephen Duncan Jr > >> www.stephenduncanjr.com > >> > > > > > -- Stephen Duncan Jr www.stephenduncanjr.com