-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hakan Ozler <ozler.hakan@gmail.com>
- Loading branch information
1 parent
ed94932
commit 3971541
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.poiji.deserialize; | ||
|
||
import com.poiji.bind.Poiji; | ||
import com.poiji.deserialize.model.RowModel; | ||
import com.poiji.option.PoijiOptions; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.io.File; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import static org.hamcrest.core.Is.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
/** | ||
* Created by hakan on 02/08/2018 | ||
*/ | ||
@RunWith(Parameterized.class) | ||
public class RawValueTest { | ||
|
||
private String path; | ||
|
||
public RawValueTest(String path) { | ||
this.path = path; | ||
} | ||
|
||
@Parameterized.Parameters(name = "{index}: ({0})={1}") | ||
public static Iterable<Object[]> queries() { | ||
return Arrays.asList(new Object[][]{ | ||
{"src/test/resources/raw_value.xls"}, | ||
{"src/test/resources/raw_value.xlsx"}, | ||
}); | ||
} | ||
|
||
@Test | ||
public void shouldMapCalculations() { | ||
|
||
PoijiOptions options = PoijiOptions.PoijiOptionsBuilder.settings().headerCount(0).returnNumericRawValues().build(); | ||
List<RowModel> models = Poiji.fromExcel(new File(path), RowModel.class, options); | ||
|
||
for (RowModel model : models) { | ||
assertThat(model.getRowValue(), is(57363987456321L)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.poiji.deserialize.model; | ||
|
||
import com.poiji.annotation.ExcelCell; | ||
|
||
/** | ||
* Created by hakan on 16.05.2021 | ||
*/ | ||
public class RowModel { | ||
|
||
@ExcelCell(0) | ||
private Long rowValue; | ||
|
||
public Long getRowValue() { | ||
return rowValue; | ||
} | ||
|
||
public void setRowValue(Long rowValue) { | ||
this.rowValue = rowValue; | ||
} | ||
} |