Bug 324248

Summary: p2 test failures running with ECF from HEAD
Product: [Eclipse Project] Equinox Reporter: John Arthorne <john.arthorne>
Component: p2Assignee: DJ Houghton <dj.houghton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, irbull, slewis
Version: 3.6Keywords: test
Target Milestone: 3.7 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 341290    
Attachments:
Description Flags
patch for tests none

Description John Arthorne CLA 2010-09-01 17:04:55 EDT
Some recent changes in ECF appear to be causing p2 test failures. When we adopt the latest ECF it will cause build failures so these need to be fixed.

From a quick look, it appears that ECF is returning different exceptions from what it used to. For example, instead of MalformedURLException they throw RemoteFileSystemException. It's not clear if this is an API change or if we're just being too fussy in our tests.

Failure 1:

org.eclipse.equinox.p2.tests.ant.CompositeRepositoryTaskTest
testInvalidLocation(org.eclipse.equinox.p2.tests.ant.CompositeRepositoryTaskTest)
junit.framework.AssertionFailedError: Expected MalformedURLException.: org.eclipse.core.runtime.CoreException: C:\1target\junit2-workspace\testInvalidLocation\build_testInvalidLocation.xml:4: org.eclipse.equinox.p2.core.ProvisionException: Unable to read repository at scheme:/location/artifacts.xml.

Failure 2:

org.eclipse.equinox.p2.tests.ant.MirrorTaskTest
testMirrorWithInvalidSource(org.eclipse.equinox.p2.tests.ant.MirrorTaskTest)
junit.framework.AssertionFailedError: Unexpected error

Failure 3:

org.eclipse.equinox.p2.tests.metadata.repository.AllTests
org.eclipse.equinox.p2.tests.metadata.repository.MetadataRepositoryManagerTest
testFailedConnection(org.eclipse.equinox.p2.tests.metadata.repository.MetadataRepositoryManagerTest)
junit.framework.AssertionFailedError: expected:<1006> but was:<1002>
Comment 1 Scott Lewis CLA 2010-09-01 17:46:08 EDT
I believe these exception type changes were part of the ECF filetransfer API changes early in the Helios release cycle (approx fall of 2009...and it may have been as long ago as spring 2009).  They were planned (and implemented by Henrik Kraemer I believe), and so I think the answer to this bug is that these tests need to be reworked to expect/catch the appropriate exception type.

