Search in sources :

Example 1 with UpdateCheckManager

use of org.sonatype.aether.impl.UpdateCheckManager in project sonatype-aether by sonatype.

the class DefaultArtifactResolverTest method setup.

@Before
public void setup() throws IOException {
    UpdateCheckManager updateCheckManager = new StaticUpdateCheckManager(true);
    remoteRepositoryManager = new StubRemoteRepositoryManager();
    VersionResolver versionResolver = new StubVersionResolver();
    session = new TestRepositorySystemSession();
    lrm = (TestLocalRepositoryManager) session.getLocalRepositoryManager();
    resolver = new DefaultArtifactResolver(NullLogger.INSTANCE, TestFileProcessor.INSTANCE, new StubRepositoryEventDispatcher(), versionResolver, updateCheckManager, remoteRepositoryManager, new StubSyncContextFactory());
    artifact = new StubArtifact("gid", "aid", "", "ext", "ver");
    connector = new RecordingRepositoryConnector();
    remoteRepositoryManager.setConnector(connector);
}
Also used : TestRepositorySystemSession(org.sonatype.aether.test.impl.TestRepositorySystemSession) VersionResolver(org.sonatype.aether.impl.VersionResolver) UpdateCheckManager(org.sonatype.aether.impl.UpdateCheckManager) StubArtifact(org.sonatype.aether.test.util.impl.StubArtifact) Before(org.junit.Before)

Example 2 with UpdateCheckManager

use of org.sonatype.aether.impl.UpdateCheckManager 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)

Aggregations

Before (org.junit.Before)2 UpdateCheckManager (org.sonatype.aether.impl.UpdateCheckManager)2 TestRepositorySystemSession (org.sonatype.aether.test.impl.TestRepositorySystemSession)2 DeployRequest (org.sonatype.aether.deployment.DeployRequest)1 VersionResolver (org.sonatype.aether.impl.VersionResolver)1 RemoteRepository (org.sonatype.aether.repository.RemoteRepository)1 RecordingRepositoryListener (org.sonatype.aether.test.impl.RecordingRepositoryListener)1 StubArtifact (org.sonatype.aether.test.util.impl.StubArtifact)1 DefaultArtifact (org.sonatype.aether.util.artifact.DefaultArtifact)1 DefaultMetadata (org.sonatype.aether.util.metadata.DefaultMetadata)1