BorderAttribute implements AttributeValue { public static BorderAttributeBuilder builder() { return new BorderAttributeBuilder(); } BorderAttribute(final Length size, final Color color, final BorderStyle style); static BorderAttributeBuilder builder(); @Override CharSequence getValue(); @Override String toString(); void appendXMLAttribute(final XMLUtil util, final Appendable appendable,
                                   final String attrName); static final Color DEFAULT_BORDER_COLOR; static final Length DEFAULT_BORDER_SIZE; static final Position DEFAULT_POSITION; static final BorderStyle DEFAULT_STYLE; }
@Test public final void basicTest() throws IOException { final BorderAttribute ba = BorderAttribute.builder().borderSize(SimpleLength.cm(1.0)) .borderColor(SimpleColor.ALICEBLUE).borderStyle(BorderStyle.SOLID).build(); this.assertXMLEquals("1cm solid #f0f8ff", ba); }
@Test public final void nullColorTest() throws IOException { final BorderAttribute ba = BorderAttribute.builder().borderSize(10).build(); this.assertXMLEquals("10pt", ba); }
@Test public final void nullSizeTest() throws IOException { final BorderAttribute ba = BorderAttribute.builder().borderColor(SimpleColor.AQUAMARINE).build(); this.assertXMLEquals("solid #7fffd4", ba); }
@Test public final void nullTest() throws IOException { final BorderAttribute ba = BorderAttribute.builder().build(); this.assertXMLEquals("", ba); }