XMLUtil { public String formatTimeInterval(final long milliseconds) { return "PT" + (double) milliseconds / 1000 + "S"; } XMLUtil(final XMLEscaper escaper); static XMLUtil create(); void appendEAttribute(final Appendable appendable, final CharSequence attrName,
                                 final String attrRawValue); void appendAttribute(final Appendable appendable, final CharSequence attrName,
                                final boolean attrValue); void appendAttribute(final Appendable appendable, final CharSequence attrName,
                                final int attrValue); void appendAttribute(final Appendable appendable, final CharSequence attrName,
                                final CharSequence attrValue); void appendAttribute(final Appendable appendable, final CharSequence attrName,
                                final AttributeValue attrValue); void appendAttribute(final Appendable appendable, final CharSequence attrName,
                                final List<?> attrs, final String sep); void appendTag(final Appendable appendable, final CharSequence tagName,
                          final String content); String escapeXMLAttribute(final String s); String escapeXMLContent(final String s); String formatTimeInterval(final long milliseconds); String formatTimeInterval(final long years, final long months, final long days,
                                     final long hours, final long minutes, final double seconds); String formatNegTimeInterval(final long years, final long months, final long days,
                                        final long hours, final long minutes,
                                        final double seconds); static final String XML_PROLOG; static final char SPACE_CHAR; }
@Test(expected = IllegalArgumentException.class) public void testFormatIntervalNegValue() { this.xu.formatTimeInterval(-1, 0, 0, 0, 0, 0); }
@Test public void testFormatIntervalOther() { Assert.assertEquals("P0Y", this.xu.formatTimeInterval(0, 0, 0, 0, 0, 0)); Assert.assertEquals("P1Y2M3D", this.xu.formatTimeInterval(1, 2, 3, 0, 0, 0)); Assert.assertEquals("PT4H5M6.0S", this.xu.formatTimeInterval(0, 0, 0, 4, 5, 6.0)); }
@Test public void testFormatIntervalMillis() { Assert.assertEquals("PT123456.789S", this.xu.formatTimeInterval(123456789)); }