use of org.sonatype.aether.test.impl.SysoutLogger in project sonatype-aether by sonatype.
the class AsyncHandlerExceptionTest method testIt.
@Test
public void testIt() throws Exception {
HttpServer server = new HttpServer();
server.addResources("/", baseDir.getAbsolutePath());
server.start();
try {
RemoteRepository repo = new RemoteRepository("id", "default", server.getHttpUrl() + "/repo");
RepositorySystemSession session = new DefaultRepositorySystemSession();
AsyncRepositoryConnector connector = new AsyncRepositoryConnector(repo, session, new TestFileProcessor(), new SysoutLogger());
try {
StubArtifact artifact = new StubArtifact("gid:aid:1.0");
for (int i = 0; i < 16; i++) {
System.out.println("RUN #" + i);
TestFileUtils.delete(baseDir);
ArtifactDownload download = new ArtifactDownload(artifact, "project", new File(baseDir, "a.jar"), "ignore");
System.out.println("GET");
connector.get(Arrays.asList(download), null);
assertTrue(String.valueOf(download.getException()), download.getException() instanceof ArtifactNotFoundException);
ArtifactUpload upload = new ArtifactUpload(artifact, new File("pom.xml"));
System.out.println("PUT");
connector.put(Arrays.asList(upload), null);
if (upload.getException() != null) {
upload.getException().printStackTrace();
}
assertNull(String.valueOf(upload.getException()), upload.getException());
}
} finally {
connector.close();
}
} finally {
server.stop();
}
}
use of org.sonatype.aether.test.impl.SysoutLogger in project sonatype-aether by sonatype.
the class PlexusSupportTest method testExistenceOfPlexusComponentMetadata.
public void testExistenceOfPlexusComponentMetadata() throws Exception {
getContainer().addComponent(new SysoutLogger(), Logger.class, null);
getContainer().addComponent(new TestFileProcessor(), FileProcessor.class, null);
RepositoryConnectorFactory factory = lookup(RepositoryConnectorFactory.class, "async-http");
assertNotNull(factory);
assertEquals(AsyncRepositoryConnectorFactory.class, factory.getClass());
}
use of org.sonatype.aether.test.impl.SysoutLogger in project sonatype-aether by sonatype.
the class PlexusSupportTest method testExistenceOfPlexusComponentMetadata.
public void testExistenceOfPlexusComponentMetadata() throws Exception {
getContainer().addComponent(new SysoutLogger(), Logger.class, null);
getContainer().addComponent(new TestFileProcessor(), FileProcessor.class, null);
RepositoryConnectorFactory factory = lookup(RepositoryConnectorFactory.class, "file");
assertNotNull(factory);
assertEquals(FileRepositoryConnectorFactory.class, factory.getClass());
}
use of org.sonatype.aether.test.impl.SysoutLogger in project sonatype-aether by sonatype.
the class PlexusSupportTest method testExistenceOfPlexusComponentMetadata.
public void testExistenceOfPlexusComponentMetadata() throws Exception {
getContainer().addComponent(new SysoutLogger(), Logger.class, null);
getContainer().addComponent(new TestFileProcessor(), FileProcessor.class, null);
RepositoryConnectorFactory factory = lookup(RepositoryConnectorFactory.class, "wagon");
assertNotNull(factory);
assertEquals(WagonRepositoryConnectorFactory.class, factory.getClass());
}
use of org.sonatype.aether.test.impl.SysoutLogger 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);
}
Aggregations