use of org.sonatype.aether.test.impl.TestRepositorySystemSession in project sonatype-aether by sonatype.
the class AsyncConnectorSuiteConfiguration method before.
@Override
@Before
public void before() throws Exception {
super.before();
this.factory = new AsyncRepositoryConnectorFactory(NullLogger.INSTANCE, new TestFileProcessor());
this.session = new TestRepositorySystemSession();
this.repository = new RemoteRepository("async-test-repo", "default", url("repo"));
this.artifact = new StubArtifact("gid", "aid", "classifier", "extension", "version", null);
this.metadata = new StubMetadata("gid", "aid", "version", "maven-metadata.xml", Metadata.Nature.RELEASE_OR_SNAPSHOT, null);
connector = null;
}
use of org.sonatype.aether.test.impl.TestRepositorySystemSession in project sonatype-aether by sonatype.
the class ArtifactWorkerTest method setup.
@Before
public void setup() throws IOException {
repository = new RemoteRepository("test", "default", TestFileUtils.createTempDir("test-remote-repository").toURL().toString());
session = new TestRepositorySystemSession();
layout = new MavenDefaultLayout();
}
use of org.sonatype.aether.test.impl.TestRepositorySystemSession in project sonatype-aether by sonatype.
the class ResumeGetTest method before.
@Before
public void before() throws Exception {
factory = new AsyncRepositoryConnectorFactory(new SysoutLogger(), new TestFileProcessor());
session = new TestRepositorySystemSession();
artifact = new StubArtifact("gid", "aid", "classifier", "extension", "version");
server = new Server(0);
}
use of org.sonatype.aether.test.impl.TestRepositorySystemSession in project sonatype-aether by sonatype.
the class DefaultArtifactResolverTest method testResolveFromWorkspaceFallbackToRepository.
@Test
public void testResolveFromWorkspaceFallbackToRepository() throws IOException, ArtifactResolutionException {
session = new TestRepositorySystemSession() {
@Override
public WorkspaceReader getWorkspaceReader() {
return new WorkspaceReader() {
public WorkspaceRepository getRepository() {
return new WorkspaceRepository("default");
}
public List<String> findVersions(Artifact artifact) {
return Arrays.asList(artifact.getVersion());
}
public File findArtifact(Artifact artifact) {
return null;
}
};
}
};
connector.setExpectGet(artifact);
remoteRepositoryManager.setConnector(connector);
ArtifactRequest request = new ArtifactRequest(artifact, null, "");
request.addRepository(new RemoteRepository("id", "default", "file:///"));
ArtifactResult result = resolver.resolveArtifact(session, request);
assertTrue("exception on resolveArtifact", result.getExceptions().isEmpty());
Artifact resolved = result.getArtifact();
assertNotNull(resolved.getFile());
resolved = resolved.setFile(null);
assertEquals(artifact, resolved);
connector.assertSeenExpected();
}
use of org.sonatype.aether.test.impl.TestRepositorySystemSession 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);
}
Aggregations