harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nina Rinskaya" <nina.rinsk...@gmail.com>
Subject Re: [test] Problem encoutered when running eclipse's unit test with harmony
Date Thu, 01 Feb 2007 11:56:02 GMT
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.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
>

Mime
View raw message