-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathExcelDiffCheckerIntegrationTest.java
More file actions
48 lines (34 loc) · 1.56 KB
/
Copy pathExcelDiffCheckerIntegrationTest.java
File metadata and controls
48 lines (34 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package edu.abhi.poi.excel;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.FileInputStream;
import java.util.concurrent.Callable;
import static org.junit.jupiter.api.Assertions.assertNotNull;
public class ExcelDiffCheckerIntegrationTest {
private XSSFWorkbook workbookOne;
private XSSFWorkbook workbookTwo;
// Test setup with existing file paths
@BeforeEach
void setUp() throws Exception {
workbookOne = new XSSFWorkbook(new FileInputStream("C:\\Users\\anujr\\Downloads\\excel1.xlsx"));
workbookTwo = new XSSFWorkbook(new FileInputStream("C:\\Users\\anujr\\Downloads\\excel2.xlsx"));
}
// Test calling two Excel files
@Test
void testSheetProcessorTask() throws Exception {
XSSFSheet sheetOne = workbookOne.getSheetAt(0);
XSSFSheet sheetTwo = workbookTwo.getSheetAt(0);
// Create a task for processing the sheets
Callable<CallableValue> sheetTask = new SheetProcessorTask(sheetOne, sheetTwo, false);
// Execute the task
CallableValue taskResult = sheetTask.call();
// Assert that the result is not null
assertNotNull(taskResult);
System.out.println("Test passed successfully!");
// Additional assertions can be made on taskResult to check for expected behavior
// For example:
// assertTrue(taskResult.getDiffFlag(), "Differences should be detected");
}
}