Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328759 - IDFactory(Service)Test fail in automated test environment
Summary: IDFactory(Service)Test fail in automated test environment
Status: RESOLVED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.test (show other bugs)
Version: 3.4.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Scott Lewis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-26 14:32 EDT by Markus Kuppe CLA
Modified: 2010-10-26 15:29 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Kuppe CLA 2010-10-26 14:32:20 EDT
org.eclipse.ecf.tests.core.identity.IDFactoryServiceTest.testIDFactoryAddNamespace

Error Message

Expected: <null> but was: Namespace[name=org.eclipse.ecf.tests.core.identity.IDFactoryServiceTest;scheme=org.eclipse.ecf.tests.core.identity.IDFactoryServiceTest;description=]

Stacktrace

junit.framework.AssertionFailedError: Expected: <null> but was: Namespace[name=org.eclipse.ecf.tests.core.identity.IDFactoryServiceTest;scheme=org.eclipse.ecf.tests.core.identity.IDFactoryServiceTest;description=]
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at junit.framework.Assert.assertNull(Assert.java:233)
	at junit.framework.Assert.assertNull(Assert.java:226)
	at org.eclipse.ecf.tests.core.identity.IDFactoryServiceTest.testIDFactoryAddNamespace(IDFactoryServiceTest.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:24)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
	at org.pluginbuilder.autotestsuite.junit4.JUnit4TestRunner.runTests(JUnit4TestRunner.java:71)
	at org.pluginbuilder.autotestsuite.junit4.JUnit4TestRunner.runFormatterTests(JUnit4TestRunner.java:54)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runFormatterTests(AutoTestApplication.java:294)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runAllJUnit4Tests(AutoTestApplication.java:271)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runAllJUnitTestsOnUIThread(AutoTestApplication.java:176)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runHeadless(AutoTestApplication.java:159)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.run(AutoTestApplication.java:96)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.start(AutoTestApplication.java:69)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)


org.eclipse.ecf.tests.core.identity.IDFactoryTest.testIDFactoryAddNamespace 

Error Message

Expected: <null> but was: Namespace[name=org.eclipse.ecf.tests.core.identity.IDFactoryTest;scheme=org.eclipse.ecf.tests.core.identity.IDFactoryTest;description=]

Stacktrace

junit.framework.AssertionFailedError: Expected: <null> but was: Namespace[name=org.eclipse.ecf.tests.core.identity.IDFactoryTest;scheme=org.eclipse.ecf.tests.core.identity.IDFactoryTest;description=]
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at junit.framework.Assert.assertNull(Assert.java:233)
	at junit.framework.Assert.assertNull(Assert.java:226)
	at org.eclipse.ecf.tests.core.identity.IDFactoryTest.testIDFactoryAddNamespace(IDFactoryTest.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:24)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
	at org.pluginbuilder.autotestsuite.junit4.JUnit4TestRunner.runTests(JUnit4TestRunner.java:71)
	at org.pluginbuilder.autotestsuite.junit4.JUnit4TestRunner.runFormatterTests(JUnit4TestRunner.java:54)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runFormatterTests(AutoTestApplication.java:294)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runAllJUnit4Tests(AutoTestApplication.java:271)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runAllJUnitTestsOnUIThread(AutoTestApplication.java:176)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.runHeadless(AutoTestApplication.java:159)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.run(AutoTestApplication.java:96)
	at org.pluginbuilder.autotestsuite.application.AutoTestApplication.start(AutoTestApplication.java:69)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383
Comment 1 Scott Lewis CLA 2010-10-26 14:42:57 EDT
Markus, are you going to fix this?  On casual examination this looks to be a bug in the test code (it assumes something about the IDFactory that isn't true in some environments).  An easy fix would be to remove the added Namespace in the test code.
Comment 2 Markus Kuppe CLA 2010-10-26 14:44:48 EDT
The root cause lies in the automated test suite [0]. It executes all tests
twice (one time with junit3, a second time with junit4).

[0] http://www.pluginbuilder.org/
Comment 3 Scott Lewis CLA 2010-10-26 15:02:57 EDT
(In reply to comment #2)
> The root cause lies in the automated test suite [0]. It executes all tests
> twice (one time with junit3, a second time with junit4).
> 
> [0] http://www.pluginbuilder.org/

I suggest that for this bug, we fix the test code so that it is not environment dependent.  In general, tests should be environment dependent anyway...to avoid the very situation we are seeing...test success in most environments but not in automated testing.

But if a bug exists in pluginbuilder...or our usage for the automated tests...then let's open something against plugin builder...or open a bug against ECF releng...or both...whatever is appropriate.

I'll take this...and fix the test, and resolve.
Comment 4 Scott Lewis CLA 2010-10-26 15:04:30 EDT
(In reply to comment #3)
<stuff deleted>
> dependent.  In general, tests should be environment dependent anyway...to avoid

of course I meant 'should *not* be environment dependent...'
Comment 5 Markus Kuppe CLA 2010-10-26 15:05:25 EDT
(In reply to comment #1)
> Markus, are you going to fix this?  On casual examination this looks to be a
> bug in the test code (it assumes something about the IDFactory that isn't true
> in some environments).  An easy fix would be to remove the added Namespace in
> the test code.

Making the tests idempotent would fix this issue.
Comment 6 Scott Lewis CLA 2010-10-26 15:13:28 EDT
(In reply to comment #5)
> (In reply to comment #1)
> > Markus, are you going to fix this?  On casual examination this looks to be a
> > bug in the test code (it assumes something about the IDFactory that isn't true
> > in some environments).  An easy fix would be to remove the added Namespace in
> > the test code.
> 
> Making the tests idempotent would fix this issue.

Fix pushed to master.  Resolving.
Comment 7 Markus Kuppe CLA 2010-10-26 15:29:17 EDT
You missed IDFactoryServiceTest. It is to ~90% identical to IDFactoryTest, thus I have extracted a common abstract superclass and move all identical methods.