You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Sean Qiu <se...@gmail.com> on 2007/02/01 04:55:08 UTC

[test] Problem encoutered when running eclipse's unit test with harmony

Hi , everybody

I am trying to run unit tests of the latest eclipse whose version is
3.2.1with harmony classlib and IBM J9 VM.
But i encountered some problems when run the tests in package of
org.eclipse.jdt.core.tests.compiler.regression.

All the failing test's message seem similar who all contains this sentence:
The type java.lang.Object cannot be resolved. It is indirectly referenced
from required .class files

At first, i thought it may be because that eclipse could not recognize our
harmony's JRE, so i added the plugin
org.apache.harmony.eclipse.jdt.launching_1.0.2.jar before testing.
But it was good-for-nothing.

I find someone had successuflly run these tests with DRLVM, is there any
further configuration???
Have you ever encountered the similar problem??

Thanks very much.



Here is one of the error full message
===============================
Invalid problem log . ----------- Expected ------------ ----------\n 1.
ERROR in X.java (at line 3)\n * @see <a href="spec.html#section">Java
Spec<a>\n ^^^\n Javadoc: Malformed link reference\n ----------\n
------------ but was ------------ ----------\n 1. ERROR in X.java (at line
1)\n public class X {\n ^\n The type java.lang.Object cannot be resolved. It
is indirectly referenced from required .class files\n ----------\n 2. ERROR
in X.java (at line 3)\n * @see <a href="spec.html#section">Java Spec<a>\n
^^^\n Javadoc: Malformed link reference\n ----------\n --------- Difference
is ---------- expected:<......> but was:<...1)\n public class X {\n ^\n The
type java.lang.Object cannot be resolved. It is indirectly referenced from
required .class files\n ----------\n 2. ERROR in X.java (at line ...>

junit.framework.ComparisonFailure: Invalid problem log .
----------- Expected ------------
----------\n
1. ERROR in X.java (at line 3)\n
* @see <a href="spec.html#section">Java Spec<a>\n
^^^\n
Javadoc: Malformed link reference\n
----------\n

------------ but was ------------
----------\n
1. ERROR in X.java (at line 1)\n
public class X {\n
^\n
The type java.lang.Object cannot be resolved. It is indirectly referenced
from required .class files\n
----------\n
2. ERROR in X.java (at line 3)\n
* @see <a href="spec.html#section">Java Spec<a>\n
^^^\n
Javadoc: Malformed link reference\n
----------\n

--------- Difference is ----------
expected:<......> but was:<...1)\n
public class X {\n
^\n
The type java.lang.Object cannot be resolved. It is indirectly referenced
from required .class files\n
----------\n
2. ERROR in X.java (at line ...>
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(
TestCase.java:28)
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(
TestCase.java:189)
at
org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest
(AbstractRegressionTest.java:687)
at
org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest
(AbstractRegressionTest.java:569)
at
org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest
(AbstractRegressionTest.java:548)
at
org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBug73479(
JavadocBugsTest.java:2993)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestDecorator.run(TestDecorator.java:28)
at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
CompilerTestSetup.java:48)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:330)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:24)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java
:35)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
PlatformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java
:40)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java
:177)
at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:213)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)
0.016
testBug73995 - 1.3 Failure Unexpected problems: ---------- 1. ERROR in
X.java (at line 1) public class X { ^ The type java.lang.Object cannot be
resolved. It is indirectly referenced from required .class files ----------

junit.framework.AssertionFailedError: Unexpected problems: ----------
1. ERROR in X.java (at line 1)
public class X {
^
The type java.lang.Object cannot be resolved. It is indirectly referenced
from required .class files
----------

at
org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runConformTest
(AbstractRegressionTest.java:463)
at
org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runConformTest
(AbstractRegressionTest.java:279)
at
org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBug73995(
JavadocBugsTest.java:317)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestDecorator.run(TestDecorator.java:28)
at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
CompilerTestSetup.java:48)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:330)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:24)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java
:35)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
PlatformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java
:40)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java
:177)
at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:213)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)

-- 
Sean Qiu

Re: [test] Problem encoutered when running eclipse's unit test with harmony

Posted by Sean Qiu <se...@gmail.com>.
I had reported this issue to eclipse's bugzilla, but there is still no
response.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=172820

IMHO, the solution that dertermines the location of classlib according to
the java.vm.name property is not appropriate.
For there exist vmes whose names are same while their relative classlib may
be placed in different location, like j9
What's more, our classlib's goal is to support more than just one kind of
VM, so our classlib's location is fixed regardless of the vm name.

