Subversion Repository Public Repository

litesoft

Diff Revisions 895 vs 897 for /trunk/Java/core/Anywhere/tests/org/litesoft/core/simpletypes/temporal/TimestampHTest.java

Diff revisions: vs.
  @@ -3,8 +3,6 @@
3 3
4 4 import junit.framework.*;
5 5
6 - import org.litesoft.core.typeutils.*;
7 -
8 6 public class TimestampHTest extends AbstractTemporalTestSupport<TimestampH>
9 7 {
10 8 public static TestSuite suite()
  @@ -112,22 +110,17 @@
112 110
113 111 private void chk( int pYear, int pMonth, int pDay, int pHour, TimestampH pTimestamp )
114 112 {
115 - String zExpectedStringFormY = Integers.zeroPadIt( 4, pYear );
116 - String zExpectedStringFormM = Integers.zeroPadIt( 2, pMonth );
117 - String zExpectedStringFormD = Integers.zeroPadIt( 2, pDay );
118 - String zExpectedStringFormH = Integers.zeroPadIt( 2, pHour );
119 113 assertEquals( "Year", pYear, pTimestamp.getYear() );
120 114 assertEquals( "Month", pMonth, pTimestamp.getMonth() );
121 115 assertEquals( "Day", pDay, pTimestamp.getDay() );
122 116 assertEquals( "Hour", pHour, pTimestamp.getHour() );
123 117
124 118 String zToYMDH = pTimestamp.toYMDH();
125 - assertEquals( "toYMDH", zExpectedStringFormY + "/" + zExpectedStringFormM + "/" + zExpectedStringFormD + " " + zExpectedStringFormH, zToYMDH );
119 + assertEquals( "toYMDH", toYMDH( pYear, pMonth, pDay, pHour ), zToYMDH );
126 120 assertEquals( "fromYMDH", pTimestamp, TimestampH.fromYMDH( zToYMDH ) );
127 121 assertEquals( "toString", zToYMDH, pTimestamp.toString() );
128 - // assertEquals( "toSQLvalue", zExpectedStringFormY + "-" + zExpectedStringFormM + "-" + zExpectedStringFormD + "T" + zExpectedStringFormH + "Z",
129 - // pTimestamp.toSQLvalue() );
130 - // assertEquals( "fromSQLvalue", pTimestamp, TimestampH.fromSQLvalue( pTimestamp.toSQLvalue() ) );
122 + assertEquals( "toSQLvalue", toSQLvalueYMDH( pYear, pMonth, pDay, pHour ), pTimestamp.toSQLvalue() );
123 + assertEquals( "fromSQLvalue", pTimestamp, TimestampH.fromSQLvalue( pTimestamp.toSQLvalue() ) );
131 124
132 125 TimestampH sd2 = pTimestamp.addDays( 1 ).minusDays( 1 );
133 126 assertEquals( "Year", pYear, sd2.getYear() );