Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2010-08-18 15:57:42 +0000
committerPascal Rapicault2010-08-18 15:57:42 +0000
commit25d4506a68edf084ad53e317101671103a570749 (patch)
treee993459596e186dc9a40308d995c5daf6ced2f6e /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact
parent50720f351c6e67222729f406fcdf6a81feccfdd7 (diff)
downloadrt.equinox.p2-25d4506a68edf084ad53e317101671103a570749.tar.gz
rt.equinox.p2-25d4506a68edf084ad53e317101671103a570749.tar.xz
rt.equinox.p2-25d4506a68edf084ad53e317101671103a570749.zip
Bug 313747 - SimpleArtifactRepository fails to transfer files when its location is relative
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
index 8324b7a0d..5ab2f2a24 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
@@ -257,6 +257,25 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
}
}
+ public void testRelativeRepositoryLocation() throws ProvisionException {
+ IArtifactDescriptor descriptor = new ArtifactDescriptor(new ArtifactKey("osgi.bundle", "helloworld", Version.createOSGi(1, 0, 0)));
+ URI repo = getTestData("CorruptedJar repo", "testData/artifactRepo/jarfiles").toURI();
+
+ SimpleArtifactRepository absRepo = (SimpleArtifactRepository) getArtifactRepositoryManager().loadRepository(repo, new NullProgressMonitor());
+ URI absLocation = absRepo.getLocation(descriptor);
+ getArtifactRepositoryManager().removeRepository(repo);
+
+ repo = new File(System.getProperty("user.dir")).toURI().relativize(repo);
+ repo = URI.create("file:" + repo.toString());
+
+ SimpleArtifactRepository repository = (SimpleArtifactRepository) getArtifactRepositoryManager().loadRepository(repo, new NullProgressMonitor());
+
+ URI location = repository.getLocation(descriptor);
+ assertNotNull("NULL Scheme", location.getScheme());
+ assertTrue("File location is relative", location.isAbsolute());
+ assertEquals("Path from relative & absolute repos differ", absLocation, location);
+ }
+
private static class TestDescriptor implements IArtifactDescriptor {
private static final IProcessingStepDescriptor[] steps = new IProcessingStepDescriptor[0];
private IArtifactKey artifactKey;

Back to the top