WebkitColumnCount extends AbstractCssProperty<WebkitColumnCount> { @Override public WebkitColumnCount setCssValue(final String cssValue) { if (cssValue == null) { throw new NullValueException( "null is an invalid value. The value format should be as for example 0.5, initial/inherit."); } else { final String trimmedCssValue = TagStringUtil .toLowerCase(StringUtil.strip(cssValue)); if (PREDEFINED_CONSTANTS.contains(trimmedCssValue)) { this.cssValue = trimmedCssValue; value = null; } else { try { value = Integer.valueOf(trimmedCssValue); this.cssValue = value.toString(); } catch (final NumberFormatException e) { throw new InvalidValueException(cssValue + " is an invalid value. The value format should be as for example 0.5, initial, inherit etc.."); } } } if (getStateChangeInformer() != null) { getStateChangeInformer().stateChanged(this); } return this; } WebkitColumnCount();  WebkitColumnCount(final String cssValue);  WebkitColumnCount(final WebkitColumnCount webkitColumnCount);  WebkitColumnCount(final int value); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); Integer getValue(); void setValue(final int value); @Override WebkitColumnCount setCssValue(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsAuto(); static boolean isValid(final String cssValue); static final String INITIAL; static final String INHERIT; static final String AUTO; }
@Test(expected = InvalidValueException.class) public void testSetCssValueInvalidValue1() throws Exception { try { new WebkitColumnCount().setCssValue("1px"); } catch (Exception e) { throw e; } }
@Test(expected = InvalidValueException.class) public void testSetCssValueInvalidValue2() throws Exception { try { new WebkitColumnCount().setCssValue("2px"); } catch (Exception e) { throw e; } }