Bug 202788 - [Tests] Failure in nightly build due to URL protocol
Summary: [Tests] Failure in nightly build due to URL protocol
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Michael Valenta CLA
QA Contact:
URL:
Whiteboard: hasPatch
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-09-10 09:47 EDT by Michael Valenta CLA
Modified: 2007-09-21 03:33 EDT (History)
1 user (show)

See Also:


Attachments
Fix (10.54 KB, patch)
2007-09-13 09:00 EDT, Tomasz Zarna CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2007-09-10 09:47:32 EDT
It appears that the URL returned by getClass().getResource() does not have the "file" protocol when used by the build test harness. This results in the following failure (which doesn't occur when the test is run locally).

junit.framework.AssertionFailedError
at org.eclipse.compare.tests.PatchTest.testPatchdataSubfolders(PatchTest.java:185)
Comment 1 Michael Valenta CLA 2007-09-10 10:01:07 EDT
I have modified the test so it exits if the protocol is not "file". We should still investigate how to implement the test so it can run during the build.
Comment 2 Michael Valenta CLA 2007-09-10 10:47:00 EDT
The protocol in the tests is "jar". I suspect the test will need to be rewritten so that it doesn't dynamically determine the test input.
Comment 3 Tomasz Zarna CLA 2007-09-13 09:00:15 EDT
Created attachment 78304 [details]
Fix

The patch handles both cases when url protocol is "file" or "jar". I've tested using JUnit tests launched from the command line (the same way it's tested over the big water). I did it on both Windows and Linux. Michael, you have also suggested some additional improvements of the test like collecting the results for the subfolders (to ensure that all tests are run in opposite to a situation when a test fails for some case from first subfolder). I hope you don't mind if I log a separate bug for it.
Comment 4 Michael Valenta CLA 2007-09-13 11:53:20 EDT
I've released the patch. We'll see what happens tonight ;-)
Comment 5 Szymon Brandys CLA 2007-09-18 03:36:13 EDT
Verified in I20070917-1800.