2007/2/5, Sean Qiu <se...@gmail.com>:
>
> I will try to report this issue to eclipse's mailing list.
> And I will post their response here if any.
>
> 2007/2/5, Geir Magnusson Jr. <geir@pobox.com >:
> >
> > Did anyone report this to Eclipse?  Seems like there must be a more
> > elegant way for that test to figure out where to find the classes, or
> > at least we can get our patch in there too :)
> >
> > geir
> >
> > On Feb 1, 2007, at 11:05 AM, Sean Qiu wrote:
> >
> > > It is so helpful.
> > > Thanks very much! :)
> > >
> > >
> > > 2007/2/1, Nina Rinskaya <ni...@gmail.com>:
> > >>
> > >> On 2/1/07, Sean Qiu < sean.xx.qiu@gmail.com> wrote:
> > >> > Hi , everybody
> > >> >
> > >> > I am trying to run unit tests of the latest eclipse whose
> > >> version is
> > >> > 3.2.1with harmony classlib and IBM J9 VM.
> > >> > But i encountered some problems when run the tests in package of
> > >> > org.eclipse.jdt.core.tests.compiler.regression.
> > >> >
> > >> > All the failing test's message seem similar who all contains this
> > >> sentence:
> > >> > The type java.lang.Object cannot be resolved. It is indirectly
> > >> referenced
> > >> > from required .class files
> > >> >
> > >> > At first, i thought it may be because that eclipse could not
> > >> recognize
> > >> our
> > >> > harmony's JRE, so i added the plugin
> > >> > org.apache.harmony.eclipse.jdt.launching_1.0.2.jar before testing.
> > >> > But it was good-for-nothing.
> > >> >
> > >> > I find someone had successuflly run these tests with DRLVM, is
> > >> there any
> > >> > further configuration???
> > >> > Have you ever encountered the similar problem??
> > >> >
> > >>
> > >> I run Eclipse Unit Tests on DRLVM and yes, I did encounter the same
> > >> issue. It is caused by hard-coded class libraries names in
> > >> org/eclipse/jdt/core/tests/util/Util.java (you can find it in EUT
> > >> sources,
> > >> org.eclipse.sdk.tests.source_3.2.0.v20060329/src/
> > >> org.eclipse.jdt.core.tests.compiler_3.2.0/jdtcoretestscompilersrc.zip
> > >> ).
> > >>
> > >> It tries to return J9 specific class libraries path, and since you
> > >> use
> > >> Harmony classlib, it fails to return correct class libraries path
> > >> (that is used to build bootclasspath for new VM instance) and, thus,
> > >> the tests from org.eclipse.jdt.core.tests.compiler.regression suite
> > >> fail with 'java.lang.Object cannot be resolved' message.
> > >>
> > >> I had to modify one method to adapt it to DRLVM, please see the patch
> >
> > >> below:
> > >>
> > >> --------------------------------
> > >> *** orig/org/eclipse/jdt/core/tests/util/Util.java      2006-04-07
> > >> 05:03:00.000000000 +0700
> > >> --- patched/org/eclipse/jdt/core/tests/util/Util.java   2007-02-01
> > >> 14:30:53.759229716 +0600
> > >> ***************
> > >> *** 11,18 ****
> > >> --- 11,19 ----
> > >> package org.eclipse.jdt.core.tests.util;
> > >>
> > >> import java.io.File;
> > >> import java.io.FileInputStream;
> > >> + import java.io.FilenameFilter;
> > >> import java.io.FileNotFoundException;
> > >> import java.io.FileOutputStream;
> > >> import java.io.IOException;
> > >> import java.io.InputStream;
> > >> ***************
> > >> *** 498,505 ****
> > >> --- 499,518 ----
> > >>        final String vmName = System.getProperty("java.vm.name ");
> > >>        if ("J9".equals(vmName)) {
> > >>                return new String[] { toNativePath(jreDir +
> > >> "/lib/jclMax/classes.zip")};
> > >>        }
> > >> +       if ("DRLVM".equals(vmName)) {
> > >> +             FilenameFilter jarFilter = new FilenameFilter() {
> > >> +                 public boolean accept(File dir, String name) {
> > >> +                         return name.endsWith(".jar") &
> > >> !name.endsWith("-src.jar");
> > >> +                 }
> > >> +           };
> > >> +           String[] jars = new File(jreDir +
> > >> "/lib/boot/").list(jarFilter);
> > >> +             for (int i = 0; i < jars.length; i++) {
> > >> +               jars[i] = toNativePath(jreDir + "/lib/boot/" + jars
> > >> [i]);
> > >> +           }
> > >> +             return jars;
> > >> +       }
> > >>        File file = new File(jreDir + "/lib/rt.jar");
> > >>        if (file.exists()) {
> > >>                return new String[] {
> > >>                        toNativePath(jreDir + "/lib/rt.jar")
> > >>
> > >> --------------------------------
> > >>
> > >> I guess if you do something similar for J9, it should help.
> > >>
> > >> Hope that it will help, looking forward to hearing from you. If you
> > >> have any troubles making this modifications or if it doesn't help, I
> > >> could give more details.
> > >>
> > >> --
> > >> Thanks,
> > >> Nina
> > >>
> > >>
> > >> > Thanks very much.
> > >> >
> > >> >
> > >> >
> > >> > Here is one of the error full message
> > >> > ===============================
> > >> > Invalid problem log . ----------- Expected ------------
> > >> ----------\n 1.
> > >> > ERROR in X.java (at line 3)\n * @see <a
> > >> href="spec.html#section">Java
> > >> > Spec<a>\n ^^^\n Javadoc: Malformed link reference\n ----------\n
> > >> > ------------ but was ------------ ----------\n 1. ERROR in
> > >> X.java (at
> > >> line
> > >> > 1)\n public class X {\n ^\n The type java.lang.Object cannot be
> > >> resolved. It
> > >> > is indirectly referenced from required .class files\n ----------
> > >> \n 2.
> > >> ERROR
> > >> > in X.java (at line 3)\n * @see <a href="spec.html#section">Java
> > >> Spec<a>\n
> > >> > ^^^\n Javadoc: Malformed link reference\n ----------\n ---------
> > >> Difference
> > >> > is ---------- expected:<......> but was:<...1)\n public class X
> > >> {\n ^\n
> > >> The
> > >> > type java.lang.Object cannot be resolved. It is indirectly
> > >> referenced
> > >> from
> > >> > required .class files\n ----------\n 2. ERROR in X.java (at
> > >> line ...>
> > >> >
> > >> > junit.framework.ComparisonFailure: Invalid problem log .
> > >> > ----------- Expected ------------
> > >> > ----------\n
> > >> > 1. ERROR in X.java (at line 3)\n
> > >> > * @see <a href="spec.html#section">Java Spec<a>\n
> > >> > ^^^\n
> > >> > Javadoc: Malformed link reference\n
> > >> > ----------\n
> > >> >
> > >> > ------------ but was ------------
> > >> > ----------\n
> > >> > 1. ERROR in X.java (at line 1)\n
> > >> > public class X {\n
> > >> > ^\n
> > >> > The type java.lang.Object cannot be resolved. It is indirectly
> > >> referenced
> > >> > from required .class files\n
> > >> > ----------\n
> > >> > 2. ERROR in X.java (at line 3)\n
> > >> > * @see <a href="spec.html#section">Java Spec<a>\n
> > >> > ^^^\n
> > >> > Javadoc: Malformed link reference\n
> > >> > ----------\n
> > >> >
> > >> > --------- Difference is ----------
> > >> > expected:<......> but was:<...1)\n
> > >> > public class X {\n
> > >> > ^\n
> > >> > The type java.lang.Object cannot be resolved. It is indirectly
> > >> referenced
> > >> > from required .class files\n
> > >> > ----------\n
> > >> > 2. ERROR in X.java (at line ...>
> > >> > at
> > >> org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEqual
> > >> s(
> > >> > TestCase.java:28)
> > >> > at
> > >> org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(
> > >> > TestCase.java:189)
> > >> > at
> > >> >
> > >> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest
> > >> .runNegativeTest
> > >> > (AbstractRegressionTest.java:687)
> > >> > at
> > >> >
> > >> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest
> > >> .runNegativeTest
> > >> > (AbstractRegressionTest.java:569)
> > >> > at
> > >> >
> > >> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest
> > >> .runNegativeTest
> > >> > (AbstractRegressionTest.java :548)
> > >> > at
> > >> >
> > >> org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBu
> > >> g73479
> > >> (
> > >> > JavadocBugsTest.java:2993)
> > >> > at java.lang.reflect.AccessibleObject.invokeV
> > >> (AccessibleObject.java:25)
> > >> > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> > >> > at junit.extensions.TestDecorator.run(TestDecorator.java :28)
> > >> > at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
> > >> > CompilerTestSetup.java:48)
> > >> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:
> > >> 330)
> > >> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:
> > >> 24)
> > >> > at org.eclipse.test.CoreTestApplication.runTests(
> > >> CoreTestApplication.java
> > >> > :35)
> > >> > at org.eclipse.test.CoreTestApplication.run
> > >> (CoreTestApplication.java:31)
> > >> > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> > >> > PlatformActivator.java :78)
> > >> > at
> > >> >
> > >> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
> > >> cation
> > >> (
> > >> > EclipseAppLauncher.java:92)
> > >> > at
> > >> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> > >> > EclipseAppLauncher.java:68)
> > >> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> > >> EclipseStarter.java
> > >> > :40)
> > >> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> > >> EclipseStarter.java
> > >> > :177)
> > >> > at java.lang.reflect.AccessibleObject.invokeL
> > >> ( AccessibleObject.java:213)
> > >> > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
> > >> > at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> > >> > at org.eclipse.core.launcher.Main.run (Main.java:977)
> > >> > at org.eclipse.core.launcher.Main.main(Main.java:952)
> > >> > at java.lang.reflect.AccessibleObject.invokeV
> > >> (AccessibleObject.java:25)
> > >> > at com.ibm.oti.vm.JarRunner.main (JarRunner.java:42)
> > >> > 0.016
> > >> > testBug73995 - 1.3 Failure Unexpected problems: ---------- 1.
> > >> ERROR in
> > >> > X.java (at line 1) public class X { ^ The type java.lang.Object
> > >> cannot
> > >> be
> > >> > resolved. It is indirectly referenced from required .class files
> > >> ----------
> > >> >
> > >> > junit.framework.AssertionFailedError: Unexpected problems:
> > >> ----------
> > >> > 1. ERROR in X.java (at line 1)
> > >> > public class X {
> > >> > ^
> > >> > The type java.lang.Object cannot be resolved. It is indirectly
> > >> referenced
> > >> > from required .class files
> > >> > ----------
> > >> >
> > >> > at
> > >> >
> > >> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest
> > >> .runConformTest
> > >> > (AbstractRegressionTest.java:463)
> > >> > at
> > >> >
> > >> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest
> > >> .runConformTest
> > >> > (AbstractRegressionTest.java :279)
> > >> > at
> > >> >
> > >> org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBu
> > >> g73995
> > >> (
> > >> > JavadocBugsTest.java:317)
> > >> > at java.lang.reflect.AccessibleObject.invokeV
> > >> (AccessibleObject.java:25)
> > >> > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> > >> > at junit.extensions.TestDecorator.run(TestDecorator.java :28)
> > >> > at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
> > >> > CompilerTestSetup.java:48)
> > >> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:
> > >> 330)
> > >> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:
> > >> 24)
> > >> > at org.eclipse.test.CoreTestApplication.runTests(
> > >> CoreTestApplication.java
> > >> > :35)
> > >> > at org.eclipse.test.CoreTestApplication.run
> > >> (CoreTestApplication.java:31)
> > >> > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> > >> > PlatformActivator.java :78)
> > >> > at
> > >> >
> > >> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
> > >> cation
> > >> (
> > >> > EclipseAppLauncher.java:92)
> > >> > at
> > >> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> > >> > EclipseAppLauncher.java:68)
> > >> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> > >> EclipseStarter.java
> > >> > :40)
> > >> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> > >> EclipseStarter.java
> > >> > :177)
> > >> > at java.lang.reflect.AccessibleObject.invokeL
> > >> ( AccessibleObject.java:213)
> > >> > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
> > >> > at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> > >> > at org.eclipse.core.launcher.Main.run (Main.java:977)
> > >> > at org.eclipse.core.launcher.Main.main(Main.java:952)
> > >> > at java.lang.reflect.AccessibleObject.invokeV
> > >> (AccessibleObject.java:25)
> > >> > at com.ibm.oti.vm.JarRunner.main (JarRunner.java:42)
> > >> >
> > >> > --
> > >> > Sean Qiu
> > >> >
> > >>
> > >
> > >
> > >
> > > --
> > > Sean Qiu
> >
> >
>
>
> --
> Sean Qiu




