diff options
author | Krzysztof Daniel | 2013-10-15 09:55:02 +0000 |
---|---|---|
committer | Krzysztof Daniel | 2013-11-12 10:34:07 +0000 |
commit | 9a19f67ab9627abe35eb9eced7040e072b787ac5 (patch) | |
tree | 02f9c750fa4cbdce95b1da8484bb7b8b7c052aa5 | |
parent | f693727e2f0e363c02d47fae7997f4a2aa99f37e (diff) | |
download | rt.equinox.p2-9a19f67ab9627abe35eb9eced7040e072b787ac5.tar.gz rt.equinox.p2-9a19f67ab9627abe35eb9eced7040e072b787ac5.tar.xz rt.equinox.p2-9a19f67ab9627abe35eb9eced7040e072b787ac5.zip |
Bug 419418: testSimpleRepositoryPerformanceOnLoadReadonlyLocalRepositoryI20131112-0800
fails when invoked with maven surefire
Tests rely on changing privileges, which cannot be changed without
platform. Platform can't be installed into surefire, because it depends
on bundles in the reactor, and would cause circular dependencies. So,
the proper way is to use File API to manage file attributes.
Change-Id: I93ab9eaaf9891b265e0ef4fbabe3f22a66616738
Signed-off-by: Krzysztof Daniel <kdaniel@redhat.com>
-rw-r--r-- | bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java index f5a9171e0..ee795e22c 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java @@ -14,8 +14,8 @@ import java.io.File; import java.net.URI; import java.net.URISyntaxException; import java.util.*; -import org.eclipse.core.filesystem.*; -import org.eclipse.core.runtime.*; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Platform; import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.query.IQueryResult; @@ -39,16 +39,13 @@ public class Bug351944 extends AbstractProvisioningTest { * it doesn't work on Windows to make a folder read-only then can't create * new file in it */ - private void changeWritePermission(File target, boolean canWrite) throws CoreException { + private void changeWritePermission(File target, boolean canWrite) { if (target.exists()) { - IFileStore fileStore = EFS.getLocalFileSystem().getStore(target.toURI()); - IFileInfo fileInfo = fileStore.fetchInfo(); - fileInfo.setAttribute(EFS.ATTRIBUTE_GROUP_WRITE, canWrite); - fileInfo.setAttribute(EFS.ATTRIBUTE_OWNER_WRITE, canWrite); - fileStore.putInfo(fileInfo, EFS.SET_ATTRIBUTES, new NullProgressMonitor()); + target.setWritable(canWrite); if (target.isDirectory()) { - for (File child : target.listFiles()) - changeWritePermission(child, canWrite); + for (File child : target.listFiles()) { + child.setWritable(canWrite); + } } } } |