Search in sources :

Example 16 with TestRepositorySystemSession

use of org.sonatype.aether.test.impl.TestRepositorySystemSession in project sonatype-aether by sonatype.

the class DefaultRemoteRepositoryManagerTest method setup.

@Before
public void setup() throws Exception {
    session = new TestRepositorySystemSession();
    session.setChecksumPolicy(null);
    session.setUpdatePolicy(null);
    manager = new DefaultRemoteRepositoryManager(new SysoutLogger(), new StubUpdateCheckManager(), null);
}
Also used : TestRepositorySystemSession(org.sonatype.aether.test.impl.TestRepositorySystemSession) SysoutLogger(org.sonatype.aether.test.impl.SysoutLogger) Before(org.junit.Before)

Example 17 with TestRepositorySystemSession

use of org.sonatype.aether.test.impl.TestRepositorySystemSession in project sonatype-aether by sonatype.

the class DefaultUpdateCheckManagerTest method setup.

@Before
public void setup() throws Exception {
    File dir = TestFileUtils.createTempFile("");
    TestFileUtils.delete(dir);
    File metadataFile = new File(dir, "metadata.txt");
    TestFileUtils.write("metadata", metadataFile);
    File artifactFile = new File(dir, "artifact.txt");
    TestFileUtils.write("artifact", artifactFile);
    session = new TestRepositorySystemSession();
    repository = new RemoteRepository("id", "default", TestFileUtils.createTempDir().toURL().toString());
    manager = new DefaultUpdateCheckManager();
    metadata = new StubMetadata("gid", "aid", "ver", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT, metadataFile);
    artifact = new StubArtifact("gid", "aid", "", "ext", "ver").setFile(artifactFile);
}
Also used : TestRepositorySystemSession(org.sonatype.aether.test.impl.TestRepositorySystemSession) StubMetadata(org.sonatype.aether.test.util.impl.StubMetadata) StubArtifact(org.sonatype.aether.test.util.impl.StubArtifact) RemoteRepository(org.sonatype.aether.repository.RemoteRepository) File(java.io.File) Before(org.junit.Before)

Aggregations

TestRepositorySystemSession (org.sonatype.aether.test.impl.TestRepositorySystemSession)17 Before (org.junit.Before)14 RemoteRepository (org.sonatype.aether.repository.RemoteRepository)9 StubArtifact (org.sonatype.aether.test.util.impl.StubArtifact)6 File (java.io.File)5 Test (org.junit.Test)3 StubMetadata (org.sonatype.aether.test.util.impl.StubMetadata)3 DefaultArtifact (org.sonatype.aether.util.artifact.DefaultArtifact)3 DefaultMetadata (org.sonatype.aether.util.metadata.DefaultMetadata)3 List (java.util.List)2 Artifact (org.sonatype.aether.artifact.Artifact)2 UpdateCheckManager (org.sonatype.aether.impl.UpdateCheckManager)2 LocalArtifactRequest (org.sonatype.aether.repository.LocalArtifactRequest)2 LocalArtifactResult (org.sonatype.aether.repository.LocalArtifactResult)2 WorkspaceReader (org.sonatype.aether.repository.WorkspaceReader)2 WorkspaceRepository (org.sonatype.aether.repository.WorkspaceRepository)2 ArtifactRequest (org.sonatype.aether.resolution.ArtifactRequest)2 ArtifactResult (org.sonatype.aether.resolution.ArtifactResult)2 RecordingRepositoryListener (org.sonatype.aether.test.impl.RecordingRepositoryListener)2 SysoutLogger (org.sonatype.aether.test.impl.SysoutLogger)2