final long timestamp = System.currentTimeMillis();
final Exception exception = new AuthenticationException( "dummy" );
Resource resource = new Resource();
resource.setName( "mm" );
TransferEvent event = new TransferEvent( wagon, resource, TransferEvent.TRANSFER_COMPLETED,
TransferEvent.REQUEST_GET );
assertEquals( wagon, event.getWagon() );
assertEquals( "mm", event.getResource().getName() );
assertEquals( TransferEvent.TRANSFER_COMPLETED, event.getEventType() );
assertEquals( TransferEvent.REQUEST_GET, event.getRequestType() );
Resource res = new Resource();
res.setName( "mm" );
event = new TransferEvent( wagon, res, exception, TransferEvent.REQUEST_GET );
assertEquals( wagon, event.getWagon() );
assertEquals( "mm", event.getResource().getName() );
assertEquals( TransferEvent.TRANSFER_ERROR, event.getEventType() );
assertEquals( TransferEvent.REQUEST_GET, event.getRequestType() );
assertEquals( exception, event.getException() );
event.setResource( null );
assertEquals( null, event.getResource() );
res.setName( "/foo/baa" );
event.setResource( res );
assertEquals( "/foo/baa", event.getResource().getName() );