-- 
Sean Qiu

Re: [test] Problem encoutered when running eclipse's unit test with harmony

Posted by Sean Qiu <se...@gmail.com>.
I will try to report this issue to eclipse's mailing list.
And I will post their response here if any.

2007/2/5, Geir Magnusson Jr. <ge...@pobox.com>:
>
> Did anyone report this to Eclipse?  Seems like there must be a more
> elegant way for that test to figure out where to find the classes, or
> at least we can get our patch in there too :)
>
> geir
>
> On Feb 1, 2007, at 11:05 AM, Sean Qiu wrote:
>
> > It is so helpful.
> > Thanks very much! :)
> >
> >
> > 2007/2/1, Nina Rinskaya <ni...@gmail.com>:
> >>
> >> On 2/1/07, Sean Qiu <se...@gmail.com> wrote:
> >> > Hi , everybody
> >> >
> >> > I am trying to run unit tests of the latest eclipse whose
> >> version is
> >> > 3.2.1with harmony classlib and IBM J9 VM.
> >> > But i encountered some problems when run the tests in package of
> >> > org.eclipse.jdt.core.tests.compiler.regression.
> >> >
> >> > All the failing test's message seem similar who all contains this
> >> sentence:
> >> > The type java.lang.Object cannot be resolved. It is indirectly
> >> referenced
> >> > from required .class files
> >> >
> >> > At first, i thought it may be because that eclipse could not
> >> recognize
> >> our
> >> > harmony's JRE, so i added the plugin
> >> > org.apache.harmony.eclipse.jdt.launching_1.0.2.jar before testing.
> >> > But it was good-for-nothing.
> >> >
> >> > I find someone had successuflly run these tests with DRLVM, is
> >> there any
> >> > further configuration???
> >> > Have you ever encountered the similar problem??
> >> >
> >>
> >> I run Eclipse Unit Tests on DRLVM and yes, I did encounter the same
> >> issue. It is caused by hard-coded class libraries names in
> >> org/eclipse/jdt/core/tests/util/Util.java (you can find it in EUT
> >> sources,
> >> org.eclipse.sdk.tests.source_3.2.0.v20060329/src/
> >> org.eclipse.jdt.core.tests.compiler_3.2.0/jdtcoretestscompilersrc.zip
> >> ).
> >>
> >> It tries to return J9 specific class libraries path, and since you
> >> use
> >> Harmony classlib, it fails to return correct class libraries path
> >> (that is used to build bootclasspath for new VM instance) and, thus,
> >> the tests from org.eclipse.jdt.core.tests.compiler.regression suite
> >> fail with 'java.lang.Object cannot be resolved' message.
> >>
> >> I had to modify one method to adapt it to DRLVM, please see the patch
> >> below:
> >>
> >> --------------------------------
> >> *** orig/org/eclipse/jdt/core/tests/util/Util.java      2006-04-07
> >> 05:03:00.000000000 +0700
> >> --- patched/org/eclipse/jdt/core/tests/util/Util.java   2007-02-01
> >> 14:30:53.759229716 +0600
> >> ***************
> >> *** 11,18 ****
> >> --- 11,19 ----
> >> package org.eclipse.jdt.core.tests.util;
> >>
> >> import java.io.File;
> >> import java.io.FileInputStream;
> >> + import java.io.FilenameFilter;
> >> import java.io.FileNotFoundException;
> >> import java.io.FileOutputStream;
> >> import java.io.IOException;
> >> import java.io.InputStream;
> >> ***************
> >> *** 498,505 ****
> >> --- 499,518 ----
> >>        final String vmName = System.getProperty("java.vm.name");
> >>        if ("J9".equals(vmName)) {
> >>                return new String[] { toNativePath(jreDir +
> >> "/lib/jclMax/classes.zip")};
> >>        }
> >> +       if ("DRLVM".equals(vmName)) {
> >> +             FilenameFilter jarFilter = new FilenameFilter() {
> >> +                 public boolean accept(File dir, String name) {
> >> +                         return name.endsWith(".jar") &
> >> !name.endsWith("-src.jar");
> >> +                 }
> >> +           };
> >> +           String[] jars = new File(jreDir +
> >> "/lib/boot/").list(jarFilter);
> >> +             for (int i = 0; i < jars.length; i++) {
> >> +               jars[i] = toNativePath(jreDir + "/lib/boot/" + jars
> >> [i]);
> >> +           }
> >> +             return jars;
> >> +       }
> >>        File file = new File(jreDir + "/lib/rt.jar");
> >>        if (file.exists()) {
> >>                return new String[] {
> >>                        toNativePath(jreDir + "/lib/rt.jar")
> >>
> >> --------------------------------
> >>
> >> I guess if you do something similar for J9, it should help.
> >>
> >> Hope that it will help, looking forward to hearing from you. If you
> >> have any troubles making this modifications or if it doesn't help, I
> >> could give more details.
> >>
> >> --
> >> Thanks,
> >> Nina
> >>
> >>
> >> > Thanks very much.
> >> >
> >> >
> >> >
> >> > Here is one of the error full message
> >> > ===============================
> >> > Invalid problem log . ----------- Expected ------------
> >> ----------\n 1.
> >> > ERROR in X.java (at line 3)\n * @see <a
> >> href="spec.html#section">Java
> >> > Spec<a>\n ^^^\n Javadoc: Malformed link reference\n ----------\n
> >> > ------------ but was ------------ ----------\n 1. ERROR in
> >> X.java (at
> >> line
> >> > 1)\n public class X {\n ^\n The type java.lang.Object cannot be
> >> resolved. It
> >> > is indirectly referenced from required .class files\n ----------
> >> \n 2.
> >> ERROR
> >> > in X.java (at line 3)\n * @see <a href="spec.html#section">Java
> >> Spec<a>\n
> >> > ^^^\n Javadoc: Malformed link reference\n ----------\n ---------
> >> Difference
> >> > is ---------- expected:<......> but was:<...1)\n public class X
> >> {\n ^\n
> >> The
> >> > type java.lang.Object cannot be resolved. It is indirectly
> >> referenced
> >> from
> >> > required .class files\n ----------\n 2. ERROR in X.java (at
> >> line ...>
> >> >
> >> > junit.framework.ComparisonFailure: Invalid problem log .
> >> > ----------- Expected ------------
> >> > ----------\n
> >> > 1. ERROR in X.java (at line 3)\n
> >> > * @see <a href="spec.html#section">Java Spec<a>\n
> >> > ^^^\n
> >> > Javadoc: Malformed link reference\n
> >> > ----------\n
> >> >
> >> > ------------ but was ------------
> >> > ----------\n
> >> > 1. ERROR in X.java (at line 1)\n
> >> > public class X {\n
> >> > ^\n
> >> > The type java.lang.Object cannot be resolved. It is indirectly
> >> referenced
> >> > from required .class files\n
> >> > ----------\n
> >> > 2. ERROR in X.java (at line 3)\n
> >> > * @see <a href="spec.html#section">Java Spec<a>\n
> >> > ^^^\n
> >> > Javadoc: Malformed link reference\n
> >> > ----------\n
> >> >
> >> > --------- Difference is ----------
> >> > expected:<......> but was:<...1)\n
> >> > public class X {\n
> >> > ^\n
> >> > The type java.lang.Object cannot be resolved. It is indirectly
> >> referenced
> >> > from required .class files\n
> >> > ----------\n
> >> > 2. ERROR in X.java (at line ...>
> >> > at
> >> org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEqual
> >> s(
> >> > TestCase.java:28)
> >> > at
> >> org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(
> >> > TestCase.java:189)
> >> > at
> >> >
> >> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest
> >> .runNegativeTest
> >> > (AbstractRegressionTest.java:687)
> >> > at
> >> >
> >> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest
> >> .runNegativeTest
> >> > (AbstractRegressionTest.java:569)
> >> > at
> >> >
> >> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest
> >> .runNegativeTest
> >> > (AbstractRegressionTest.java:548)
> >> > at
> >> >
> >> org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBu
> >> g73479
> >> (
> >> > JavadocBugsTest.java:2993)
> >> > at java.lang.reflect.AccessibleObject.invokeV
> >> (AccessibleObject.java:25)
> >> > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> >> > at junit.extensions.TestDecorator.run(TestDecorator.java:28)
> >> > at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
> >> > CompilerTestSetup.java:48)
> >> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:
> >> 330)
> >> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:
> >> 24)
> >> > at org.eclipse.test.CoreTestApplication.runTests(
> >> CoreTestApplication.java
> >> > :35)
> >> > at org.eclipse.test.CoreTestApplication.run
> >> (CoreTestApplication.java:31)
> >> > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> >> > PlatformActivator.java:78)
> >> > at
> >> >
> >> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
> >> cation
> >> (
> >> > EclipseAppLauncher.java:92)
> >> > at
> >> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> >> > EclipseAppLauncher.java:68)
> >> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> >> EclipseStarter.java
> >> > :40)
> >> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> >> EclipseStarter.java
> >> > :177)
> >> > at java.lang.reflect.AccessibleObject.invokeL
> >> (AccessibleObject.java:213)
> >> > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
> >> > at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> >> > at org.eclipse.core.launcher.Main.run(Main.java:977)
> >> > at org.eclipse.core.launcher.Main.main(Main.java:952)
> >> > at java.lang.reflect.AccessibleObject.invokeV
> >> (AccessibleObject.java:25)
> >> > at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)
> >> > 0.016
> >> > testBug73995 - 1.3 Failure Unexpected problems: ---------- 1.
> >> ERROR in
> >> > X.java (at line 1) public class X { ^ The type java.lang.Object
> >> cannot
> >> be
> >> > resolved. It is indirectly referenced from required .class files
> >> ----------
> >> >
> >> > junit.framework.AssertionFailedError: Unexpected problems:
> >> ----------
> >> > 1. ERROR in X.java (at line 1)
> >> > public class X {
> >> > ^
> >> > The type java.lang.Object cannot be resolved. It is indirectly
> >> referenced
> >> > from required .class files
> >> > ----------
> >> >
> >> > at
> >> >
> >> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest
> >> .runConformTest
> >> > (AbstractRegressionTest.java:463)
> >> > at
> >> >
> >> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest
> >> .runConformTest
> >> > (AbstractRegressionTest.java:279)
> >> > at
> >> >
> >> org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBu
> >> g73995
> >> (
> >> > JavadocBugsTest.java:317)
> >> > at java.lang.reflect.AccessibleObject.invokeV
> >> (AccessibleObject.java:25)
> >> > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> >> > at junit.extensions.TestDecorator.run(TestDecorator.java:28)
> >> > at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
> >> > CompilerTestSetup.java:48)
> >> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:
> >> 330)
> >> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:
> >> 24)
> >> > at org.eclipse.test.CoreTestApplication.runTests(
> >> CoreTestApplication.java
> >> > :35)
> >> > at org.eclipse.test.CoreTestApplication.run
> >> (CoreTestApplication.java:31)
> >> > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> >> > PlatformActivator.java:78)
> >> > at
> >> >
> >> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
> >> cation
> >> (
> >> > EclipseAppLauncher.java:92)
> >> > at
> >> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> >> > EclipseAppLauncher.java:68)
> >> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> >> EclipseStarter.java
> >> > :40)
> >> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> >> EclipseStarter.java
> >> > :177)
> >> > at java.lang.reflect.AccessibleObject.invokeL
> >> (AccessibleObject.java:213)
> >> > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
> >> > at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> >> > at org.eclipse.core.launcher.Main.run(Main.java:977)
> >> > at org.eclipse.core.launcher.Main.main(Main.java:952)
> >> > at java.lang.reflect.AccessibleObject.invokeV
> >> (AccessibleObject.java:25)
> >> > at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)
> >> >
> >> > --
> >> > Sean Qiu
> >> >
> >>
> >
> >
> >
> > --
> > Sean Qiu
>
>


