1010import java .util .List ;
1111
1212import com .genexus .msoffice .excel .style .ExcelStyle ;
13+ import org .junit .*;
14+
15+ import com .genexus .msoffice .excel .poi .xssf .ExcelCells ;
16+ import com .genexus .msoffice .excel .poi .xssf .ExcelWorksheet ;
1317import com .genexus .msoffice .excel .style .ExcelAlignment ;
1418
15- import org .junit .*;
1619import static org .junit .Assert .*;
1720/**
1821 * Unit test for simple App.
@@ -137,7 +140,7 @@ public void testActiveWorksheet() {
137140 public void testOpenAndSave () {
138141 ExcelSpreadsheetGXWrapper excel = create ("testActive" );
139142 try {
140- excel .getCells (2 , 1 , 5 , 5 ).setDateValue (new Date ());
143+ excel .getCells (2 , 1 , 5 , 5 ).setDate (new Date ());
141144 } catch (Exception e ) {
142145 e .printStackTrace ();
143146 }
@@ -163,7 +166,7 @@ public void testOpenAndSaveLocked() {
163166 Assert .assertEquals ("File is locked" , 7 , excel .getErrCode ());
164167
165168 try {
166- excel .getCells (2 , 1 , 5 , 5 ).setDateValue (new Date ());
169+ excel .getCells (2 , 1 , 5 , 5 ).setDate (new Date ());
167170 } catch (Exception e ) {
168171 e .printStackTrace ();
169172 }
@@ -183,7 +186,7 @@ public void testFolderNotExists() {
183186 excel .open (excel1 );
184187
185188 try {
186- excel .getCells (2 , 1 , 5 , 5 ).setDateValue (new Date ());
189+ excel .getCells (2 , 1 , 5 , 5 ).setDate (new Date ());
187190 } catch (Exception e ) {
188191 e .printStackTrace ();
189192 }
@@ -204,7 +207,7 @@ public void testWithoutExtensions() {
204207 excel .insertSheet ("genexus1" );
205208 excel .insertSheet ("genexus2" );
206209
207- List <IExcelWorksheet > wSheets = excel .getWorksheets ();
210+ List <ExcelWorksheet > wSheets = excel .getWorksheets ();
208211 Assert .assertTrue (wSheets .size () == 3 );
209212 Assert .assertTrue (wSheets .get (0 ).getName () == "genexus0" );
210213 Assert .assertTrue (wSheets .get (1 ).getName () == "genexus1" );
@@ -221,7 +224,7 @@ public void testInsertSheet() {
221224 excel .insertSheet ("genexus1" );
222225 excel .insertSheet ("genexus2" );
223226
224- List <IExcelWorksheet > wSheets = excel .getWorksheets ();
227+ List <ExcelWorksheet > wSheets = excel .getWorksheets ();
225228 Assert .assertTrue (wSheets .size () == 3 );
226229 Assert .assertTrue (wSheets .get (0 ).getName () == "genexus0" );
227230 Assert .assertTrue (wSheets .get (1 ).getName () == "genexus1" );
@@ -240,7 +243,7 @@ public void testDeleteSheet() {
240243 excel .insertSheet ("gx3" );
241244 excel .insertSheet ("gx4" );
242245
243- List <IExcelWorksheet > wSheets = excel .getWorksheets ();
246+ List <ExcelWorksheet > wSheets = excel .getWorksheets ();
244247 Assert .assertTrue (wSheets .size () == 4 );
245248 Assert .assertTrue (wSheets .get (0 ).getName () == "gx1" );
246249 Assert .assertTrue (wSheets .get (1 ).getName () == "gx2" );
@@ -429,7 +432,7 @@ public void testGetWorksheets() {
429432 excel .save ();
430433 excel .close ();
431434 excel = open ("testGetWorksheets" );
432- List <IExcelWorksheet > sheets = excel .getWorksheets ();
435+ List <ExcelWorksheet > sheets = excel .getWorksheets ();
433436 assertEquals ("hoja1" , sheets .get (0 ).getName ());
434437 assertEquals ("hoja2" , sheets .get (1 ).getName ());
435438 assertEquals ("hoja3" , sheets .get (2 ).getName ());
@@ -451,7 +454,7 @@ public void testHiddenCells() {
451454 excel .getCells (1 , 1 , 3 , 3 ).setCellStyle (style );
452455
453456
454- ExcelCellsGXWrapper cells = excel .getCells (5 , 1 , 3 , 3 );
457+ ExcelCells cells = excel .getCells (5 , 1 , 3 , 3 );
455458 cells .setText ("texto SI se puede editar" );
456459 style = new ExcelStyle ();
457460 style .setLocked (false );
@@ -473,7 +476,7 @@ public void testProtectSheet() {
473476 excel .getCells (1 , 1 , 3 , 3 ).setCellStyle (style );
474477
475478
476- ExcelCellsGXWrapper cells = excel .getCells (5 , 1 , 3 , 3 );
479+ ExcelCells cells = excel .getCells (5 , 1 , 3 , 3 );
477480 cells .setText ("texto SI se puede editar" );
478481 style = new ExcelStyle ();
479482 style .setLocked (false );
@@ -539,7 +542,7 @@ public void testCloneSheet() {
539542 excel .save ();
540543 excel .close ();
541544 excel = open ("testCloneSheet" );
542- List <IExcelWorksheet > sheets = excel .getWorksheets ();
545+ List <ExcelWorksheet > sheets = excel .getWorksheets ();
543546 Assert .assertEquals (4 , sheets .size ());
544547 excel .close ();
545548 }
@@ -553,7 +556,7 @@ public void testCloneSheet2() {
553556 excel .save ();
554557 excel .close ();
555558 excel = open ("testCloneSheet2" );
556- List <IExcelWorksheet > sheets = excel .getWorksheets ();
559+ List <ExcelWorksheet > sheets = excel .getWorksheets ();
557560 Assert .assertEquals (2 , sheets .size ());
558561 excel .close ();
559562 }
@@ -576,7 +579,7 @@ public void testCloneSheetError() {
576579 excel .save ();
577580 excel .close ();
578581 excel = open ("testCloneSheetError" );
579- List <IExcelWorksheet > sheets = excel .getWorksheets ();
582+ List <ExcelWorksheet > sheets = excel .getWorksheets ();
580583 Assert .assertEquals (4 , sheets .size ());
581584 excel .close ();
582585 }
@@ -597,7 +600,7 @@ public void testWorksheetRename() {
597600 excel .save ();
598601 excel .close ();
599602 excel = open ("testWorksheetRename" );
600- List <IExcelWorksheet > sheets = excel .getWorksheets ();
603+ List <ExcelWorksheet > sheets = excel .getWorksheets ();
601604 assertEquals ("hoja1" , sheets .get (1 ).getName ());
602605 assertEquals ("hoja2" , sheets .get (2 ).getName ());
603606 assertEquals ("modificada" , sheets .get (3 ).getName ());
@@ -1023,7 +1026,7 @@ public void testAutoFit() {
10231026 excel .getCells (1 , 3 , 1 , 1 ).setText ("VERYLONGTEXTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT" );
10241027 excel .getCells (2 , 4 , 1 , 1 ).setText ("hola!" );
10251028 excel .getCells (6 , 6 , 1 , 1 ).setText ("VERYLONGTEXTINDIFFERENTROWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW" );
1026- ExcelCellsGXWrapper cells = excel .getCells (7 , 7 , 1 , 1 );
1029+ ExcelCells cells = excel .getCells (7 , 7 , 1 , 1 );
10271030 ExcelStyle style = new ExcelStyle ();
10281031 style .setDataFormat ("#.##" ); //change style, so it shows the full number not scientific notation
10291032 cells .setNumericValue (new BigDecimal ("123456789123456789123456789" ));
@@ -1038,7 +1041,7 @@ public void testDateFormat() {
10381041 excel .setAutofit (true );
10391042 Date date = new Date ();
10401043 //sets date with default format
1041- ExcelCellsGXWrapper cells = excel .getCells (1 , 1 , 1 , 1 );
1044+ ExcelCells cells = excel .getCells (1 , 1 , 1 , 1 );
10421045 cells .setDateValue (date );
10431046 //sets date and apply format after
10441047 cells = excel .getCells (2 , 1 , 1 , 1 );
0 commit comments