/** * Sets the caption for the attachment. * * @param caption the caption to display for the attachment. */ public void setCaption(String caption) { setProperty(CAPTION, caption); }
public void testSetProperty(){ Attachment attachment = new Attachment(CAPTION, DATA); try { attachment.setProperty(Attachment.ATTACHMENT_ID, "attachment1"); fail("Should have thrown exception when trying to set attachment id."); } catch (IllegalArgumentException e) { attachment.setProperty(Attachment.MIME_TYPE, "m1"); fail("Should have thrown exception when trying to set mime type."); } catch (IllegalArgumentException e) { attachment.setProperty(Attachment.ATTACHMENT_URL, "a_url"); fail("Should have thrown exception when trying to set attachment url."); } catch (IllegalArgumentException e) { attachment.setProperty(Attachment.DATA, "data"); fail("Should have thrown exception when trying to set data."); } catch (IllegalArgumentException e) {
public void testSetProperty(){ Attachment attachment = new Attachment(CAPTION, DATA); try { attachment.setProperty(Attachment.ATTACHMENT_ID, "attachment1"); fail("Should have thrown exception when trying to set attachment id."); } catch (IllegalArgumentException e) { attachment.setProperty(Attachment.MIME_TYPE, "m1"); fail("Should have thrown exception when trying to set mime type."); } catch (IllegalArgumentException e) { attachment.setProperty(Attachment.ATTACHMENT_URL, "a_url"); fail("Should have thrown exception when trying to set attachment url."); } catch (IllegalArgumentException e) { attachment.setProperty(Attachment.DATA, "data"); fail("Should have thrown exception when trying to set data."); } catch (IllegalArgumentException e) {