-- 
Sean Qiu

Re: [test] Problem encoutered when running eclipse's unit test with harmony

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
Did anyone report this to Eclipse?  Seems like there must be a more  
elegant way for that test to figure out where to find the classes, or  
at least we can get our patch in there too :)

geir

On Feb 1, 2007, at 11:05 AM, Sean Qiu wrote:

> It is so helpful.
> Thanks very much! :)
>
>
> 2007/2/1, Nina Rinskaya <ni...@gmail.com>:
>>
>> On 2/1/07, Sean Qiu <se...@gmail.com> wrote:
>> > Hi , everybody
>> >
>> > I am trying to run unit tests of the latest eclipse whose  
>> version is
>> > 3.2.1with harmony classlib and IBM J9 VM.
>> > But i encountered some problems when run the tests in package of
>> > org.eclipse.jdt.core.tests.compiler.regression.
>> >
>> > All the failing test's message seem similar who all contains this
>> sentence:
>> > The type java.lang.Object cannot be resolved. It is indirectly
>> referenced
>> > from required .class files
>> >
>> > At first, i thought it may be because that eclipse could not  
>> recognize
>> our
>> > harmony's JRE, so i added the plugin
>> > org.apache.harmony.eclipse.jdt.launching_1.0.2.jar before testing.
>> > But it was good-for-nothing.
>> >
>> > I find someone had successuflly run these tests with DRLVM, is  
>> there any
>> > further configuration???
>> > Have you ever encountered the similar problem??
>> >
>>
>> I run Eclipse Unit Tests on DRLVM and yes, I did encounter the same
>> issue. It is caused by hard-coded class libraries names in
>> org/eclipse/jdt/core/tests/util/Util.java (you can find it in EUT
>> sources,
>> org.eclipse.sdk.tests.source_3.2.0.v20060329/src/ 
>> org.eclipse.jdt.core.tests.compiler_3.2.0/jdtcoretestscompilersrc.zip
>> ).
>>
>> It tries to return J9 specific class libraries path, and since you  
>> use
>> Harmony classlib, it fails to return correct class libraries path
>> (that is used to build bootclasspath for new VM instance) and, thus,
>> the tests from org.eclipse.jdt.core.tests.compiler.regression suite
>> fail with 'java.lang.Object cannot be resolved' message.
>>
>> I had to modify one method to adapt it to DRLVM, please see the patch
>> below:
>>
>> --------------------------------
>> *** orig/org/eclipse/jdt/core/tests/util/Util.java      2006-04-07
>> 05:03:00.000000000 +0700
>> --- patched/org/eclipse/jdt/core/tests/util/Util.java   2007-02-01
>> 14:30:53.759229716 +0600
>> ***************
>> *** 11,18 ****
>> --- 11,19 ----
>> package org.eclipse.jdt.core.tests.util;
>>
>> import java.io.File;
>> import java.io.FileInputStream;
>> + import java.io.FilenameFilter;
>> import java.io.FileNotFoundException;
>> import java.io.FileOutputStream;
>> import java.io.IOException;
>> import java.io.InputStream;
>> ***************
>> *** 498,505 ****
>> --- 499,518 ----
>>        final String vmName = System.getProperty("java.vm.name");
>>        if ("J9".equals(vmName)) {
>>                return new String[] { toNativePath(jreDir +
>> "/lib/jclMax/classes.zip")};
>>        }
>> +       if ("DRLVM".equals(vmName)) {
>> +             FilenameFilter jarFilter = new FilenameFilter() {
>> +                 public boolean accept(File dir, String name) {
>> +                         return name.endsWith(".jar") &
>> !name.endsWith("-src.jar");
>> +                 }
>> +           };
>> +           String[] jars = new File(jreDir +
>> "/lib/boot/").list(jarFilter);
>> +             for (int i = 0; i < jars.length; i++) {
>> +               jars[i] = toNativePath(jreDir + "/lib/boot/" + jars 
>> [i]);
>> +           }
>> +             return jars;
>> +       }
>>        File file = new File(jreDir + "/lib/rt.jar");
>>        if (file.exists()) {
>>                return new String[] {
>>                        toNativePath(jreDir + "/lib/rt.jar")
>>
>> --------------------------------
>>
>> I guess if you do something similar for J9, it should help.
>>
>> Hope that it will help, looking forward to hearing from you. If you
>> have any troubles making this modifications or if it doesn't help, I
>> could give more details.
>>
>> --
>> Thanks,
>> Nina
>>
>>
>> > Thanks very much.
>> >
>> >
>> >
>> > Here is one of the error full message
>> > ===============================
>> > Invalid problem log . ----------- Expected ------------  
>> ----------\n 1.
>> > ERROR in X.java (at line 3)\n * @see <a  
>> href="spec.html#section">Java
>> > Spec<a>\n ^^^\n Javadoc: Malformed link reference\n ----------\n
>> > ------------ but was ------------ ----------\n 1. ERROR in  
>> X.java (at
>> line
>> > 1)\n public class X {\n ^\n The type java.lang.Object cannot be
>> resolved. It
>> > is indirectly referenced from required .class files\n ---------- 
>> \n 2.
>> ERROR
>> > in X.java (at line 3)\n * @see <a href="spec.html#section">Java
>> Spec<a>\n
>> > ^^^\n Javadoc: Malformed link reference\n ----------\n ---------
>> Difference
>> > is ---------- expected:<......> but was:<...1)\n public class X  
>> {\n ^\n
>> The
>> > type java.lang.Object cannot be resolved. It is indirectly  
>> referenced
>> from
>> > required .class files\n ----------\n 2. ERROR in X.java (at  
>> line ...>
>> >
>> > junit.framework.ComparisonFailure: Invalid problem log .
>> > ----------- Expected ------------
>> > ----------\n
>> > 1. ERROR in X.java (at line 3)\n
>> > * @see <a href="spec.html#section">Java Spec<a>\n
>> > ^^^\n
>> > Javadoc: Malformed link reference\n
>> > ----------\n
>> >
>> > ------------ but was ------------
>> > ----------\n
>> > 1. ERROR in X.java (at line 1)\n
>> > public class X {\n
>> > ^\n
>> > The type java.lang.Object cannot be resolved. It is indirectly
>> referenced
>> > from required .class files\n
>> > ----------\n
>> > 2. ERROR in X.java (at line 3)\n
>> > * @see <a href="spec.html#section">Java Spec<a>\n
>> > ^^^\n
>> > Javadoc: Malformed link reference\n
>> > ----------\n
>> >
>> > --------- Difference is ----------
>> > expected:<......> but was:<...1)\n
>> > public class X {\n
>> > ^\n
>> > The type java.lang.Object cannot be resolved. It is indirectly
>> referenced
>> > from required .class files\n
>> > ----------\n
>> > 2. ERROR in X.java (at line ...>
>> > at
>> org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEqual 
>> s(
>> > TestCase.java:28)
>> > at  
>> org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(
>> > TestCase.java:189)
>> > at
>> >
>> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest 
>> .runNegativeTest
>> > (AbstractRegressionTest.java:687)
>> > at
>> >
>> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest 
>> .runNegativeTest
>> > (AbstractRegressionTest.java:569)
>> > at
>> >
>> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest 
>> .runNegativeTest
>> > (AbstractRegressionTest.java:548)
>> > at
>> >
>> org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBu 
>> g73479
>> (
>> > JavadocBugsTest.java:2993)
>> > at java.lang.reflect.AccessibleObject.invokeV 
>> (AccessibleObject.java:25)
>> > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
>> > at junit.extensions.TestDecorator.run(TestDecorator.java:28)
>> > at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
>> > CompilerTestSetup.java:48)
>> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java: 
>> 330)
>> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java: 
>> 24)
>> > at org.eclipse.test.CoreTestApplication.runTests(
>> CoreTestApplication.java
>> > :35)
>> > at org.eclipse.test.CoreTestApplication.run 
>> (CoreTestApplication.java:31)
>> > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
>> > PlatformActivator.java:78)
>> > at
>> >
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli 
>> cation
>> (
>> > EclipseAppLauncher.java:92)
>> > at  
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
>> > EclipseAppLauncher.java:68)
>> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
>> EclipseStarter.java
>> > :40)
>> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
>> EclipseStarter.java
>> > :177)
>> > at java.lang.reflect.AccessibleObject.invokeL 
>> (AccessibleObject.java:213)
>> > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
>> > at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
>> > at org.eclipse.core.launcher.Main.run(Main.java:977)
>> > at org.eclipse.core.launcher.Main.main(Main.java:952)
>> > at java.lang.reflect.AccessibleObject.invokeV 
>> (AccessibleObject.java:25)
>> > at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)
>> > 0.016
>> > testBug73995 - 1.3 Failure Unexpected problems: ---------- 1.  
>> ERROR in
>> > X.java (at line 1) public class X { ^ The type java.lang.Object  
>> cannot
>> be
>> > resolved. It is indirectly referenced from required .class files
>> ----------
>> >
>> > junit.framework.AssertionFailedError: Unexpected problems:  
>> ----------
>> > 1. ERROR in X.java (at line 1)
>> > public class X {
>> > ^
>> > The type java.lang.Object cannot be resolved. It is indirectly
>> referenced
>> > from required .class files
>> > ----------
>> >
>> > at
>> >
>> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest 
>> .runConformTest
>> > (AbstractRegressionTest.java:463)
>> > at
>> >
>> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest 
>> .runConformTest
>> > (AbstractRegressionTest.java:279)
>> > at
>> >
>> org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBu 
>> g73995
>> (
>> > JavadocBugsTest.java:317)
>> > at java.lang.reflect.AccessibleObject.invokeV 
>> (AccessibleObject.java:25)
>> > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
>> > at junit.extensions.TestDecorator.run(TestDecorator.java:28)
>> > at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
>> > CompilerTestSetup.java:48)
>> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java: 
>> 330)
>> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java: 
>> 24)
>> > at org.eclipse.test.CoreTestApplication.runTests(
>> CoreTestApplication.java
>> > :35)
>> > at org.eclipse.test.CoreTestApplication.run 
>> (CoreTestApplication.java:31)
>> > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
>> > PlatformActivator.java:78)
>> > at
>> >
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli 
>> cation
>> (
>> > EclipseAppLauncher.java:92)
>> > at  
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
>> > EclipseAppLauncher.java:68)
>> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
>> EclipseStarter.java
>> > :40)
>> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
>> EclipseStarter.java
>> > :177)
>> > at java.lang.reflect.AccessibleObject.invokeL 
>> (AccessibleObject.java:213)
>> > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
>> > at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
>> > at org.eclipse.core.launcher.Main.run(Main.java:977)
>> > at org.eclipse.core.launcher.Main.main(Main.java:952)
>> > at java.lang.reflect.AccessibleObject.invokeV 
>> (AccessibleObject.java:25)
>> > at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)
>> >
>> > --
>> > Sean Qiu
>> >
>>
>
>
>
> -- 
> Sean Qiu


