test_class.file: persistence/src/test/java/org/devgateway/toolkit/persistence/excel/ExcelFileImportDefaultTest.java
test_class.identifier: ExcelFileImportDefaultTest
test_case.body: @Test
      public void readWorkbook() throws Exception {
          final ClassLoader classLoader = getClass().getClassLoader();
          final ExcelFileImport excelFileImport = new ExcelFileImportDefault(new MyApplicationContext(),
                  new FileInputStream(classLoader.getResource("file-import.xlsx").getFile()),
                  TestBuyer.class, new ImportBean(new Category()));
          final ImportResponse importResponse = excelFileImport.readWorkbook();
  
          TestBuyer testBuyer = (TestBuyer) importResponse.getObjects().get(0);
          Assert.assertEquals("check number of objects", 2, importResponse.getObjects().size());
          Assert.assertEquals("check buyer name", "buyer 1", testBuyer.getName());
          Assert.assertEquals("check organization name", "organization 1", testBuyer.getOrg().getName());
          Assert.assertEquals("check address", "Street 1", testBuyer.getOrg().getAddress().getStreet());
          Assert.assertEquals("check address", "Romania", testBuyer.getOrg().getAddress().getCountry());
      }
test_case.class_method_signature: ExcelFileImportDefaultTest.readWorkbook()
test_case.full_signature: @Test public void readWorkbook()
test_case.identifier: readWorkbook
test_case.invocations: getClassLoader getClass getFile getResource readWorkbook get getObjects assertEquals size getObjects assertEquals getName assertEquals getName getOrg assertEquals getStreet getAddress getOrg assertEquals getCountry getAddress getOrg
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void readWorkbook()
focal_class.declarator: logger = LoggerFactory.getLogger(ExcelFileImportDefault.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ExcelFileImportDefault.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: clazz
focal_class.modifier: private final
focal_class.original_string: private final Class clazz;
focal_class.type: Class
focal_class.var_name: clazz
focal_class.declarator: importBean
focal_class.modifier: private final
focal_class.original_string: private final ImportBean importBean;
focal_class.type: ImportBean
focal_class.var_name: importBean
focal_class.declarator: xExcelFileReader
focal_class.modifier: private final
focal_class.original_string: private final XExcelFileReader xExcelFileReader;
focal_class.type: XExcelFileReader
focal_class.var_name: xExcelFileReader
focal_class.declarator: applicationContext
focal_class.modifier: private final
focal_class.original_string: private final ApplicationContext applicationContext;
focal_class.type: ApplicationContext
focal_class.var_name: applicationContext
focal_class.file: persistence/src/main/java/org/devgateway/toolkit/persistence/excel/ExcelFileImportDefault.java
focal_class.identifier: ExcelFileImportDefault
focal_class.interfaces: implements ExcelFileImport
focal_class.class_method_signature: ExcelFileImportDefault.ExcelFileImportDefault(final ApplicationContext applicationContext, final InputStream is,
                                    final Class clazz, final ImportBean importBean)
focal_class.full_signature: public  ExcelFileImportDefault(final ApplicationContext applicationContext, final InputStream is,
                                    final Class clazz, final ImportBean importBean)
focal_class.identifier: ExcelFileImportDefault
focal_class.modifiers: public
focal_class.parameters: (final ApplicationContext applicationContext, final InputStream is,
                                    final Class clazz, final ImportBean importBean)
focal_class.signature:  ExcelFileImportDefault(final ApplicationContext applicationContext, final InputStream is,
                                    final Class clazz, final ImportBean importBean)
focal_class.class_method_signature: ExcelFileImportDefault.readWorkbook()
focal_class.full_signature: @Override public ImportResponse readWorkbook()
focal_class.identifier: readWorkbook
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ImportResponse
focal_class.signature: ImportResponse readWorkbook()
focal_class.class_method_signature: ExcelFileImportDefault.normalizeRows(final List<String[]> rows)
focal_class.full_signature: private void normalizeRows(final List<String[]> rows)
focal_class.identifier: normalizeRows
focal_class.modifiers: private
focal_class.parameters: (final List<String[]> rows)
focal_class.return: void
focal_class.signature: void normalizeRows(final List<String[]> rows)
focal_method.body: @Override
      public ImportResponse readWorkbook()
              throws Exception {
          final long startTime = System.nanoTime();
          logger.warn(">>>>>>>>>>>>>>> import started >>>>>>>>>>>>>>>");
  
          final List<String[]> rows = xExcelFileReader.readRows(1000);
          xExcelFileReader.close();
          normalizeRows(rows);
  
          ExcelSheetImport excelSheetImport = new ExcelSheetImportDefault(this.applicationContext, rows, this.importBean);
          final ImportResponse importResponse = excelSheetImport.readSheet(clazz);
  
          final long endTime = System.nanoTime();
          final double duration = (endTime - startTime) / 1000000000.0;
          logger.warn(">>>>>>>>>>>>>>> import ended |  duration: " + duration + " >>>>>>>>>");
  
          return importResponse;
      }
focal_method.class_method_signature: ExcelFileImportDefault.readWorkbook()
focal_method.full_signature: @Override public ImportResponse readWorkbook()
focal_method.identifier: readWorkbook
focal_method.invocations: nanoTime warn readRows close normalizeRows readSheet nanoTime warn
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: ImportResponse
focal_method.signature: ImportResponse readWorkbook()