Search in sources :

Example 11 with TestRepositorySystemSession

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

the class SimpleLocalRepositoryManagerTest method setup.

@Before
public void setup() throws IOException {
    basedir = TestFileUtils.createTempDir("simple-repo");
    manager = new SimpleLocalRepositoryManager(basedir);
    session = new TestRepositorySystemSession();
}
Also used : TestRepositorySystemSession(org.sonatype.aether.test.impl.TestRepositorySystemSession) Before(org.junit.Before)

Example 12 with TestRepositorySystemSession

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

the class ConnectorTestSuiteSetup method before.

/**
     * If called for the first time, calls
     * {@link ConnectorTestSetup#beforeClass(org.sonatype.aether.RepositorySystemSession)}. Always calls
     * {@link ConnectorTestSetup#before(org.sonatype.aether.RepositorySystemSession, Map)}.
     */
@Before
public void before() throws Exception {
    session = new TestRepositorySystemSession();
    repository = connectorSetup.before(session, context);
}
Also used : TestRepositorySystemSession(org.sonatype.aether.test.impl.TestRepositorySystemSession) Before(org.junit.Before)

Example 13 with TestRepositorySystemSession

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

the class IniArtifactDescriptorReaderTest method setup.

@Before
public void setup() throws IOException {
    reader = new IniArtifactDescriptorReader("org/sonatype/aether/test/util/");
    session = new TestRepositorySystemSession();
}
Also used : TestRepositorySystemSession(org.sonatype.aether.test.impl.TestRepositorySystemSession) Before(org.junit.Before)

Example 14 with TestRepositorySystemSession

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

the class DefaultDeployerTest method setup.

@Before
public void setup() throws IOException {
    artifact = new DefaultArtifact("gid", "aid", "jar", "ver");
    artifact = artifact.setFile(TestFileUtils.createTempFile("artifact"));
    metadata = new DefaultMetadata("gid", "aid", "ver", "type", Nature.RELEASE_OR_SNAPSHOT, TestFileUtils.createTempFile("metadata"));
    session = new TestRepositorySystemSession();
    manager = new StubRemoteRepositoryManager();
    deployer = new DefaultDeployer();
    deployer.setRemoteRepositoryManager(manager);
    deployer.setRepositoryEventDispatcher(new StubRepositoryEventDispatcher());
    UpdateCheckManager updateCheckManager = new StaticUpdateCheckManager(true);
    deployer.setUpdateCheckManager(updateCheckManager);
    deployer.setFileProcessor(TestFileProcessor.INSTANCE);
    deployer.setSyncContextFactory(new StubSyncContextFactory());
    request = new DeployRequest();
    request.setRepository(new RemoteRepository("id", "default", "file:///"));
    connector = new RecordingRepositoryConnector();
    manager.setConnector(connector);
    listener = new RecordingRepositoryListener();
    session.setRepositoryListener(listener);
}
Also used : DeployRequest(org.sonatype.aether.deployment.DeployRequest) DefaultMetadata(org.sonatype.aether.util.metadata.DefaultMetadata) UpdateCheckManager(org.sonatype.aether.impl.UpdateCheckManager) RemoteRepository(org.sonatype.aether.repository.RemoteRepository) TestRepositorySystemSession(org.sonatype.aether.test.impl.TestRepositorySystemSession) RecordingRepositoryListener(org.sonatype.aether.test.impl.RecordingRepositoryListener) DefaultArtifact(org.sonatype.aether.util.artifact.DefaultArtifact) Before(org.junit.Before)

Example 15 with TestRepositorySystemSession

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

the class DefaultInstallerTest method setup.

@Before
public void setup() throws IOException {
    artifact = new DefaultArtifact("gid", "aid", "jar", "ver");
    artifact = artifact.setFile(TestFileUtils.createTempFile("artifact".getBytes(), 1));
    metadata = new DefaultMetadata("gid", "aid", "ver", "type", Nature.RELEASE_OR_SNAPSHOT, TestFileUtils.createTempFile("metadata".getBytes(), 1));
    session = new TestRepositorySystemSession();
    localArtifactPath = session.getLocalRepositoryManager().getPathForLocalArtifact(artifact);
    localMetadataPath = session.getLocalRepositoryManager().getPathForLocalMetadata(metadata);
    localArtifactFile = new File(session.getLocalRepository().getBasedir(), localArtifactPath);
    installer = new DefaultInstaller();
    installer.setFileProcessor(TestFileProcessor.INSTANCE);
    installer.setRepositoryEventDispatcher(new StubRepositoryEventDispatcher());
    installer.setSyncContextFactory(new StubSyncContextFactory());
    request = new InstallRequest();
    listener = new RecordingRepositoryListener();
    session.setRepositoryListener(listener);
    lrm = (TestLocalRepositoryManager) session.getLocalRepositoryManager();
    TestFileUtils.delete(session.getLocalRepository().getBasedir());
}
Also used : TestRepositorySystemSession(org.sonatype.aether.test.impl.TestRepositorySystemSession) InstallRequest(org.sonatype.aether.installation.InstallRequest) DefaultMetadata(org.sonatype.aether.util.metadata.DefaultMetadata) RecordingRepositoryListener(org.sonatype.aether.test.impl.RecordingRepositoryListener) File(java.io.File) DefaultArtifact(org.sonatype.aether.util.artifact.DefaultArtifact) 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