Re: [test] Problem encoutered when running eclipse's unit test with harmony

Posted by Sean Qiu <se...@gmail.com>.
It is so helpful.
Thanks very much! :)


2007/2/1, Nina Rinskaya <ni...@gmail.com>:
>
> On 2/1/07, Sean Qiu <se...@gmail.com> wrote:
> > Hi , everybody
> >
> > I am trying to run unit tests of the latest eclipse whose version is
> > 3.2.1with harmony classlib and IBM J9 VM.
> > But i encountered some problems when run the tests in package of
> > org.eclipse.jdt.core.tests.compiler.regression.
> >
> > All the failing test's message seem similar who all contains this
> sentence:
> > The type java.lang.Object cannot be resolved. It is indirectly
> referenced
> > from required .class files
> >
> > At first, i thought it may be because that eclipse could not recognize
> our
> > harmony's JRE, so i added the plugin
> > org.apache.harmony.eclipse.jdt.launching_1.0.2.jar before testing.
> > But it was good-for-nothing.
> >
> > I find someone had successuflly run these tests with DRLVM, is there any
> > further configuration???
> > Have you ever encountered the similar problem??
> >
>
> I run Eclipse Unit Tests on DRLVM and yes, I did encounter the same
> issue. It is caused by hard-coded class libraries names in
> org/eclipse/jdt/core/tests/util/Util.java (you can find it in EUT
> sources,
> org.eclipse.sdk.tests.source_3.2.0.v20060329/src/org.eclipse.jdt.core.tests.compiler_3.2.0/jdtcoretestscompilersrc.zip
> ).
>
> It tries to return J9 specific class libraries path, and since you use
> Harmony classlib, it fails to return correct class libraries path
> (that is used to build bootclasspath for new VM instance) and, thus,
> the tests from org.eclipse.jdt.core.tests.compiler.regression suite
> fail with 'java.lang.Object cannot be resolved' message.
>
> I had to modify one method to adapt it to DRLVM, please see the patch
> below:
>
> --------------------------------
> *** orig/org/eclipse/jdt/core/tests/util/Util.java      2006-04-07
> 05:03:00.000000000 +0700
> --- patched/org/eclipse/jdt/core/tests/util/Util.java   2007-02-01
> 14:30:53.759229716 +0600
> ***************
> *** 11,18 ****
> --- 11,19 ----
> package org.eclipse.jdt.core.tests.util;
>
> import java.io.File;
> import java.io.FileInputStream;
> + import java.io.FilenameFilter;
> import java.io.FileNotFoundException;
> import java.io.FileOutputStream;
> import java.io.IOException;
> import java.io.InputStream;
> ***************
> *** 498,505 ****
> --- 499,518 ----
>        final String vmName = System.getProperty("java.vm.name");
>        if ("J9".equals(vmName)) {
>                return new String[] { toNativePath(jreDir +
> "/lib/jclMax/classes.zip")};
>        }
> +       if ("DRLVM".equals(vmName)) {
> +             FilenameFilter jarFilter = new FilenameFilter() {
> +                 public boolean accept(File dir, String name) {
> +                         return name.endsWith(".jar") &
> !name.endsWith("-src.jar");
> +                 }
> +           };
> +           String[] jars = new File(jreDir +
> "/lib/boot/").list(jarFilter);
> +             for (int i = 0; i < jars.length; i++) {
> +               jars[i] = toNativePath(jreDir + "/lib/boot/" + jars[i]);
> +           }
> +             return jars;
> +       }
>        File file = new File(jreDir + "/lib/rt.jar");
>        if (file.exists()) {
>                return new String[] {
>                        toNativePath(jreDir + "/lib/rt.jar")
>
> --------------------------------
>
> I guess if you do something similar for J9, it should help.
>
> Hope that it will help, looking forward to hearing from you. If you
> have any troubles making this modifications or if it doesn't help, I
> could give more details.
>
> --
> Thanks,
> Nina
>
>
> > Thanks very much.
> >
> >
> >
> > Here is one of the error full message
> > ===============================
> > Invalid problem log . ----------- Expected ------------ ----------\n 1.
> > ERROR in X.java (at line 3)\n * @see <a href="spec.html#section">Java
> > Spec<a>\n ^^^\n Javadoc: Malformed link reference\n ----------\n
> > ------------ but was ------------ ----------\n 1. ERROR in X.java (at
> line
> > 1)\n public class X {\n ^\n The type java.lang.Object cannot be
> resolved. It
> > is indirectly referenced from required .class files\n ----------\n 2.
> ERROR
> > in X.java (at line 3)\n * @see <a href="spec.html#section">Java
> Spec<a>\n
> > ^^^\n Javadoc: Malformed link reference\n ----------\n ---------
> Difference
> > is ---------- expected:<......> but was:<...1)\n public class X {\n ^\n
> The
> > type java.lang.Object cannot be resolved. It is indirectly referenced
> from
> > required .class files\n ----------\n 2. ERROR in X.java (at line ...>
> >
> > junit.framework.ComparisonFailure: Invalid problem log .
> > ----------- Expected ------------
> > ----------\n
> > 1. ERROR in X.java (at line 3)\n
> > * @see <a href="spec.html#section">Java Spec<a>\n
> > ^^^\n
> > Javadoc: Malformed link reference\n
> > ----------\n
> >
> > ------------ but was ------------
> > ----------\n
> > 1. ERROR in X.java (at line 1)\n
> > public class X {\n
> > ^\n
> > The type java.lang.Object cannot be resolved. It is indirectly
> referenced
> > from required .class files\n
> > ----------\n
> > 2. ERROR in X.java (at line 3)\n
> > * @see <a href="spec.html#section">Java Spec<a>\n
> > ^^^\n
> > Javadoc: Malformed link reference\n
> > ----------\n
> >
> > --------- Difference is ----------
> > expected:<......> but was:<...1)\n
> > public class X {\n
> > ^\n
> > The type java.lang.Object cannot be resolved. It is indirectly
> referenced
> > from required .class files\n
> > ----------\n
> > 2. ERROR in X.java (at line ...>
> > at
> org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(
> > TestCase.java:28)
> > at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(
> > TestCase.java:189)
> > at
> >
> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest
> > (AbstractRegressionTest.java:687)
> > at
> >
> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest
> > (AbstractRegressionTest.java:569)
> > at
> >
> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest
> > (AbstractRegressionTest.java:548)
> > at
> >
> org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBug73479
> (
> > JavadocBugsTest.java:2993)
> > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> > at junit.extensions.TestDecorator.run(TestDecorator.java:28)
> > at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
> > CompilerTestSetup.java:48)
> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:330)
> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:24)
> > at org.eclipse.test.CoreTestApplication.runTests(
> CoreTestApplication.java
> > :35)
> > at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
> > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> > PlatformActivator.java:78)
> > at
> >
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication
> (
> > EclipseAppLauncher.java:92)
> > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> > EclipseAppLauncher.java:68)
> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> EclipseStarter.java
> > :40)
> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> EclipseStarter.java
> > :177)
> > at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:213)
> > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
> > at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> > at org.eclipse.core.launcher.Main.run(Main.java:977)
> > at org.eclipse.core.launcher.Main.main(Main.java:952)
> > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> > at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)
> > 0.016
> > testBug73995 - 1.3 Failure Unexpected problems: ---------- 1. ERROR in
> > X.java (at line 1) public class X { ^ The type java.lang.Object cannot
> be
> > resolved. It is indirectly referenced from required .class files
> ----------
> >
> > junit.framework.AssertionFailedError: Unexpected problems: ----------
> > 1. ERROR in X.java (at line 1)
> > public class X {
> > ^
> > The type java.lang.Object cannot be resolved. It is indirectly
> referenced
> > from required .class files
> > ----------
> >
> > at
> >
> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runConformTest
> > (AbstractRegressionTest.java:463)
> > at
> >
> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runConformTest
> > (AbstractRegressionTest.java:279)
> > at
> >
> org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBug73995
> (
> > JavadocBugsTest.java:317)
> > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> > at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> > at junit.extensions.TestDecorator.run(TestDecorator.java:28)
> > at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
> > CompilerTestSetup.java:48)
> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:330)
> > at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:24)
> > at org.eclipse.test.CoreTestApplication.runTests(
> CoreTestApplication.java
> > :35)
> > at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
> > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> > PlatformActivator.java:78)
> > at
> >
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication
> (
> > EclipseAppLauncher.java:92)
> > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> > EclipseAppLauncher.java:68)
> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> EclipseStarter.java
> > :40)
> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> EclipseStarter.java
> > :177)
> > at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:213)
> > at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
> > at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> > at org.eclipse.core.launcher.Main.run(Main.java:977)
> > at org.eclipse.core.launcher.Main.main(Main.java:952)
> > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> > at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)
> >
> > --
> > Sean Qiu
> >
>



