summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMengxin Zhu2011-12-15 01:44:48 (EST)
committerMengxin Zhu2011-12-15 01:57:00 (EST)
commit8f29ae39f0a2e4692730b8a79f998f605d565e2f (patch)
treecde36d5ee018d0d4d853a58284f7c5ef0fdb0f70
parent2374a024cc4a2e933df2fd680be9b8733e3a0de9 (diff)
downloadrt.equinox.p2-8f29ae39f0a2e4692730b8a79f998f605d565e2f.zip
rt.equinox.p2-8f29ae39f0a2e4692730b8a79f998f605d565e2f.tar.gz
rt.equinox.p2-8f29ae39f0a2e4692730b8a79f998f605d565e2f.tar.bz2
Bug 366668 - Test case 'testSimpleRepositoryPerformanceOnLoadReadonlyLocalRepository' fails on Windows.v20111215-0657
Disable case 'testSimpleRepositoryPerformanceOnLoadReadonlyLocalRepository' on Windows. There is no way to create a test folder on Windows then new file can't be created in it. Signed-off-by: Mengxin Zhu <kane.zhu@windriver.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java45
1 files changed, 25 insertions, 20 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 2b9abfe..f5a9171 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
@@ -15,8 +15,7 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
import org.eclipse.core.filesystem.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.*;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.query.IQueryResult;
@@ -36,6 +35,10 @@ public class Bug351944 extends AbstractProvisioningTest {
changeWritePermission(artifactRepoFile, false);
}
+ /**
+ * 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 {
if (target.exists()) {
IFileStore fileStore = EFS.getLocalFileSystem().getStore(target.toURI());
@@ -58,28 +61,30 @@ public class Bug351944 extends AbstractProvisioningTest {
}
public void testSimpleRepositoryPerformanceOnLoadReadonlyLocalRepository() throws ProvisionException, URISyntaxException {
- final URI testRepo = artifactRepoFile.toURI();
- IArtifactRepositoryManager artifactRepositoryManager = getArtifactRepositoryManager();
- IArtifactRepository repo = artifactRepositoryManager.loadRepository(testRepo, new NullProgressMonitor());
- IQueryResult<IArtifactKey> allArtifactKeys = repo.query(ArtifactKeyQuery.ALL_KEYS, new NullProgressMonitor());
- Set<IArtifactKey> keySet = allArtifactKeys.toUnmodifiableSet();
+ if (!Platform.OS_WIN32.equals(Platform.getOS())) {
+ final URI testRepo = artifactRepoFile.toURI();
+ IArtifactRepositoryManager artifactRepositoryManager = getArtifactRepositoryManager();
+ IArtifactRepository repo = artifactRepositoryManager.loadRepository(testRepo, new NullProgressMonitor());
+ IQueryResult<IArtifactKey> allArtifactKeys = repo.query(ArtifactKeyQuery.ALL_KEYS, new NullProgressMonitor());
+ Set<IArtifactKey> keySet = allArtifactKeys.toUnmodifiableSet();
- Collection<IArtifactRequest> requests = new ArrayList<IArtifactRequest>();
- for (IArtifactKey key : keySet)
- requests.add(artifactRepositoryManager.createMirrorRequest(key, repo, null, null));
+ Collection<IArtifactRequest> requests = new ArrayList<IArtifactRequest>();
+ for (IArtifactKey key : keySet)
+ requests.add(artifactRepositoryManager.createMirrorRequest(key, repo, null, null));
- long start = System.currentTimeMillis();
- IArtifactRequest[] toBeRequests = getRequestsForRepository(repo, requests.toArray(new IArtifactRequest[requests.size()]));
- long end = System.currentTimeMillis();
- long queryArtifactOneByOne = end - start;
+ long start = System.currentTimeMillis();
+ IArtifactRequest[] toBeRequests = getRequestsForRepository(repo, requests.toArray(new IArtifactRequest[requests.size()]));
+ long end = System.currentTimeMillis();
+ long queryArtifactOneByOne = end - start;
- start = System.currentTimeMillis();
- IArtifactRequest[] toBeRequests2 = getRequestsForRepository2(repo, requests.toArray(new IArtifactRequest[requests.size()]));
- end = System.currentTimeMillis();
- long queryAllArtifacts = end - start;
+ start = System.currentTimeMillis();
+ IArtifactRequest[] toBeRequests2 = getRequestsForRepository2(repo, requests.toArray(new IArtifactRequest[requests.size()]));
+ end = System.currentTimeMillis();
+ long queryAllArtifacts = end - start;
- assertEquals("Test case has problem, not find same requests.", toBeRequests.length, toBeRequests2.length);
- assertEquals("Querying artifact key from simple repository has performance issue.", queryAllArtifacts, queryArtifactOneByOne, 10);
+ assertEquals("Test case has problem, not find same requests.", toBeRequests.length, toBeRequests2.length);
+ assertEquals("Querying artifact key from simple repository has performance issue.", queryAllArtifacts, queryArtifactOneByOne, 10);
+ }
}
/**