File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
src/test/java/test/org/fugerit/java/github/issue/export Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ package test .org .fugerit .java .github .issue .export ;
2
+
3
+ import java .sql .Date ;
4
+ import java .text .ParseException ;
5
+ import java .util .Locale ;
6
+
7
+ import org .fugerit .java .github .issue .export .helper .FormatHelper ;
8
+ import org .junit .Assert ;
9
+ import org .junit .Test ;
10
+
11
+ public class TestFormatHelper {
12
+
13
+ @ Test
14
+ public void testDate () throws ParseException {
15
+ String checkDate = "2024-01-01" ;
16
+ String checkDateRes = "01/01/2024 00:00" ;
17
+ String fd = FormatHelper .formatDate ( Date .valueOf ( checkDate ) , Locale .ENGLISH .getLanguage () );
18
+ Assert .assertEquals ( checkDateRes , fd );
19
+ }
20
+
21
+ }
Original file line number Diff line number Diff line change
1
+ package test .org .fugerit .java .github .issue .export ;
2
+
3
+ import org .fugerit .java .github .issue .export .helper .PoiHelper ;
4
+ import org .junit .Assert ;
5
+ import org .junit .Test ;
6
+
7
+ public class TestPoiHelper {
8
+
9
+ private static final String PAD = "ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGH " ;
10
+
11
+ @ Test
12
+ public void testPrepareCell () {
13
+ StringBuffer buffer = new StringBuffer ();
14
+ int length = 0 ;
15
+ while ( length < PoiHelper .MAX_XLS_CELL_LENGTH ) {
16
+ buffer .append ( PAD );
17
+ length += PAD .length ();
18
+ }
19
+ String currentCell = PoiHelper .prepareCell ( buffer .toString () );
20
+ Assert .assertTrue ( currentCell .indexOf ( "[...]" ) > 0 );
21
+ Assert .assertEquals ( "" , PoiHelper .prepareCell ( "null" ) );
22
+ }
23
+
24
+ }
You can’t perform that action at this time.
0 commit comments