-- 
Sean Qiu

Re: [test] Problem encoutered when running eclipse's unit test with harmony

Posted by Nina Rinskaya <ni...@gmail.com>.
On 2/1/07, Sean Qiu <se...@gmail.com> wrote:
> Hi , everybody
>
> I am trying to run unit tests of the latest eclipse whose version is
> 3.2.1with harmony classlib and IBM J9 VM.
> But i encountered some problems when run the tests in package of
> org.eclipse.jdt.core.tests.compiler.regression.
>
> All the failing test's message seem similar who all contains this sentence:
> The type java.lang.Object cannot be resolved. It is indirectly referenced
> from required .class files
>
> At first, i thought it may be because that eclipse could not recognize our
> harmony's JRE, so i added the plugin
> org.apache.harmony.eclipse.jdt.launching_1.0.2.jar before testing.
> But it was good-for-nothing.
>
> I find someone had successuflly run these tests with DRLVM, is there any
> further configuration???
> Have you ever encountered the similar problem??
>

I run Eclipse Unit Tests on DRLVM and yes, I did encounter the same
issue. It is caused by hard-coded class libraries names in
org/eclipse/jdt/core/tests/util/Util.java (you can find it in EUT
sources, org.eclipse.sdk.tests.source_3.2.0.v20060329/src/org.eclipse.jdt.core.tests.compiler_3.2.0/jdtcoretestscompilersrc.zip).

