From dev-return-23800-apmail-harmony-dev-archive=harmony.apache.org@harmony.apache.org Thu Feb 01 11:56:31 2007 Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 16831 invoked from network); 1 Feb 2007 11:56:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Feb 2007 11:56:30 -0000 Received: (qmail 72511 invoked by uid 500); 1 Feb 2007 11:56:33 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 72479 invoked by uid 500); 1 Feb 2007 11:56:33 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 72462 invoked by uid 99); 1 Feb 2007 11:56:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Feb 2007 03:56:33 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of nina.rinskaya@gmail.com designates 66.249.92.173 as permitted sender) Received: from [66.249.92.173] (HELO ug-out-1314.google.com) (66.249.92.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Feb 2007 03:56:24 -0800 Received: by ug-out-1314.google.com with SMTP id z36so387070uge for ; Thu, 01 Feb 2007 03:56:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=j47uuPolKMrZWCA7piw3dGTVHNSppP5aQVTzUtl5SLMy0Z04yvvNQHCRu5VHEC2kB8B/t6kSm1edNfHnzEnuQueS1jeQagLfHD/PmMalJH01tcBLTaIksiIc8nDizUyEgAN/dINvXSf6/NwKmV1hhgboMwmJBLphDiH811NtAvs= Received: by 10.82.175.2 with SMTP id x2mr625754bue.1170330962463; Thu, 01 Feb 2007 03:56:02 -0800 (PST) Received: by 10.82.119.5 with HTTP; Thu, 1 Feb 2007 03:56:02 -0800 (PST) Message-ID: Date: Thu, 1 Feb 2007 17:56:02 +0600 From: "Nina Rinskaya" To: dev@harmony.apache.org Subject: Re: [test] Problem encoutered when running eclipse's unit test with harmony In-Reply-To: <94d710af0701311955u18459e3fo4a99c57ee3b88051@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <94d710af0701311955u18459e3fo4a99c57ee3b88051@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On 2/1/07, Sean Qiu 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 Java > Spec\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 Java Spec\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 Java Spec\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 Java Spec\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 >