Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 222895 - [CheatSheet] Failing Junit tests in I20080314-1059
Summary: [CheatSheet] Failing Junit tests in I20080314-1059
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 3.4 M6   Edit
Assignee: platform-ua-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-16 13:50 EDT by Chris Goldthorpe CLA
Modified: 2008-03-17 10:23 EDT (History)
2 users (show)

See Also:


Attachments
patch (14.66 KB, patch)
2008-03-16 19:51 EDT, Chris Goldthorpe CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Goldthorpe CLA 2008-03-16 13:50:31 EDT
57 Junit tests are failing, see http://download.eclipse.org/eclipse/downloads/drops/I20080314-1059/testResults.php

This is due to the two functions org.eclipse.ua.tests.util.ResourceFinder.findFile(Plugin, String)

and org.eclipse.ua.tests.util.ResourceFinder.findFiles(Plugin, String, String, boolean) both of which have started returning incorrect results since P2 was introduced.
Comment 1 Chris Goldthorpe CLA 2008-03-16 15:01:23 EDT
Test org.eclipse.ua.tests.help.dynamic.XMLProcessorTest.testXMLProcessor() is not showing up as a failure but is not behaving correctly. The test looks for all xml files in a particular directory and performs a check on each one. No tests are found and the test passes without performing the necessary checks on each file.
Comment 2 David Williams CLA 2008-03-16 15:21:27 EDT
I'll be anxiously awaiting the details of the assumptions and fixes made here ... I suspect we have lots of similar cases in WTP ... perhaps in code, and not just tests! 

Comment 3 Chris Goldthorpe CLA 2008-03-16 19:51:22 EDT
Created attachment 92667 [details]
patch

This fixes the failing tests. Rather than search for all of the files in a directory with a particular extension I have recoded some of the tests to hard code the names of the test cases, this was the test does not rely as heavily on the file finding algorithm.
Comment 4 John Arthorne CLA 2008-03-16 23:07:48 EDT
The change we made in the tests was to install the test plug-ins under eclipse/dropins/eclipse/plugins rather than directly in eclipse/plugins, so that they would be discovered automatically on startup. Ultiimately we'd like to leverage p2 within the test setup and install test plugins directly into eclipse/plugins again. This was just the quickest and least disruptive way to get the tests working with p2 (so we thought).  We ran various platform and JDT tests this was and they were all successful, but it turns out there are a few tests that are making assumptions about the location of test plugins on disk.  Tests should instead  be using org.eclipse.core.runtime.FileLocator to ask the platform for artifacts in the plugin install directory rather than assuming it is eclipse/plugins. Chris, if you have more trouble with this, feel free to ping me or DJ tomorrow for further assistance.
Comment 5 Chris Goldthorpe CLA 2008-03-17 10:23:24 EDT
This is now fixed, the tests all passed on N20080316-2000 on Windows.