It tries to return J9 specific class libraries path, and since you use
Harmony classlib, it fails to return correct class libraries path
(that is used to build bootclasspath for new VM instance) and, thus,
the tests from org.eclipse.jdt.core.tests.compiler.regression suite
fail with 'java.lang.Object cannot be resolved' message.

I had to modify one method to adapt it to DRLVM, please see the patch below:

--------------------------------
*** orig/org/eclipse/jdt/core/tests/util/Util.java      2006-04-07
05:03:00.000000000 +0700
--- patched/org/eclipse/jdt/core/tests/util/Util.java   2007-02-01
14:30:53.759229716 +0600
***************
*** 11,18 ****
--- 11,19 ----
  package org.eclipse.jdt.core.tests.util;

  import java.io.File;
  import java.io.FileInputStream;
+ import java.io.FilenameFilter;
  import java.io.FileNotFoundException;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.io.InputStream;
***************
*** 498,505 ****
--- 499,518 ----
        final String vmName = System.getProperty("java.vm.name");
        if ("J9".equals(vmName)) {
                return new String[] { toNativePath(jreDir +
"/lib/jclMax/classes.zip")};
        }
+       if ("DRLVM".equals(vmName)) {
+             FilenameFilter jarFilter = new FilenameFilter() {
+                 public boolean accept(File dir, String name) {
+                         return name.endsWith(".jar") &
!name.endsWith("-src.jar");
+                 }
+           };
+           String[] jars = new File(jreDir + "/lib/boot/").list(jarFilter);
+             for (int i = 0; i < jars.length; i++) {
+               jars[i] = toNativePath(jreDir + "/lib/boot/" + jars[i]);
+           }
+             return jars;
+       }
        File file = new File(jreDir + "/lib/rt.jar");
        if (file.exists()) {
                return new String[] {
                        toNativePath(jreDir + "/lib/rt.jar")

--------------------------------

I guess if you do something similar for J9, it should help.

Hope that it will help, looking forward to hearing from you. If you
have any troubles making this modifications or if it doesn't help, I
could give more details.

--
Thanks,
Nina


> Thanks very much.
>
>
>
> Here is one of the error full message
> ===============================
> Invalid problem log . ----------- Expected ------------ ----------\n 1.
> ERROR in X.java (at line 3)\n * @see <a href="spec.html#section">Java
> Spec<a>\n ^^^\n Javadoc: Malformed link reference\n ----------\n
> ------------ but was ------------ ----------\n 1. ERROR in X.java (at line
> 1)\n public class X {\n ^\n The type java.lang.Object cannot be resolved. It
> is indirectly referenced from required .class files\n ----------\n 2. ERROR
> in X.java (at line 3)\n * @see <a href="spec.html#section">Java Spec<a>\n
> ^^^\n Javadoc: Malformed link reference\n ----------\n --------- Difference
> is ---------- expected:<......> but was:<...1)\n public class X {\n ^\n The
> type java.lang.Object cannot be resolved. It is indirectly referenced from
> required .class files\n ----------\n 2. ERROR in X.java (at line ...>
>
> junit.framework.ComparisonFailure: Invalid problem log .
> ----------- Expected ------------
> ----------\n
> 1. ERROR in X.java (at line 3)\n
> * @see <a href="spec.html#section">Java Spec<a>\n
> ^^^\n
> Javadoc: Malformed link reference\n
> ----------\n
>
> ------------ but was ------------
> ----------\n
> 1. ERROR in X.java (at line 1)\n
> public class X {\n
> ^\n
> The type java.lang.Object cannot be resolved. It is indirectly referenced
> from required .class files\n
> ----------\n
> 2. ERROR in X.java (at line 3)\n
> * @see <a href="spec.html#section">Java Spec<a>\n
> ^^^\n
> Javadoc: Malformed link reference\n
> ----------\n
>
> --------- Difference is ----------
> expected:<......> but was:<...1)\n
> public class X {\n
> ^\n
> The type java.lang.Object cannot be resolved. It is indirectly referenced
> from required .class files\n
> ----------\n
> 2. ERROR in X.java (at line ...>
> at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(
> TestCase.java:28)
> at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(
> TestCase.java:189)
> at
> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest
> (AbstractRegressionTest.java:687)
> at
> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest
> (AbstractRegressionTest.java:569)
> at
> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runNegativeTest
> (AbstractRegressionTest.java:548)
> at
> org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBug73479(
> JavadocBugsTest.java:2993)
> at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> at junit.extensions.TestDecorator.run(TestDecorator.java:28)
> at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
> CompilerTestSetup.java:48)
> at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:330)
> at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:24)
> at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java
> :35)
> at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
> at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> PlatformActivator.java:78)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
> EclipseAppLauncher.java:92)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> EclipseAppLauncher.java:68)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java
> :40)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java
> :177)
> at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:213)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> at org.eclipse.core.launcher.Main.run(Main.java:977)
> at org.eclipse.core.launcher.Main.main(Main.java:952)
> at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)
> 0.016
> testBug73995 - 1.3 Failure Unexpected problems: ---------- 1. ERROR in
> X.java (at line 1) public class X { ^ The type java.lang.Object cannot be
> resolved. It is indirectly referenced from required .class files ----------
>
> junit.framework.AssertionFailedError: Unexpected problems: ----------
> 1. ERROR in X.java (at line 1)
> public class X {
> ^
> The type java.lang.Object cannot be resolved. It is indirectly referenced
> from required .class files
> ----------
>
> at
> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runConformTest
> (AbstractRegressionTest.java:463)
> at
> org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.runConformTest
> (AbstractRegressionTest.java:279)
> at
> org.eclipse.jdt.core.tests.compiler.regression.JavadocBugsTest.testBug73995(
> JavadocBugsTest.java:317)
> at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> at junit.extensions.TestDecorator.run(TestDecorator.java:28)
> at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(
> CompilerTestSetup.java:48)
> at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:330)
> at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:24)
> at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java
> :35)
> at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
> at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> PlatformActivator.java:78)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
> EclipseAppLauncher.java:92)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> EclipseAppLauncher.java:68)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java
> :40)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java
> :177)
> at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:213)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> at org.eclipse.core.launcher.Main.run(Main.java:977)
> at org.eclipse.core.launcher.Main.main(Main.java:952)
> at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
> at com.ibm.oti.vm.JarRunner.main(JarRunner.java:42)
>
> --
> Sean Qiu
>