Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Development Java (http://www.linux-archive.org/fedora-development-java/)
-   -   New build failure (http://www.linux-archive.org/fedora-development-java/248815-new-build-failure.html)

Orion Poplawski 02-19-2009 04:34 PM

New build failure
 
gridengine 6.2-5 built fine on F-10 back in November
(http://koji.fedoraproject.org/koji/buildinfo?buildID=70140) but now
fails (http://koji.fedoraproject.org/koji/taskinfo?taskID=1140261)


Error is:

[java] compile.test:
[java] [mkdir] Created dir:
/builddir/build/BUILD/gridengine/source/CLASSES/test
[java] [javac] Compiling 18 source files to
/builddir/build/BUILD/gridengine/source/CLASSES/test
[java] [javac]
/builddir/build/BUILD/gridengine/source/libs/jdrmaa/test/DrmaaSuite.java:25:
incompatible types

[java] [javac] found : junit.framework.TestSuite
[java] [javac] required: Test
[java] [javac] return suite;
[java] [javac] ^
[java] [javac] 1 error


The junit versions seems to be the same (3.8.2-4.4.fc10), but java is
newer (1.6.0.0-2b12 -> 1.6.0.0-9.b14).


Source is:

import junit.framework.*;

/**
*
* @author dan.templeton@sun.com
*/
public class DrmaaSuite extends TestCase {

public DrmaaSuite (java.lang.String testName) {
super (testName);
}

/** suite method automatically generated by JUnit module */
public static Test suite () {
TestSuite suite = new TestSuite ("DrmaaSuite");
suite.addTest (org.ggf.drmaa.DrmaaSuite.suite ());
suite.addTest (com.sun.grid.drmaa.DrmaaSuite.suite ());
return suite;
}
}


Help?

--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion@cora.nwra.com
Boulder, CO 80301 http://www.cora.nwra.com

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list

Deepak Bhole 02-19-2009 09:53 PM

New build failure
 
* Orion Poplawski <orion@cora.nwra.com> [2009-02-19 12:36]:
> gridengine 6.2-5 built fine on F-10 back in November
> (http://koji.fedoraproject.org/koji/buildinfo?buildID=70140) but now fails
> (http://koji.fedoraproject.org/koji/taskinfo?taskID=1140261)
>
> Error is:
>
> [java] compile.test:
> [java] [mkdir] Created dir:
> /builddir/build/BUILD/gridengine/source/CLASSES/test
> [java] [javac] Compiling 18 source files to
> /builddir/build/BUILD/gridengine/source/CLASSES/test
> [java] [javac]
> /builddir/build/BUILD/gridengine/source/libs/jdrmaa/test/DrmaaSuite.java:25:
> incompatible types
> [java] [javac] found : junit.framework.TestSuite
> [java] [javac] required: Test
> [java] [javac] return suite;
> [java] [javac] ^
> [java] [javac] 1 error
>
>
> The junit versions seems to be the same (3.8.2-4.4.fc10), but java is newer
> (1.6.0.0-2b12 -> 1.6.0.0-9.b14).
>

Took a bit of digging, but found the problem. The issue is that wrong
classes are being seen by the compiler.

junit.framework.TestSuite implements the interface junit.framework.Test.
This worked before with the code below because the only "Test" seen by
the compiler before was from junit.framework.*.

However, F10 now has rhino 1.7, which has a "Test" class as well (with
no package hierarchy). Rhino ends up in the classpath during compile,
and the compiler chooses it's Test class, which is not the interface
implemented by junit.framework.TestSuite. This is why it is best
practice to import full paths rather than .* . The correct fix here is to
patch DrmaaSuite.java to remove the junit.framework.* import and add:

import junit.framework.TestSuite;
import junit.framework.TestCase;
import junit.framework.Test;

Alternatively, you can also patch it for a not-so-perfect fix: change
'public static Test suite ()' to 'public static junit.framework.Test suite ()'

Cheers,
Deepak

> Source is:
>
> import junit.framework.*;
>
> /**
> *
> * @author dan.templeton@sun.com
> */
> public class DrmaaSuite extends TestCase {
>
> public DrmaaSuite (java.lang.String testName) {
> super (testName);
> }
>
> /** suite method automatically generated by JUnit module */
> public static Test suite () {
> TestSuite suite = new TestSuite ("DrmaaSuite");
> suite.addTest (org.ggf.drmaa.DrmaaSuite.suite ());
> suite.addTest (com.sun.grid.drmaa.DrmaaSuite.suite ());
> return suite;
> }
> }
>
>
> Help?
>
> --
> Orion Poplawski
> Technical Manager 303-415-9701 x222
> NWRA/CoRA Division FAX: 303-415-9702
> 3380 Mitchell Lane orion@cora.nwra.com
> Boulder, CO 80301 http://www.cora.nwra.com
>
> --
> fedora-devel-java-list mailing list
> fedora-devel-java-list@redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-devel-java-list

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list

Orion Poplawski 02-19-2009 10:35 PM

New build failure
 
Deepak Bhole wrote:


Took a bit of digging, but found the problem. The issue is that wrong
classes are being seen by the compiler.

junit.framework.TestSuite implements the interface junit.framework.Test.
This worked before with the code below because the only "Test" seen by
the compiler before was from junit.framework.*.


However, F10 now has rhino 1.7, which has a "Test" class as well (with
no package hierarchy). Rhino ends up in the classpath during compile,
and the compiler chooses it's Test class, which is not the interface
implemented by junit.framework.TestSuite. This is why it is best
practice to import full paths rather than .* . The correct fix here is to
patch DrmaaSuite.java to remove the junit.framework.* import and add:

import junit.framework.TestSuite;
import junit.framework.TestCase;
import junit.framework.Test;


Excellent! Thank you! Bug filed upstream....


--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion@cora.nwra.com
Boulder, CO 80301 http://www.cora.nwra.com

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list

Andrew Overholt 02-20-2009 12:14 PM

New build failure
 
* Deepak Bhole <dbhole@redhat.com> [2009-02-19 17:53]:
>
> However, F10 now has rhino 1.7, which has a "Test" class as well (with
> no package hierarchy). Rhino ends up in the classpath during compile,

This is the real bug, though, right?

Thanks for tracking this down!

Andrew

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list

Deepak Bhole 02-20-2009 01:18 PM

New build failure
 
* Andrew Overholt <overholt@redhat.com> [2009-02-20 08:14]:
> * Deepak Bhole <dbhole@redhat.com> [2009-02-19 17:53]:
> >
> > However, F10 now has rhino 1.7, which has a "Test" class as well (with
> > no package hierarchy). Rhino ends up in the classpath during compile,
>
> This is the real bug, though, right?
>

It is a bug in gridengine code. Rhino is not doing wrong by having a
Test.class in it's jar...

Cheers,
Deepak

> Thanks for tracking this down!
>
> Andrew

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list


All times are GMT. The time now is 06:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.