Revision 52077
Added by Alessia Bardi almost 6 years ago
RecordInfoGeneratorTest.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.oai.store.mongo; |
2 | 2 |
|
3 | 3 |
import java.io.IOException; |
4 |
import java.text.ParseException; |
|
4 | 5 |
import java.time.LocalDateTime; |
5 | 6 |
import java.time.ZoneId; |
6 | 7 |
import java.time.format.DateTimeFormatter; |
... | ... | |
57 | 58 |
Date utilDate = Date.from(d.atZone(ZoneId.systemDefault()).toInstant()); |
58 | 59 |
} |
59 | 60 |
|
61 |
@Test |
|
62 |
public void parseDatestamp1() throws ParseException { |
|
63 |
String theDate = "2018-04-07T04:23:31.8Z"; |
|
64 |
// org.apache.commons.lang.time.DateUtils.parseDate( |
|
65 |
// theDate, |
|
66 |
// new String[]{ "yyyy-MM-dd'T'HH:mm:ss.SX" }); |
|
67 |
gen.parseDate(theDate); |
|
68 |
} |
|
69 |
|
|
70 |
@Test |
|
71 |
public void parseDatestamp2() throws ParseException { |
|
72 |
String theDate = "2018-02-13T15:02:16.122Z"; |
|
73 |
// org.apache.commons.lang.time.DateUtils.parseDate( |
|
74 |
// theDate, |
|
75 |
// new String[]{ "yyyy-MM-dd'T'HH:mm:ss.SX" }); |
|
76 |
gen.parseDate(theDate); |
|
77 |
} |
|
78 |
|
|
79 |
|
|
80 |
|
|
60 | 81 |
private Binary createCompressRecord(final String record) throws IOException { |
61 | 82 |
ByteArrayOutputStream os = new ByteArrayOutputStream(); |
62 | 83 |
ZipOutputStream zos = new ZipOutputStream(os); |
Also available in: Unified diff
I really hope we are finally fine with date handling