| 24 | import java.io.IOException; |
| 25 | |
| 26 | public class EquivTimelineTest |
| 27 | extends EquivsTest |
| 28 | { |
| 29 | @Inject("testFile") |
| 30 | public static final File[] FILES = |
| 31 | testdataFiles(GLOBAL_SKIP_LIST, |
| 32 | EQUIVS_TIMESTAMP_IONTESTS_FILES); |
| 33 | |
| 34 | |
| 35 | @Override |
| 36 | protected void checkEquivalence(IonValue left, IonValue right, |
| 37 | boolean expectedEquality) |
| 38 | { |
| 39 | // expectedEquality isn't used in this method |
| 40 | IonTimestamp lDom = (IonTimestamp) left; |
| 41 | IonTimestamp rDom = (IonTimestamp) right; |
| 42 | |
| 43 | Timestamp lTime = lDom.timestampValue(); |
| 44 | Timestamp rTime = rDom.timestampValue(); |
| 45 | |
| 46 | assertEquals("Timestamp.compareTo", 0, lTime.compareTo(rTime)); |
| 47 | assertEquals("Timestamp.compareTo", 0, rTime.compareTo(lTime)); |
| 48 | |
| 49 | assertEquals("millis", lTime.getMillis(), rTime.getMillis()); |
| 50 | assertEquals("calendar", lTime.calendarValue(), rTime.calendarValue()); |
| 51 | assertEquals("date", lTime.dateValue(), rTime.dateValue()); |
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | public void roundTripEquivalence(IonDatagram input, boolean myExpectedEquality) throws IOException { |
| 56 | IonDatagram[] data = roundTripDatagram(input); |
| 57 | for(int i = 0; i < data.length; i++) { |
| 58 | runEquivalenceChecks(data[i], myExpectedEquality); |
| 59 | for(int j = i + 1; j < data.length; j++) { |
| 60 | for(int seqIndice = 0; seqIndice < data[i].size(); seqIndice++) { |
| 61 | int maxTimeStampIndice = ((IonSequence)data[i].get(seqIndice)).size(); |
| 62 | for(int timeStampIndice = 0; timeStampIndice < maxTimeStampIndice; timeStampIndice++) { |
| 63 | IonValue timeStamp1 = ((IonSequence)(data[i].get(seqIndice))).get(timeStampIndice); |
| 64 | IonValue timeStamp2 = ((IonSequence)(data[j].get(seqIndice))).get(timeStampIndice); |
| 65 | checkEquivalence(timeStamp1, timeStamp2, true); |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…