Skip to content

Commit 47889bc

Browse files
lor6KevinGilmore
authored andcommitted
Bael 623 v2 (eugenp#1119)
* helper classes for excel processing, tests * fix imports * list declaration * shorten examples, add excel files
1 parent c198a96 commit 47889bc

File tree

7 files changed

+1
-37
lines changed

7 files changed

+1
-37
lines changed

apache-poi/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,6 @@
3737
<groupId>org.apache.poi</groupId>
3838
<artifactId>poi-ooxml</artifactId>
3939
<version>${poi.version}</version>
40-
</dependency>
41-
<dependency>
42-
<groupId>org.apache.poi</groupId>
43-
<artifactId>poi</artifactId>
44-
<version>${poi.version}</version>
45-
</dependency>
46-
<dependency>
47-
<groupId>org.apache.poi</groupId>
48-
<artifactId>poi-ooxml-schemas</artifactId>
49-
<version>${poi.version}</version>
5040
</dependency>
5141
<dependency>
5242
<groupId>org.jxls</groupId>

apache-poi/src/main/java/com/baeldung/jexcel/JExcelHelper.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,7 @@ public void writeJExcel() throws IOException, WriteException {
6262
sheet.addCell(cellLabel);
6363
Number cellNumber = new Number(1, 2, 20, cellFormat);
6464
sheet.addCell(cellNumber);
65-
66-
cellLabel = new Label(0, 3, "Ana Johnson", cellFormat);
67-
sheet.addCell(cellLabel);
68-
cellNumber = new Number(1, 3, 30, cellFormat);
69-
sheet.addCell(cellNumber);
70-
65+
7166
workbook.write();
7267
} finally {
7368
if (workbook != null) {

apache-poi/src/main/java/com/baeldung/poi/excel/ExcelPOIHelper.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,6 @@ public void writeExcel() throws IOException {
110110
cell.setCellValue(20);
111111
cell.setCellStyle(style);
112112

113-
row = sheet.createRow(3);
114-
cell = row.createCell(0);
115-
cell.setCellValue("Ana Johnson");
116-
cell.setCellStyle(style);
117-
118-
cell = row.createCell(1);
119-
cell.setCellValue(30);
120-
cell.setCellStyle(style);
121-
122113
File currDir = new File(".");
123114
String path = currDir.getAbsolutePath();
124115
String fileLocation = path.substring(0, path.length() - 1) + "temp.xlsx";

apache-poi/src/test/java/com/baeldung/jexcel/JExcelTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ public void whenParsingJExcelFile_thenCorrect() throws IOException, BiffExceptio
5151
.get(0));
5252
assertEquals("20", data.get(2)
5353
.get(1));
54-
55-
assertEquals("Ana Johnson", data.get(3)
56-
.get(0));
57-
assertEquals("30", data.get(3)
58-
.get(1));
59-
6054
}
6155

6256
}

apache-poi/src/test/java/com/baeldung/poi/excel/ExcelTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ public void whenParsingPOIExcelFile_thenCorrect() throws IOException {
4848
.get(0));
4949
assertEquals("20", data.get(1)
5050
.get(1));
51-
52-
assertEquals("Ana Johnson", data.get(2)
53-
.get(0));
54-
assertEquals("30", data.get(2)
55-
.get(1));
56-
5751
}
5852

5953
}

apache-poi/temp.xls

13.5 KB
Binary file not shown.

apache-poi/temp.xlsx

3.43 KB
Binary file not shown.

0 commit comments

Comments
 (0)