public class TestCaseManager{ public static final String title_caseID="测试例ID"; public static final String title_caseName="测试名"; public static final String title_testResult="测试结果"; public static final String title_testTime ="测试通过时间"; public static final String [] titles= new String[]{title_caseID,title_caseName,title_testResult,title_testTime }; public static void generExcel(List<TestCase> list , String path){ File file = new File (path); if(!file.exists()){ createExcel(list,path); }else{ List <TestCase> list2 readExcel(path); int listNumber list2.size(); for(int i=0;i<listNumber;i++){ TestCase testcase =list2.get(i); list.add(testcase); } createExcel(list,path); } } public static void createExcel(List<TestCase> list ,String path){ HSSFWorkbook workbook = new HSSFWorkbook(); Format format = new SimpleDateFormat("yyyy-MM-dd"); String sheetName = format.format(new Date()); HSSFSheet sheet = workbook.createSheet(sheetName); HSSFRow row =sheet.create } public static List<TestCase> readExcel(String path){ } }
时间: 2024-11-06 22:18:25