URL url = getClass().getClassLoader().getResource("Budsjett_salesman_import_villa.xls");
budgetManager.importBudget(url.getFile(),BudgetType.SALESMAN);
Periode periode = new Periode(2010, 5, 5);
Collection<SalesmanGoal> salesGoalList = salesVManager.getSalesGoalList(periode);
ExcelUtil.setUseUniqueFileName(false);
ExcelUtil excelUtil=new ExcelUtil();
ExcelReportSetting reportSetting=new ExcelReportSetting(ExcelReportEnum.SALES_GOAL);
reportSetting.setYear(2010);
reportSetting.setWeekFrom(5);
reportSetting.setWeekTo(5);
Map<Object,Object> data=Maps.newHashMap();
data.put("Reportdata", salesGoalList);
excelUtil.generateSalesGoalReport(reportSetting, data);
ExcelUtil excelUtilReader=new ExcelUtil();
excelUtilReader.openExcelFileForRead("excel/Salgsm�l.xls");
String cellValue=excelUtilReader.readCell(2, 0, null);
assertEquals("SALGSM�L", cellValue);
cellValue=excelUtilReader.readCell(3, 2, null);
assertEquals("Salgsm�l 2010", cellValue);
cellValue=excelUtilReader.readCell(3, 5, null);
assertEquals("Uke 5", cellValue);
cellValue=excelUtilReader.readCell(3, 13, null);
assertEquals("Akkumulert pr uke 5", cellValue);
cellValue=excelUtilReader.readCell(4, 5, null);
assertEquals("pr uke", cellValue);
cellValue=excelUtilReader.readCell(4, 10, null);
assertEquals("Endring fra i fjor(diff):", cellValue);
cellValue=excelUtilReader.readCell(4, 13, null);
assertEquals("pr uke", cellValue);
cellValue=excelUtilReader.readCell(4, 18, null);
assertEquals("Endring fra i fjor(diff):", cellValue);
cellValue=excelUtilReader.readCell(5, 0, null);
assertEquals("Produktomr�de", cellValue);
cellValue=excelUtilReader.readCell(5, 1, null);
assertEquals("Selger", cellValue);
cellValue=excelUtilReader.readCell(5, 2, null);
assertEquals("Ordre", cellValue);
cellValue=excelUtilReader.readCell(5, 3, null);
assertEquals("Tilbudsmengde", cellValue);
cellValue=excelUtilReader.readCell(5, 4, null);
assertEquals("Tilslagsprosent", cellValue);
cellValue=excelUtilReader.readCell(5, 5, null);
assertEquals("Tilslagsprosent", cellValue);
cellValue=excelUtilReader.readCell(5, 6, null);
assertEquals("DG", cellValue);
cellValue=excelUtilReader.readCell(5, 7, null);
assertEquals("Tilbudsmengde", cellValue);
cellValue=excelUtilReader.readCell(5, 8, null);
assertEquals("Ordremengde", cellValue);
cellValue=excelUtilReader.readCell(5, 9, null);
assertEquals("Avrop", cellValue);
cellValue=excelUtilReader.readCell(5, 10, null);
assertEquals("Tilslagsprosent", cellValue);
cellValue=excelUtilReader.readCell(5, 11, null);
assertEquals("Tilbudsmengde", cellValue);
cellValue=excelUtilReader.readCell(5, 12, null);
assertEquals("Ordremengde", cellValue);
cellValue=excelUtilReader.readCell(5, 13, null);
assertEquals("Tilslagsprosent", cellValue);
cellValue=excelUtilReader.readCell(5, 14, null);
assertEquals("DG", cellValue);
cellValue=excelUtilReader.readCell(5, 15, null);
assertEquals("Tilbudsmengde", cellValue);
cellValue=excelUtilReader.readCell(5, 16, null);
assertEquals("Ordremengde", cellValue);
cellValue=excelUtilReader.readCell(5, 17, null);
assertEquals("Avrop", cellValue);
cellValue=excelUtilReader.readCell(5, 18, null);
assertEquals("Tilslagsprosent", cellValue);
cellValue=excelUtilReader.readCell(5, 19, null);
assertEquals("Tilbudsmengde", cellValue);
cellValue=excelUtilReader.readCell(5, 20, null);
assertEquals("Ordremengde", cellValue);
cellValue=excelUtilReader.readCell(6, 0, null);
assertEquals("Garasje villa", cellValue);
cellValue=excelUtilReader.readCell(6, 1, null);
boolean salesmanFound=false;
for(int i=6;i<=30;i++){
cellValue=excelUtilReader.readCell(i, 1, null);
if(cellValue.equalsIgnoreCase("Aleksander Federici")){
salesmanFound=true;
}
}
assertTrue(salesmanFound);