{
// ====================================================================
// Test Success - URL
// ====================================================================
this.email.attach(
new URLDataSource(new URL(this.strTestURL)),
"Test Attachment",
"Test Attachment Desc");
// ====================================================================
// Test Exceptions
// ====================================================================
// null datasource
try
{
URLDataSource urlDs = null;
this.email.attach(urlDs, "Test Attachment", "Test Attachment Desc");
fail("Should have thrown an exception");
}
catch (EmailException e)
{
assertTrue(true);
}
// invalid datasource
try
{
URLDataSource urlDs = new URLDataSource(createInvalidURL());
this.email.attach(urlDs, "Test Attachment", "Test Attachment Desc");
fail("Should have thrown an exception");
}
catch (EmailException e)
{