// test the proper sequence of events by comparing the number of pre-events,
// post-events, and actual publications.
assertTrue("event is of correct base type", event instanceof PublishEvent);
PublishEvent pubEvent = (PublishEvent) event;
Artifact expectedArtifact = test.currentTestCase.expectedArtifact;
File expectedData = test.currentTestCase.expectedData;
assertSameArtifact("event records correct artifact", expectedArtifact,
pubEvent.getArtifact());
try {
assertEquals("event records correct file", expectedData.getCanonicalPath(),
pubEvent.getData().getCanonicalPath());
assertEquals("event records correct overwrite setting", test.expectedOverwrite,
pubEvent.isOverwrite());
assertSame("event presents correct resolver", resolver, pubEvent.getResolver());
String[] attributes = {"organisation", "module", "revision", "artifact", "type",
"ext", "resolver", "overwrite"};
String[] values = {"apache", "PublishEventsTest", "1.0-dev",
expectedArtifact.getName(), expectedArtifact.getType(),
expectedArtifact.getExt(), "default",
String.valueOf(test.expectedOverwrite)};
for (int i = 0; i < attributes.length; ++i) {
assertEquals("event declares correct value for " + attributes[i], values[i],
event.getAttributes().get(attributes[i]));