use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class LocalArtifactRepositoryTest method getMavenLocation.
@Test
public void getMavenLocation() {
LocalArtifactRepository repo = new LocalArtifactRepository(localRepoIndices);
ArtifactDescriptor desc = newBundleArtifactDescriptor(true);
Assert.assertEquals(new File(baseDir, "group/org.eclipse.tycho.test.maven/1.0.0/org.eclipse.tycho.test.maven-1.0.0.jar"), repo.internalGetArtifactStorageLocation(desc));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class LocalArtifactRepositoryTest method addP2Artifact.
@Test
public void addP2Artifact() throws Exception {
LocalArtifactRepository repo = new LocalArtifactRepository(localRepoIndices);
ArtifactDescriptor desc = newBundleArtifactDescriptor(false);
writeDummyArtifact(repo, desc);
Assert.assertTrue(new File(baseDir, "p2/osgi/bundle/org.eclipse.tycho.test.p2/1.0.0/org.eclipse.tycho.test.p2-1.0.0.jar").exists());
Assert.assertTrue(repo.contains(desc.getArtifactKey()));
Assert.assertTrue(repo.contains(desc));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class LocalArtifactRepositoryTest method reload.
@Test
public void reload() throws Exception {
LocalArtifactRepository repo = new LocalArtifactRepository(localRepoIndices);
ArtifactDescriptor mavenArtifact = newBundleArtifactDescriptor(true);
ArtifactDescriptor p2Artifact = newBundleArtifactDescriptor(false);
writeDummyArtifact(repo, mavenArtifact);
writeDummyArtifact(repo, p2Artifact);
repo.save();
repo = new LocalArtifactRepository(localRepoIndices);
Assert.assertTrue(repo.contains(mavenArtifact.getArtifactKey()));
Assert.assertTrue(repo.contains(p2Artifact.getArtifactKey()));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class LocalArtifactRepositoryTest method addMavenArtifact.
@Test
public void addMavenArtifact() throws Exception {
LocalArtifactRepository repo = new LocalArtifactRepository(localRepoIndices);
ArtifactDescriptor desc = newBundleArtifactDescriptor(true);
writeDummyArtifact(repo, desc);
Assert.assertTrue(new File(baseDir, "group/org.eclipse.tycho.test.maven/1.0.0/org.eclipse.tycho.test.maven-1.0.0.jar").exists());
Assert.assertTrue(repo.contains(desc.getArtifactKey()));
Assert.assertTrue(repo.contains(desc));
}
use of org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor in project tycho by eclipse.
the class LocalArtifactRepositoryTest method testOutdatedIndex.
@Test
public void testOutdatedIndex() {
// create Repo with single artifact
LocalArtifactRepository repo = new LocalArtifactRepository(localRepoIndices);
ArtifactDescriptor desc = newBundleArtifactDescriptor(false);
repo.addDescriptor(desc);
repo.save();
// check: the artifact is in the index
TychoRepositoryIndex artifactIndex = createArtifactsIndex(baseDir);
Assert.assertFalse(artifactIndex.getProjectGAVs().isEmpty());
// delete artifact content from file system
deleteDir(new File(baseDir, "p2"));
// create a new repo and check that the reference was gracefully removed from the index
repo = new LocalArtifactRepository(localRepoIndices);
repo.save();
artifactIndex = createArtifactsIndex(baseDir);
Assert.assertTrue(artifactIndex.getProjectGAVs().isEmpty());
}
Aggregations