ant test supposed to work?

In building other java applications, I'm used to checking that the build is sane by invoking 'ant test'. This fails for me with mkgmap. Is this a known problem, or something I can fix? /Simon jas@mocca:~/src/mkgmap$ ant Buildfile: build.xml prepare: [mkdir] Created dir: /home/jas/src/mkgmap/build/classes compile: [javac] Compiling 271 source files to /home/jas/src/mkgmap/build/classes [javac] Note: /home/jas/src/mkgmap/src/uk/me/parabola/mkgmap/general/RoadNetwork.java uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. build: [copy] Copying 35 files to /home/jas/src/mkgmap/build/classes dist: [mkdir] Created dir: /home/jas/src/mkgmap/dist [mkdir] Created dir: /home/jas/src/mkgmap/dist/doc/api [jar] Building jar: /home/jas/src/mkgmap/dist/mkgmap.jar [copy] Copying 8 files to /home/jas/src/mkgmap/dist/doc [copy] Copying 34 files to /home/jas/src/mkgmap/dist BUILD SUCCESSFUL Total time: 3 seconds jas@mocca:~/src/mkgmap$ ant test Buildfile: build.xml prepare: compile: build: build-test: [mkdir] Created dir: /home/jas/src/mkgmap/build/test [javac] Compiling 28 source files to /home/jas/src/mkgmap/build/test [javac] /home/jas/src/mkgmap/test/func/lib/RangeMatcher.java:16: package org.hamcrest does not exist [javac] import org.hamcrest.BaseMatcher; [javac] ^ [javac] /home/jas/src/mkgmap/test/func/lib/RangeMatcher.java:17: package org.hamcrest does not exist [javac] import org.hamcrest.Description; [javac] ^ [javac] /home/jas/src/mkgmap/test/func/lib/RangeMatcher.java:26: cannot find symbol [javac] symbol: class BaseMatcher [javac] public class RangeMatcher extends BaseMatcher<Integer> { [javac] ^ [javac] /home/jas/src/mkgmap/test/func/lib/RangeMatcher.java:46: cannot find symbol [javac] symbol : class Description [javac] location: class func.lib.RangeMatcher [javac] public void describeTo(Description description) { [javac] ^ [javac] /home/jas/src/mkgmap/test/func/SimpleTest.java:70: cannot access org.hamcrest.Matcher [javac] class file for org.hamcrest.Matcher not found [javac] assertThat("RGN size", size, new RangeMatcher(138300)); [javac] ^ [javac] /home/jas/src/mkgmap/test/func/SimpleTest.java:108: cannot find symbol [javac] symbol : method assertThat(java.lang.String,int,func.lib.RangeMatcher) [javac] location: class func.SimpleTest [javac] assertThat("RGN size", size, new RangeMatcher(2762)); [javac] ^ [javac] /home/jas/src/mkgmap/test/func/route/SimpleRoute.java:56: cannot find symbol [javac] symbol : method assertThat(java.lang.String,int,func.lib.RangeMatcher) [javac] location: class func.route.SimpleRoute [javac] assertThat("RGN size", size, new RangeMatcher(141999)); [javac] ^ [javac] /home/jas/src/mkgmap/test/func/route/SimpleRoute.java:84: cannot find symbol [javac] symbol : method assertThat(java.lang.String,int,func.lib.RangeMatcher) [javac] location: class func.route.SimpleRoute [javac] assertThat("RGN size", size, new RangeMatcher(2787)); [javac] ^ [javac] 8 errors BUILD FAILED /home/jas/src/mkgmap/build.xml:100: Compile failed; see the compiler error output for details. Total time: 1 second jas@mocca:~/src/mkgmap$

Hi On 25/08/09 23:18, Simon Josefsson wrote:
In building other java applications, I'm used to checking that the build is sane by invoking 'ant test'. This fails for me with mkgmap. Is this a known problem, or something I can fix?
You need to have junit in you classpath (or edit build.xml or external.properties appropriately). Version 4.5 or later is needed. Regards, ..Steve

Steve Ratcliffe <steve@parabola.me.uk> writes:
Hi
On 25/08/09 23:18, Simon Josefsson wrote:
In building other java applications, I'm used to checking that the build is sane by invoking 'ant test'. This fails for me with mkgmap. Is this a known problem, or something I can fix?
You need to have junit in you classpath (or edit build.xml or external.properties appropriately). Version 4.5 or later is needed.
Actually the problem was the org.hamcrest package. If anyone else runs into the same, I solved it by installing the "libhamcrest-java" debian package and then fixing up the installation like this: mocca:/usr/share/ant/lib# ln -s ../../java/hamcrest-core.jar . Possibly the debian package should have added the symlink, other java packages have symlinks in that directory. /Simon

Hi
Actually the problem was the org.hamcrest package. If anyone else runs into the same, I solved it by installing the "libhamcrest-java" debian package and then fixing up the installation like this:
That is strange, those classes are in my junit-4.5.jar and I thought that it was directly downloaded as that is what I always do - I know that they are not in the source jar though. ..Steve

Steve Ratcliffe <steve@parabola.me.uk> writes:
Hi
Actually the problem was the org.hamcrest package. If anyone else runs into the same, I solved it by installing the "libhamcrest-java" debian package and then fixing up the installation like this:
That is strange, those classes are in my junit-4.5.jar and I thought that it was directly downloaded as that is what I always do - I know that they are not in the source jar though.
It seems that Debian's junit4.jar package (junit4 4.7-2) does not contain the org.hamcrest symbols, but they are indeed part of junit upstreams JAR files. There is a README.Debian file explaining that to use junit4 with ant in debian, I need to manually modify the build.xml file to specifically reference junit4.jar. Sigh. /Simon
participants (2)
-
Simon Josefsson
-
Steve Ratcliffe