GOODBOY008 commented on code in PR #901:
URL: https://github.com/apache/fesod/pull/901#discussion_r3466332050


##########
fesod-sheet/src/test/java/org/apache/fesod/sheet/template/TemplateDataTest.java:
##########
@@ -25,73 +25,45 @@
 
 package org.apache.fesod.sheet.template;
 
+import static org.apache.fesod.sheet.testkit.params.FormatCapability.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import java.io.File;
-import java.util.ArrayList;
 import java.util.List;
 import org.apache.fesod.sheet.FesodSheet;
+import org.apache.fesod.sheet.testkit.Tags;
+import org.apache.fesod.sheet.testkit.base.AbstractExcelTest;
+import org.apache.fesod.sheet.testkit.builders.TestDataBuilder;
+import org.apache.fesod.sheet.testkit.enums.ExcelFormat;
+import org.apache.fesod.sheet.testkit.params.ExcelFormatSource;
+import org.apache.fesod.sheet.testkit.params.FormatScope;
 import org.apache.fesod.sheet.util.TestFileUtil;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.MethodOrderer;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestMethodOrder;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.params.ParameterizedTest;
 
 /**
- *
+ * Test template write/read for binary Excel formats using parameterized tests.
  */
-@TestMethodOrder(MethodOrderer.MethodName.class)
-public class TemplateDataTest {
-
-    private static File file07;
-    private static File file03;
-
-    @BeforeAll
-    public static void init() {
-        file07 = TestFileUtil.createNewFile("template07.xlsx");
-        file03 = TestFileUtil.createNewFile("template03.xls");
-    }
-
-    @Test
-    public void t01ReadAndWrite07() {
-        readAndWrite07(file07);
-    }
-
-    @Test
-    public void t02ReadAndWrite03() {
-        readAndWrite03(file03);
-    }
+@Tag(Tags.ROUND_TRIP)
+public class TemplateDataTest extends AbstractExcelTest {
 
-    private void readAndWrite07(File file) {
+    @ParameterizedTest
+    @ExcelFormatSource(value = FormatScope.BINARY, requires = TEMPLATES)
+    void readAndWrite(ExcelFormat format) throws Exception {
+        File file = createTempFile("template", format);
+        String templateName = "template" + File.separator + "template" + 
(format == ExcelFormat.XLSX ? "07" : "03")
+                + format.getExtension();
+        File template = TestFileUtil.readFile(templateName);

Review Comment:
   Great catch!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to