Community
Participate
Working Groups
After several discussions regarding the new message extension and some request and latest patches, it seems to be a good idea to introduce additional test cases.
Gerrit review: https://git.eclipse.org/r/#/c/19150/ PW
I get 3 failures with the new NLSTests: CoreTestSuite TestSuite with 214 tests [example: org.eclipse.e4.core.internal.tests.di.extensions.InjectionPreferencesTest] org.eclipse.e4.core.internal.tests.nls.NLSTest testResourcesBundleUseDefaultLocaleForInvalidLocale(org.eclipse.e4.core.internal.tests.nls.NLSTest) junit.framework.ComparisonFailure: expected:<Resource[Nachricht]> but was:<Resource[sMessage]> at junit.framework.Assert.assertEquals(Assert.java:100) at junit.framework.Assert.assertEquals(Assert.java:107) at junit.framework.TestCase.assertEquals(TestCase.java:269) at org.eclipse.e4.core.internal.tests.nls.NLSTest.testResourcesBundleUseDefaultLocaleForInvalidLocale(NLSTest.java:613) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at junit.framework.TestCase.runTest(TestCase.java:176) at junit.framework.TestCase.runBare(TestCase.java:141) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:129) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1450) at org.eclipse.equinox.launcher.Main.main(Main.java:1426) testBundleMessages(org.eclipse.e4.core.internal.tests.nls.NLSTest) junit.framework.ComparisonFailure: expected:<[BundleMessage]> but was:<[!message!]> at junit.framework.Assert.assertEquals(Assert.java:100) at junit.framework.Assert.assertEquals(Assert.java:107) at junit.framework.TestCase.assertEquals(TestCase.java:269) at org.eclipse.e4.core.internal.tests.nls.NLSTest.testBundleMessages(NLSTest.java:299) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at junit.framework.TestCase.runTest(TestCase.java:176) at junit.framework.TestCase.runBare(TestCase.java:141) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:129) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1450) at org.eclipse.equinox.launcher.Main.main(Main.java:1426) testBundleMessagesSkipDefaultLocaleForEquinoxRoot(org.eclipse.e4.core.internal.tests.nls.NLSTest) junit.framework.ComparisonFailure: expected:<[BundleMessage]> but was:<[!message!]> at junit.framework.Assert.assertEquals(Assert.java:100) at junit.framework.Assert.assertEquals(Assert.java:107) at junit.framework.TestCase.assertEquals(TestCase.java:269) at org.eclipse.e4.core.internal.tests.nls.NLSTest.testBundleMessagesSkipDefaultLocaleForEquinoxRoot(NLSTest.java:355) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at junit.framework.TestCase.runTest(TestCase.java:176) at junit.framework.TestCase.runBare(TestCase.java:141) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:129) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1450) at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
That's really strange. But it's always strange when you are testing locales on different machines, with different OS and locale settings. So let's have a look: testBundleMessages() and testBundleMessagesSkipDefaultLocaleForEquinoxRoot() seem to not finding the OSGi resource bundle in OSGI-INF/l10n for Locale en. As the other testcases are working for loading the OSGi resource bundle for Locale de, the issue seem to be in some environment setting. testResourcesBundleUseDefaultLocaleForInvalidLocale() seems to not using the default Locale I set before running the tests. To be more precise, the test case asks for a resourcebundle with Locale fr. But there is no such resourcebundle, so it should use the default Locale as fallback. As I set it to de to verify I wonder why it does not use the default Locale as fallback in that case. Do you see the equinox.root.locale system property when running the test cases? And if so, which value does it have?
(In reply to Dirk Fauth from comment #3) > Do you see the equinox.root.locale system property when running the test > cases? And if so, which value does it have? System.getProperty("equinox.root.locale") returns null PW
That's what I expected it should be. Maybe it is some race condition and a test case modifies a default value that is not resetted before the next test case. I added a setUp() and tearDown() to ensure the states and pushed it to Gerrit. Could you please test again to see if that was the issue?
(In reply to Dirk Fauth from comment #5) > > I added a setUp() and tearDown() to ensure the states and pushed it to > Gerrit. Could you please test again to see if that was the issue? The setUp/tearDown unfortunately didn't help with the 3 failing testcases. PW
Could you please try to update the BREE to 1.6 temporary in your environment to see if it is related to the Java version? I'm running out of ideas as I even set the default Locale in setUp() to en to ensure a solid test state. And it can only be related to either the default locale or the equinox.root.locale. Has anything changed in Equinox regarding that stuff that I haven't got in my workspace possibly?
I'm working in the latest Luna I build. The test NLSTest.testSimpleMessagesSkipDefaultLocaleForEquinoxRoot() line: 120 seems to wipe out the class org.eclipse.e4.core.internal.tests.nls.BundleMessages class. The set is triggering a re-evaluation of a trackable computation. It makes it down to ResourceBundleHelper.getEquinoxResourceBundle and this time the new local "en" matches the equinoxLocale "en" so it takes a different path. On Line 239 it returns a ResourceBundle$MissingBundle (instead of null, which worked for BundleMessage the first time and allowed it to pick up the bundle.properties). Thread [main] (Suspended) ResourceBundleHelper.getEquinoxResourceBundle(String, Locale, ClassLoader) line: 242 MessageFactoryServiceImpl.createInstance(Locale, Class<M>, Message, BundleLocalization) line: 169 MessageFactoryServiceImpl.getMessageInstance(Locale, Class<M>, BundleLocalization) line: 97 TranslationObjectSupplier.getMessageInstance(Class<?>) line: 128 TranslationObjectSupplier.get(IObjectDescriptor, IRequestor, boolean, boolean) line: 74 InjectorImpl.resolveArgs(Requestor, PrimaryObjectSupplier, PrimaryObjectSupplier, boolean, boolean, boolean) line: 455 InjectorImpl.resolveArguments(IRequestor, boolean) line: 355 FieldRequestor(Requestor).resolveArguments(boolean) line: 128 TranslationObjectSupplier.notifyRequestor(Collection<IRequestor>) line: 166 TranslationObjectSupplier.updateMessages() line: 114 TranslationObjectSupplier.setLocale(String) line: 105 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 60 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 37 Method.invoke(Object, Object...) line: 611 MethodRequestor.execute() line: 56 ContextObjectSupplier$ContextInjectionListener.update(IEclipseContext, int, Object[]) line: 88 TrackableComputationExt.update(ContextChangeEvent) line: 107 EclipseContextOSGi(EclipseContext).processScheduled(Set<Scheduled>) line: 334 EclipseContextOSGi(EclipseContext).set(String, Object) line: 348 NLSTest.testSimpleMessagesSkipDefaultLocaleForEquinoxRoot() line: 120 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 60 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 37 Method.invoke(Object, Object...) line: 611 NLSTest(TestCase).runTest() line: 176 NLSTest(TestCase).runBare() line: 141 TestResult$1.protect() line: 122 TestResult.runProtected(Test, Protectable) line: 142 TestResult.run(TestCase) line: 125 NLSTest(TestCase).run(TestResult) line: 129 TestSuite.runTest(Test, TestResult) line: 255 TestSuite.run(TestResult) line: 250 CoreTestSuite(TestSuite).runTest(Test, TestResult) line: 255 CoreTestSuite(TestSuite).run(TestResult) line: 250 SuiteMethod(JUnit38ClassRunner).run(RunNotifier) line: 84 JUnit4TestClassReference(JUnit4TestReference).run(TestExecution) line: 50 TestExecution.run(ITestReference[]) line: 38 RemotePluginTestRunner(RemoteTestRunner).runTests(String[], String, TestExecution) line: 459 RemotePluginTestRunner(RemoteTestRunner).runTests(TestExecution) line: 675 RemotePluginTestRunner(RemoteTestRunner).run() line: 382 RemotePluginTestRunner.main(String[]) line: 62 CoreTestApplication.run(Object) line: 23 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 60 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 37 Method.invoke(Object, Object...) line: 611 EclipseAppContainer.callMethodWithException(Object, String, Class[], Object[]) line: 587 EclipseAppHandle.run(Object) line: 198 EclipseAppLauncher.runApplication(Object) line: 109 EclipseAppLauncher.start(Object) line: 80 EclipseStarter.run(Object) line: 372 EclipseStarter.run(String[], Runnable) line: 226 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 60 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 37 Method.invoke(Object, Object...) line: 611 Main.invokeFramework(String[], URL[]) line: 636 Main.basicRun(String[]) line: 591 Main.run(String[]) line: 1450 Main.main(String[]) line: 1426
(In reply to Dirk Fauth from comment #7) > Could you please try to update the BREE to 1.6 temporary in your environment > to see if it is related to the Java version? Moving the BREE up to 1.6 didn't help with the tests. PW
"it returns a ResourceBundle$MissingBundle" What is a ResourceBundle$MissingBundle? Searching for that via Google only retrieves some results regarding Android or Apache. But I never heard of it in JavaSE itself. Where does this come from?
It's part of the 1.6 JRE: java.util.ResourceBundle.MissingBundle PW
"It's part of the 1.6 JRE: java.util.ResourceBundle.MissingBundle" I can't validate that. I'm working with Java 1.6 Update 45 and Java 1.7 Update 45 from Oracle on a Windows OS. In both JREs there is no such class. And returning such a class would violate the specification in ResourecBundle.getBundle() where it says: "If no result resource bundle has been found, a <code>MissingResourceException</code> is thrown." Ich checked the sources, tried to find the class via IDE, searched for the String "MissingBundle" in the java.util.ResourceBundle class. But there is no MissingBundle. Maybe I'm blind or not smart enough to find a inner class of a Java default class. But for me, this class does not exist.
(In reply to Dirk Fauth from comment #12) > Maybe I'm blind or not smart enough to find a inner class of a Java default > class. But for me, this class does not exist. I don't see it in JRE either. Googling for it, I found a similar class in Harmony http://people.apache.org/~tellison/classlib_doc/html/classjava_1_1util_1_1ResourceBundle_1_1MissingBundle.html
Ah, OK. It looks like it's in the IBM SDKs. My Oracle java 7 runs the tests fine. I'll dig up an Oracle java 6 and retest today. PW
Released as http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=fbc28885dd1a3d35ff80467aab7437d22e1328b9 Seems there's a problem with what the IBM Java6 JRE returns when a bundle is missing. IBM Java7 and Oracle Java6 and Java7 all work correctly. I didn't release the second fix, it can be abandoned. PW
We now have 4 test failures on all 3 platforms. I assume this is caused by this fix. http://download.eclipse.org/eclipse/downloads/drops4/N20131203-2000/testresults/html/org.eclipse.e4.core.tests_linux.gtk.x86_6.0.html
Might be related to the missing entry for the resources folder in the build.properties as Paul already mentioned. There should be two additional contributions in Gerrit. The first adds setUp() and tearDown() to the test class. The second adds the resources folder in build.properties. In Gerrit I only see the setUp() / tearDown() patch I contributed, the following contribution containing the modification to the build.properties seem to be not there.
(In reply to Dirk Fauth from comment #17) > Might be related to the missing entry for the resources folder in the > build.properties as Paul already mentioned. I've committed http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=95aa44634948ebae940c076313fa928ce54f7d95 to update build.properties. Dirk, does that look like it? PW
Looks good to me. Hopefully this fixes the builds. :) Thanks Paul for you help!
Looks good in N20131204-2000.
Still good in http://download.eclipse.org/eclipse/downloads/drops4/I20131210-2000/testresults/html/org.eclipse.e4.core.tests_linux.gtk.x86_6.0.html PW