Note we haven't changed any of this behavior since approx fall 2009...and certainly not since Helios...so I don't understand what latest means here (we haven't had a new contribution since before Helios)
Comment 2 John Arthorne CLA 2010-09-02 10:34:43 EDT
The failures are reproducible using ECF HEAD, but not reproducible using the ECF in the Helios release.
Comment 3 Scott Lewis CLA 2010-09-02 10:44:47 EDT
(In reply to comment #2)
> The failures are reproducible using ECF HEAD, but not reproducible using the
> ECF in the Helios release.

Could you make the details of at least one of the failures (i.e. what the test is doing) clear on this bug?  Thanks.
Comment 4 DJ Houghton CLA 2011-05-03 12:22:31 EDT
There are currently 3 failures when running against the bundles in ECF 3.5.


All p2 Tests
org.eclipse.equinox.p2.tests.AutomatedTests
org.eclipse.equinox.p2.tests.ant.AllTests
org.eclipse.equinox.p2.tests.ant.CompositeRepositoryTaskTest
testInvalidLocation(org.eclipse.equinox.p2.tests.ant.CompositeRepositoryTaskTest)
junit.framework.AssertionFailedError: Expected MalformedURLException.: org.eclipse.core.runtime.CoreException: /Users/equinox/workspaces/junit2-workspace/testInvalidLocation/build_testInvalidLocation.xml:4: org.eclipse.equinox.p2.core.ProvisionException: Unable to read repository at scheme:/location/artifacts.xml.
	at junit.framework.Assert.fail(Assert.java:47)
	at org.eclipse.equinox.p2.tests.AbstractProvisioningTest.fail(AbstractProvisioningTest.java:639)
	at org.eclipse.equinox.p2.tests.ant.CompositeRepositoryTaskTest.testInvalidLocation(CompositeRepositoryTaskTest.java:393)
	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:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at org.eclipse.equinox.p2.tests.AbstractProvisioningTest.runTest(AbstractProvisioningTest.java:929)
	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:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	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:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	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:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	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:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

org.eclipse.equinox.p2.tests.ant.MirrorTaskTest
testMirrorWithInvalidSource(org.eclipse.equinox.p2.tests.ant.MirrorTaskTest)
junit.framework.ComparisonFailure: Unexpected error expected:<[Invalid source repository location: invalid:/scheme2].> but was:<[Unable to read repository at invalid:/scheme2/artifacts.xml].>
	at junit.framework.Assert.assertEquals(Assert.java:81)
	at org.eclipse.equinox.p2.tests.ant.MirrorTaskTest.testMirrorWithInvalidSource(MirrorTaskTest.java:310)
	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:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at org.eclipse.equinox.p2.tests.AbstractProvisioningTest.runTest(AbstractProvisioningTest.java:929)
	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:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	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:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	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:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	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:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

org.eclipse.equinox.p2.tests.metadata.repository.AllTests
org.eclipse.equinox.p2.tests.metadata.repository.MetadataRepositoryManagerTest
testFailedConnection(org.eclipse.equinox.p2.tests.metadata.repository.MetadataRepositoryManagerTest)
junit.framework.AssertionFailedError: expected:<1006> but was:<1002>
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.failNotEquals(Assert.java:283)
	at junit.framework.Assert.assertEquals(Assert.java:64)
	at junit.framework.Assert.assertEquals(Assert.java:195)
	at junit.framework.Assert.assertEquals(Assert.java:201)
	at org.eclipse.equinox.p2.tests.metadata.repository.MetadataRepositoryManagerTest.testFailedConnection(MetadataRepositoryManagerTest.java:129)
	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:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at org.eclipse.equinox.p2.tests.AbstractProvisioningTest.runTest(AbstractProvisioningTest.java:929)
	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:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	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:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	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:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	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:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 5 Scott Lewis CLA 2011-05-03 13:49:53 EDT
(In reply to comment #4)
> There are currently 3 failures when running against the bundles in ECF 3.5.
> 
> 
> All p2 Tests
> org.eclipse.equinox.p2.tests.AutomatedTests
> org.eclipse.equinox.p2.tests.ant.AllTests
> org.eclipse.equinox.p2.tests.ant.CompositeRepositoryTaskTest
> testInvalidLocation(org.eclipse.equinox.p2.tests.ant.CompositeRepositoryTaskTest)
> junit.framework.AssertionFailedError: Expected MalformedURLException.:

I believe this is simply because MalformedURLException is not the exception type thrown any longer...due to an addition for supporting URIs in addition to URLs (so scheme:/location/artifacts.xml is now OK as URI).

<stuff deleted>

> org.eclipse.equinox.p2.tests.ant.MirrorTaskTest
> testMirrorWithInvalidSource(org.eclipse.equinox.p2.tests.ant.MirrorTaskTest)
> junit.framework.ComparisonFailure: Unexpected error expected:<[Invalid source
> repository location: invalid:/scheme2].> but was:<[Unable to read repository at

This seems like it could be the same issue as the first test...i.e. expecting a certain exception type for an invalid location.

<stuff deleted>

> testFailedConnection(org.eclipse.equinox.p2.tests.metadata.repository.MetadataRepositoryManagerTest)
> junit.framework.AssertionFailedError: expected:<1006> but was:<1002>

This I don't understand...what are the meaning of the numbers 1006 and 1002?
Comment 6 DJ Houghton CLA 2011-05-03 13:53:45 EDT
Thanks Scott.

These look like the status codes in the nested status inside the CoreException. It used to be ProvisionException.REPOSITORY_INVALID_LOCATION (1006) but now it is ProvisionException.REPOSITORY_FAILED_READ (1002).

I'll take a look at changing the tests.
Comment 7 DJ Houghton CLA 2011-05-03 14:27:38 EDT
Created attachment 194621 [details]
patch for tests
Comment 8 DJ Houghton CLA 2011-05-03 14:52:20 EDT
Patch released along with updates to map file to consume latest ECF. 
Running test build on Hudson and will back out if things fail.
Note this means that running the tests from HEAD will require you to have ECF 3.5 in your workspace or target.
Comment 9 DJ Houghton CLA 2011-05-03 19:53:17 EDT
The test build with the new ECF ran ok and although the tests didn't run, I'm confident with these changes. Closing.