BorderTop extends AbstractCssProperty<BorderTop> implements StateChangeInformer<CssProperty> { public BorderTop setBorderTopStyle(final BorderTopStyle borderTopStyle) { final StringBuilder cssValueBuilder = new StringBuilder(); if (borderTopWidth != null) { cssValueBuilder.append(borderTopWidth.getCssValue()).append(' '); } if (borderTopStyle != null) { cssValueBuilder.append(borderTopStyle.getCssValue()).append(' '); } if (borderTopColor != null) { cssValueBuilder.append(borderTopColor.getCssValue()).append(' '); } final String trimmedCssValue = StringBuilderUtil .getTrimmedString(cssValueBuilder).toString(); cssValue = trimmedCssValue.isEmpty() ? INHERIT : trimmedCssValue; this.borderTopStyle = borderTopStyle; if (getStateChangeInformer() != null) { getStateChangeInformer().stateChanged(this); } return this; } BorderTop();  BorderTop(final String cssValue);  BorderTop(final BorderTop borderTop); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override BorderTop setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); BorderTopColor getBorderTopColor(); BorderTopStyle getBorderTopStyle(); BorderTopWidth getBorderTopWidth(); BorderTop setBorderTopWidth(final BorderTopWidth borderTopWidth); BorderTop setBorderTopStyle(final BorderTopStyle borderTopStyle); BorderTop setBorderTopColor(final BorderTopColor borderTopColor); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; }
@Test public void testSetBorderTopStyle() { BorderTop border = new BorderTop(); border.setCssValue("thick solid green"); assertEquals("thick solid green", border.getCssValue()); border.setBorderTopStyle(null); assertEquals("thick green", border.getCssValue()); border.setBorderTopStyle(BorderTopStyle.GROOVE); assertEquals("thick groove green", border.getCssValue()); border.setCssValue("thick red"); assertNull(border.getBorderTopStyle()); assertEquals("thick red", border.getCssValue()); }