Bug 12359 - [resources] Tests and the libraries
Summary: [resources] Tests and the libraries
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: Other other
: P3 normal (vote)
Target Milestone: 2.1 RC3   Edit
Assignee: Rafael Chaves CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2002-03-27 11:00 EST by DJ Houghton CLA
Modified: 2003-03-17 15:09 EST (History)
0 users

See Also:


Attachments
patch for core.tests.resources (5.01 KB, patch)
2003-03-14 16:33 EST, Rafael Chaves CLA
no flags Details | Diff
patch for core.tests.resources (2.63 KB, patch)
2003-03-14 17:54 EST, Rafael Chaves CLA
no flags Details | Diff
patch for org.eclipse.core.tests.resources (7.32 KB, patch)
2003-03-17 09:48 EST, Rafael Chaves CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2002-03-27 11:00:30 EST
We need to ensure that our test suites run both with and without the core 
libraries present.

Specifically, there are tests which set the readonly flag on a file which will 
fail if using java.io.File. This failure should be expected if the library is 
not present so we need to do a check beforehand to see if we are using a 
library or default java behaviour.
Comment 1 Rafael Chaves CLA 2003-03-14 16:33:34 EST
Created attachment 4146 [details]
patch for core.tests.resources

Adds a guard before test cases that use IResource#setReadOnly or
CoreFileSystemLibray#setReadOnly. The guard will avoid running these tests when
there is no support for unsetting the read-only attribute of a file/directory
(i.e. there is no natives). No tests fail in the absence of natives on Windows
(will check on Linux).

There is still no-op tests that could be enabled if we added checks for natives
presence and the OS we are running on (see ...resources.regression.IFileTest).

Due to bug 34840, in order to run the tests without natives using PDE JUnit
plug-in, one must disable the natives from the Eclipse instance as well (or
from the fragment project in the workspace, if present).
Comment 2 DJ Houghton CLA 2003-03-14 17:21:33 EST
Released the attached patch except for:
  FileSystemStoreTest.testCopyFile

In this test method we should not be skipping the whole method if we are not 
running with the natives, we should only skip the particular part of the test 
where we need to be read-only. So rather than:
   if (!CoreFileSystemLibrary.usingNatives())
      return;
we should be using:
   if (CoreFileSystemLibrary.usingNatives()) {
      // run the tests which use #setReadOnly
   }

Please append a patch based on HEAD for the above listed change.
Thanks.
Comment 3 Rafael Chaves CLA 2003-03-14 17:54:46 EST
Created attachment 4155 [details]
patch for core.tests.resources

Contains DJ's proposal and some changes to the commentary that precedes tests
that need to set resources as read-only.

Tests with no-natives also run on Linux.
Comment 4 Rafael Chaves CLA 2003-03-17 09:48:00 EST
Created attachment 4171 [details]
patch for org.eclipse.core.tests.resources

Sorry, wrong file...
Comment 5 DJ Houghton CLA 2003-03-17 15:09:25 EST
Released to HEAD.