Skip to content

Commit 93d975e

Browse files
committed
[refactor] Address code review
1 parent b908fc7 commit 93d975e

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

exist-core/src/test/java/org/exist/xquery/value/DateTimeStampTest.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,27 @@ public class DateTimeStampTest extends AbstractTimeRelatedTestCase {
3030

3131

3232
@Test(expected = XPathException.class)
33-
public void crate1() throws XPathException {
33+
public void constructWithoutTimeZone() throws XPathException {
3434
new DateTimeStampValue("2005-10-11T10:00:00");
3535
}
3636

3737
@Test
38-
public void convert1() throws XPathException {
39-
DateTimeValue dateTimeValue = new DateTimeValue("2005-10-11T10:00:00Z");
40-
AtomicValue value = dateTimeValue.convertTo(Type.DATE_TIME_STAMP);
38+
public void convertDateTimeWithTimeZoneToDateTimeStamp() throws XPathException {
39+
final DateTimeValue dateTimeValue = new DateTimeValue("2005-10-11T10:00:00Z");
40+
final AtomicValue value = dateTimeValue.convertTo(Type.DATE_TIME_STAMP);
4141
assertEquals(DateTimeStampValue.class, value.getClass());
4242
}
4343

4444
@Test(expected = XPathException.class)
45-
public void convert2() throws XPathException {
46-
DateTimeValue dateTimeValue = new DateTimeValue("2005-10-11T10:00:00");
47-
AtomicValue value = dateTimeValue.convertTo(Type.DATE_TIME_STAMP);
45+
public void convertDateTimeWithoutTimeZoneToDateTimeStamp() throws XPathException {
46+
final DateTimeValue dateTimeValue = new DateTimeValue("2005-10-11T10:00:00");
47+
final AtomicValue value = dateTimeValue.convertTo(Type.DATE_TIME_STAMP);
4848
assertEquals(DateTimeStampValue.class, value.getClass());
4949
}
5050

5151
@Test()
52-
public void getTimezone1() throws XPathException {
53-
DateTimeStampValue value = new DateTimeStampValue("2005-10-11T10:00:00+10:00");
52+
public void getTimezone() throws XPathException {
53+
final DateTimeStampValue value = new DateTimeStampValue("2005-10-11T10:00:00+10:00");
5454
assertEquals(10 * 60, value.calendar.getTimezone());
5555
}
56-
57-
58-
59-
60-
61-
6256
}

0 commit comments

Comments
 (0)