Community
Participate
Working Groups
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.
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).
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.
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.
Created attachment 4171 [details] patch for org.eclipse.core.tests.resources Sorry, wrong file...
Released to HEAD.