Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 51082 - Junit tests fail when emerging dev-java/commons-lang
Summary: Junit tests fail when emerging dev-java/commons-lang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High minor
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-14 12:51 UTC by Keith Burch
Modified: 2004-05-18 21:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for updating ebuild to fix issue (commons-lang-2.0-r1.ebuild.diff,418 bytes, patch)
2004-05-14 16:07 UTC, Keith Burch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Burch 2004-05-14 12:51:48 UTC
When emerging dev-java/commons-lang-2.0-r1 with the 'junit' USE flag set, the build failed because the junit library was not set correctly during the build


Reproducible: Always
Steps to Reproduce:
1. Set the junit USE flag
2. emerge dev-java/commons-lang-2.0-r1  (this may have been present in the previous versions)
3. During the test phase, the build fails with the output shown below.

Actual Results:  
The ebuild failed with the following output:
Buildfile: build.xml

init:
     [echo] -------- commons-lang 2.0 --------

prepare:
    [mkdir] Created dir:
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/target
    [mkdir] Created dir:
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/target/classes
    [mkdir] Created dir:
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/target/conf
    [mkdir] Created dir:
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/target/tests

static:
     [copy] Copying 1 file to
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/target/conf
     [copy] Replacing: @name@ -> commons-lang
     [copy] Replacing: @version@ -> 2.0

compile:
    [javac] Compiling 57 source files to
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/target/classes
     [copy] Copying 7 files to
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/target/classes

jar:
    [mkdir] Created dir:
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/dist
    [mkdir] Created dir:
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/target/classes/META-INF
     [copy] Copying 1 file to
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/target/classes/META-INF
      [jar] Building jar:
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/dist/commons-lang-2.0.jar

init:
     [echo] -------- commons-lang 2.0 --------

prepare:

static:

compile:

compile.tests:
    [javac] Compiling 83 source files to
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/target/tests
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -deprecation for details.

test.lang:
     [echo] Running lang package tests ...
     [java] Exception in thread "main" java.lang.NoClassDefFoundError:
junit/textui/TestRunner



BUILD FAILED
/var/tmp/portage/commons-lang-2.0-r1/work/commons-lang-2.0-src/build.xml:134:
Java returned: 1

Total time: 8 seconds



Expected Results:  
Finished the execution of the unit tests for the software.

Portage 2.0.50-r6 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.6-rc1)
=================================================================
System uname: 2.6.6-rc1 i686 AMD Athlon(tm) XP 3200+
Gentoo Base System version 1.4.10
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer -mfpmath=sse -msse -mmmx
-m3dnow"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer -mfpmath=sse -msse
-mmmx -m3dnow"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://open-systems.ufl.edu/mirrors/gentoo
ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo rsync://mirrors.tds.net/gentoo
http://gentoo.mirrors.pair.com/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X X509 alsa antlr avi bcel berkdb cdr crypt cups dvd dvdr encode
foomaticdb gdbm gif gimpprint gtk gtk2 imap imlib imlib2 java javamail jpeg
junit libg++ libwww log4j mad mikmod mmx motif moznocompose moznoirc moznomail
mozxmlterm mpeg ncurses nls offensive oggvorbis opengl oss pam pdflib png ppds
python quicktime readline regexp sdl slang spell sse ssl svga tcltk tcpd tiff
transcode truetype unicode usb wxwindows x86 xerces xface xml2 xmms xv zlib"
Comment 1 Keith Burch 2004-05-14 13:00:44 UTC
There are two workarounds which I found fixed this problem, the second could be used to fix the issue long term.

1- Remove junit USE flag prior to emerging the ebuild.

2- Perform the following after the source is unpacked and prior to compilation:
 echo junit.jar=`java-config -p junit` >build.properties

this will put the proper junit library into the variable used for setting the classpath prior to running the test.
Comment 2 Keith Burch 2004-05-14 16:07:31 UTC
Created attachment 31442 [details, diff]
patch for updating ebuild to fix issue

I created this patch based on the changes to the commons-cli ebuild which
performs a similar action
Comment 3 Chris Aniszczyk (RETIRED) gentoo-dev 2004-05-18 21:24:21 UTC
Thanks, fixed in portage.