@Test public void testGetCollection() { ExcelUtil excelUtil = new ExcelUtil(); try { excelUtil.openUploadExcel("collectionTemplate.xls", 0); } catch (BiffException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println(excelUtil.getCollection()); excelUtil.closeExcel(); }
@Test public void testExportToCollection() throws BiffException, IOException { ExcelUtil excelUtil = new ExcelUtil(); excelUtil.openUploadExcel("collectionTemplate.xls", 0); ModelCollection collection = excelUtil.getCollection(); System.out.println(collection); excelUtil.closeExcel(); excelUtil.openDownloadNewExcel("collectionTemplate.xls", 0); try { excelUtil.exoprtToExcel(collection); } catch (RowsExceededException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (WriteException e) { // TODO Auto-generated catch block e.printStackTrace(); } }