diff options
author | Mickael Istria | 2021-12-05 19:11:04 +0000 |
---|---|---|
committer | Mickael Istria | 2021-12-05 20:17:09 +0000 |
commit | df53e189e6ea00c6e2bbc5906266d0ccd6a61440 (patch) | |
tree | 9de239964e44c6d0223342b84ded84ce7a16a56d | |
parent | c825fa54abe11fef6d0b8e866a327fd640863b3d (diff) | |
download | rt.equinox.p2-I20211208-1800.tar.gz rt.equinox.p2-I20211208-1800.tar.xz rt.equinox.p2-I20211208-1800.zip |
Fix testMetadataCachingLocalRepoI20211208-1800I20211207-1800I20211206-1800I20211205-1800
As content.xml.xz is now used, and then XZedSimpleMetadataRepository,
the cached file path differs and test needs to be updated.
Change-Id: I0b56179e371acf95aefbc34fb1256cb46d74227e
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/188554
Tested-by: Equinox Bot <equinox-bot@eclipse.org>
Reviewed-by: Mickael Istria <mistria@redhat.com>
-rw-r--r-- | bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java index 22f8f9150..6ac039147 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java @@ -387,17 +387,14 @@ public class MetadataRepositoryManagerTest extends AbstractProvisioningTest { IAgentLocation agentLocation = ServiceHelper.getService(TestActivator.getContext(), IAgentLocation.class); URI dataArea = agentLocation.getDataArea("org.eclipse.equinox.p2.repository/cache/"); File dataAreaFile = URIUtil.toFile(dataArea); - File cacheFileXML = new File(dataAreaFile, "content" + repoLocation.hashCode() + ".xml"); - File cacheFileJAR = new File(dataAreaFile, "content" + repoLocation.hashCode() + ".jar"); - File cacheFile; + File cacheFile = new File(dataAreaFile, + Integer.toString(URIUtil.append(repoLocation, "content.xml.xz").hashCode())); // as implemented in + // XZedSimpleMetadataRepository + // and CacheManager // load a remote repository and check that a local cache was created manager.loadRepository(repoLocation, null); - assertTrue("Cache file was not created.", cacheFileXML.exists() || cacheFileJAR.exists()); - if (cacheFileXML.exists()) - cacheFile = cacheFileXML; - else - cacheFile = cacheFileJAR; + assertTrue("Cache file was not created.", cacheFile.exists()); // modify the last modified date to be older than the remote file cacheFile.setLastModified(0); |