test_class.declarator: logger = LoggerFactory.getLogger(ExcelFileDefaultTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ExcelFileDefaultTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: persistence/src/test/java/org/devgateway/toolkit/persistence/excel/ExcelFileDefaultTest.java
test_class.identifier: ExcelFileDefaultTest
test_case.body: @Test
      public void createWorkbook() throws Exception {
          final ExcelFile excelFile = new ExcelFileDefault(createObjects(), new TestTranslateService());
          final Workbook workbook = excelFile.createWorkbook();
  
          // try (FileOutputStream outputStream = new FileOutputStream("/Users/ionut/Downloads/file-export.xlsx")) {
          //     workbook.write(outputStream);
          // }
  
          Assert.assertEquals("Number of sheets", 3, workbook.getNumberOfSheets());
  
          Assert.assertNotNull("buyer sheet", workbook.getSheet("testbuyer"));
          Assert.assertNotNull("contract sheet", workbook.getSheet("testcontract"));
          Assert.assertNotNull("document sheet", workbook.getSheet("testdocument"));
  
          Assert.assertEquals("buyer name", "buyer 1",
                  workbook.getSheet("testbuyer").getRow(1).getCell(0).toString());
          Assert.assertEquals("buyer classification", "TP-1 - alii aliquam",
                  workbook.getSheet("testbuyer").getRow(2).getCell(8).toString());
  
          Assert.assertEquals("contract parent", "testbuyer - 1",
                  workbook.getSheet("testcontract").getRow(1).getCell(0).toString());
          Assert.assertEquals("contract amount", 1000,
                  workbook.getSheet("testcontract").getRow(1).getCell(2).getNumericCellValue(), 0.0);
  
  
          Assert.assertEquals("document number of rows", 2, workbook.getSheet("testdocument").getLastRowNum());
  
          Assert.assertEquals("buyer address flatten", "Street 1 | Street 2",
                  workbook.getSheet("testbuyer").getRow(1).getCell(4).toString());
      }
test_case.class_method_signature: ExcelFileDefaultTest.createWorkbook()
test_case.full_signature: @Test public void createWorkbook()
test_case.identifier: createWorkbook
test_case.invocations: createObjects createWorkbook assertEquals getNumberOfSheets assertNotNull getSheet assertNotNull getSheet assertNotNull getSheet assertEquals toString getCell getRow getSheet assertEquals toString getCell getRow getSheet assertEquals toString getCell getRow getSheet assertEquals getNumericCellValue getCell getRow getSheet assertEquals getLastRowNum getSheet assertEquals toString getCell getRow getSheet
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createWorkbook()
focal_class.declarator: objects
focal_class.modifier: private final
focal_class.original_string: private final List<Object> objects;
focal_class.type: List<Object>
focal_class.var_name: objects
focal_class.declarator: workbook
focal_class.modifier: private final
focal_class.original_string: private final Workbook workbook;
focal_class.type: Workbook
focal_class.var_name: workbook
focal_class.declarator: translateService
focal_class.modifier: private final
focal_class.original_string: private final TranslateService translateService;
focal_class.type: TranslateService
focal_class.var_name: translateService
focal_class.file: persistence/src/main/java/org/devgateway/toolkit/persistence/excel/ExcelFileDefault.java
focal_class.identifier: ExcelFileDefault
focal_class.interfaces: implements ExcelFile
focal_class.class_method_signature: ExcelFileDefault.ExcelFileDefault(final List<Object> objects, final TranslateService translateService)
focal_class.full_signature: public  ExcelFileDefault(final List<Object> objects, final TranslateService translateService)
focal_class.identifier: ExcelFileDefault
focal_class.modifiers: public
focal_class.parameters: (final List<Object> objects, final TranslateService translateService)
focal_class.signature:  ExcelFileDefault(final List<Object> objects, final TranslateService translateService)
focal_class.class_method_signature: ExcelFileDefault.createWorkbook()
focal_class.full_signature: @Override public Workbook createWorkbook()
focal_class.identifier: createWorkbook
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Workbook
focal_class.signature: Workbook createWorkbook()
focal_method.body: @Override
      public Workbook createWorkbook() {
          // don't do anything if the list of objects is empty, just display the error message.
          if (objects.isEmpty()) {
              final ExcelSheet excelSheet = new ExcelSheetDefault(this.workbook, this.translateService, "no data");
              excelSheet.emptySheet();
          } else {
              final Class clazz = this.objects.get(0).getClass();
              final ExcelSheet excelSheet = new ExcelSheetDefault(this.workbook, this.translateService,
                      clazz.getSimpleName().toLowerCase());
              excelSheet.writeSheet(clazz, objects);
          }
  
          return workbook;
      }
focal_method.class_method_signature: ExcelFileDefault.createWorkbook()
focal_method.full_signature: @Override public Workbook createWorkbook()
focal_method.identifier: createWorkbook
focal_method.invocations: isEmpty emptySheet getClass get toLowerCase getSimpleName writeSheet
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: Workbook
focal_method.signature: Workbook createWorkbook()