use of org.sonatype.aether.RepositoryEvent in project sonatype-aether by sonatype.
the class DefaultDeployerTest method testSuccessfulMetadataEvents.
@Test
public void testSuccessfulMetadataEvents() throws DeploymentException {
request.addMetadata(metadata);
deployer.deploy(session, request);
List<EventWrapper> events = listener.getEvents();
assertEquals(2, events.size());
EventWrapper wrapper = events.get(0);
assertEquals(METADATA_DEPLOYING, wrapper.getType());
RepositoryEvent event = wrapper.getEvent();
assertEquals(metadata, event.getMetadata());
assertNull(event.getException());
wrapper = events.get(1);
assertEquals(METADATA_DEPLOYED, wrapper.getType());
event = wrapper.getEvent();
assertEquals(metadata, event.getMetadata());
assertNull(event.getException());
}
use of org.sonatype.aether.RepositoryEvent in project sonatype-aether by sonatype.
the class DefaultInstallerTest method checkEvents.
private void checkEvents(String msg, Artifact artifact, boolean failed) {
List<EventWrapper> events = listener.getEvents();
assertEquals(msg, 2, events.size());
EventWrapper wrapper = events.get(0);
assertEquals(msg, ARTIFACT_INSTALLING, wrapper.getType());
RepositoryEvent event = wrapper.getEvent();
assertEquals(msg, artifact, event.getArtifact());
assertNull(msg, event.getException());
wrapper = events.get(1);
assertEquals(msg, ARTIFACT_INSTALLED, wrapper.getType());
event = wrapper.getEvent();
assertEquals(msg, artifact, event.getArtifact());
if (failed) {
assertNotNull(msg + " > expected exception", event.getException());
} else {
assertNull(msg + " > " + event.getException(), event.getException());
}
}
use of org.sonatype.aether.RepositoryEvent in project sonatype-aether by sonatype.
the class DefaultInstallerTest method checkEvents.
private void checkEvents(String msg, Metadata metadata, boolean failed) {
List<EventWrapper> events = listener.getEvents();
assertEquals(msg, 2, events.size());
EventWrapper wrapper = events.get(0);
assertEquals(msg, METADATA_INSTALLING, wrapper.getType());
RepositoryEvent event = wrapper.getEvent();
assertEquals(msg, metadata, event.getMetadata());
assertNull(msg, event.getException());
wrapper = events.get(1);
assertEquals(msg, METADATA_INSTALLED, wrapper.getType());
event = wrapper.getEvent();
assertEquals(msg, metadata, event.getMetadata());
if (failed) {
assertNotNull(msg, event.getException());
} else {
assertNull(msg, event.getException());
}
}
use of org.sonatype.aether.RepositoryEvent in project sonatype-aether by sonatype.
the class DefaultDeployerTest method testSuccessfulArtifactEvents.
@Test
public void testSuccessfulArtifactEvents() throws DeploymentException {
request.addArtifact(artifact);
deployer.deploy(session, request);
List<EventWrapper> events = listener.getEvents();
assertEquals(2, events.size());
EventWrapper wrapper = events.get(0);
assertEquals(ARTIFACT_DEPLOYING, wrapper.getType());
RepositoryEvent event = wrapper.getEvent();
assertEquals(artifact, event.getArtifact());
assertNull(event.getException());
wrapper = events.get(1);
assertEquals(ARTIFACT_DEPLOYED, wrapper.getType());
event = wrapper.getEvent();
assertEquals(artifact, event.getArtifact());
assertNull(event.getException());
}
Aggregations