test_class.declarator: tmpFolder= new TemporaryFolder()
test_class.modifier: @Rule
    public
test_class.original_string: @Rule
    public TemporaryFolder tmpFolder= new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: tmpFolder
test_class.file: kilt-core/src/test/java/de/poiu/kilt/importexport/XlsImExporterTest.java
test_class.identifier: XlsImExporterTest
test_case.body: @Test
    public void testExportXls() throws URISyntaxException, IOException {
  
      // - preparation
  
      //FIXME: Should these resources lie below de.poiu.kilt.internal?
      //       Or even below de.poiu.kilt.internal.XlsImExporterTest?
  
      final Path propertiesRootDirectory= Paths.get(Resources.getResource("").toURI());
      final Set<File> resourceBundleFiles= ImmutableSet.of(
        propertiesRootDirectory.resolve("i18n/messages.properties").toFile(),
        propertiesRootDirectory.resolve("i18n/messages_de.properties").toFile());
  
      final FileMatcher fileMatcher= this.createFileMatcher(propertiesRootDirectory, resourceBundleFiles);
  
      final File xlsFile= this.tmpFolder.newFile("i18n.xlsx");
      xlsFile.delete();
  
      // - test
  
      XlsImExporter.exportXls(fileMatcher, UTF_8, xlsFile);
  
      // - verification
  
      final XlsFile readXlsFile= new XlsFile(xlsFile);
      final Map<I18nBundleKey, Collection<Translation>> readContent= readXlsFile.getContent();
      final XlsFile expectedXlsFile= new XlsFile(new File(Resources.getResource("i18n_expected.xlsx").toURI()));
      final Map<I18nBundleKey, Collection<Translation>> expectedContent= expectedXlsFile.getContent();
  
      assertThat(readContent).hasSameSizeAs(expectedContent);
      assertThat(readContent).containsOnlyKeys(FluentIterable.from(expectedContent.keySet()).toArray(I18nBundleKey.class));
      for (final I18nBundleKey bundleKey : readContent.keySet()) {
        assertThat(readContent.get(bundleKey)).containsOnly(FluentIterable.from(expectedContent.get(bundleKey)).toArray(Translation.class));
      }
      //actually only this check is necessary
      assertThat(readContent).isEqualTo(expectedContent);
    }
test_case.class_method_signature: XlsImExporterTest.testExportXls()
test_case.full_signature: @Test public void testExportXls()
test_case.identifier: testExportXls
test_case.invocations: get toURI getResource of toFile resolve toFile resolve createFileMatcher newFile delete exportXls getContent toURI getResource getContent hasSameSizeAs assertThat containsOnlyKeys assertThat toArray from keySet keySet containsOnly assertThat get toArray from get isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExportXls()
focal_class.declarator: LOGGER= LogManager.getLogger()
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER= LogManager.getLogger();
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: kilt-core/src/main/java/de/poiu/kilt/importexport/XlsImExporter.java
focal_class.identifier: XlsImExporter
focal_class.class_method_signature: XlsImExporter.importXls(final FileMatcher fileMatcher,
                                 final File xlsFile,
                                 final Charset propertyFileEncoding,
                                 final MissingKeyAction missingKeyAction)
focal_class.full_signature: public static void importXls(final FileMatcher fileMatcher,
                                 final File xlsFile,
                                 final Charset propertyFileEncoding,
                                 final MissingKeyAction missingKeyAction)
focal_class.identifier: importXls
focal_class.modifiers: public static
focal_class.parameters: (final FileMatcher fileMatcher,
                                 final File xlsFile,
                                 final Charset propertyFileEncoding,
                                 final MissingKeyAction missingKeyAction)
focal_class.return: void
focal_class.signature: void importXls(final FileMatcher fileMatcher,
                                 final File xlsFile,
                                 final Charset propertyFileEncoding,
                                 final MissingKeyAction missingKeyAction)
focal_class.class_method_signature: XlsImExporter.exportXls(final FileMatcher fileMatcher,
                                 final Charset propertyFileEncoding,
                                 final File xlsFile)
focal_class.full_signature: public static void exportXls(final FileMatcher fileMatcher,
                                 final Charset propertyFileEncoding,
                                 final File xlsFile)
focal_class.identifier: exportXls
focal_class.modifiers: public static
focal_class.parameters: (final FileMatcher fileMatcher,
                                 final Charset propertyFileEncoding,
                                 final File xlsFile)
focal_class.return: void
focal_class.signature: void exportXls(final FileMatcher fileMatcher,
                                 final Charset propertyFileEncoding,
                                 final File xlsFile)
focal_class.class_method_signature: XlsImExporter.getFileForBundle(final File propertiesRootDirectory, final String bundleBasename, final Language language)
focal_class.full_signature: private static File getFileForBundle(final File propertiesRootDirectory, final String bundleBasename, final Language language)
focal_class.identifier: getFileForBundle
focal_class.modifiers: private static
focal_class.parameters: (final File propertiesRootDirectory, final String bundleBasename, final Language language)
focal_class.return: File
focal_class.signature: File getFileForBundle(final File propertiesRootDirectory, final String bundleBasename, final Language language)
focal_method.body: public static void exportXls(final FileMatcher fileMatcher,
                                 final Charset propertyFileEncoding,
                                 final File xlsFile) {
      final Set<File> propertyFiles= fileMatcher.findMatchingFiles();
      LOGGER.log(Level.INFO, "Exporting the following files to XLS(X): {}", propertyFiles);
  
      final ResourceBundleContentHelper fbcHelper= new ResourceBundleContentHelper(fileMatcher.getRoot());
      final Map<String, Map<Language, File>> bundleNameToFilesMap= fbcHelper.toBundleNameToFilesMap(propertyFiles);
  
      final XlsFile xlsFileObject= new XlsFile(xlsFile);
  
      bundleNameToFilesMap.entrySet().forEach((entry) -> {
        final String bundleName= entry.getKey();
        final Map<Language, File> bundleTranslations= entry.getValue();
  
        final ResourceBundleContent resourceBundleContent= ResourceBundleContent.forName(bundleName)
          .fromFiles(bundleTranslations, propertyFileEncoding !=null ? propertyFileEncoding : UTF_8);
  
        resourceBundleContent.getContent().asMap().entrySet().forEach((e) -> {
          final String propertyKey= e.getKey();
          final Collection<Translation> translations= e.getValue();
  
          xlsFileObject.setValue(new I18nBundleKey(bundleName, propertyKey), translations);
        });
      });
  
      xlsFileObject.save();
    }
focal_method.class_method_signature: XlsImExporter.exportXls(final FileMatcher fileMatcher,
                                 final Charset propertyFileEncoding,
                                 final File xlsFile)
focal_method.full_signature: public static void exportXls(final FileMatcher fileMatcher,
                                 final Charset propertyFileEncoding,
                                 final File xlsFile)
focal_method.identifier: exportXls
focal_method.invocations: findMatchingFiles log getRoot toBundleNameToFilesMap forEach entrySet getKey getValue fromFiles forName forEach entrySet asMap getContent getKey getValue setValue save
focal_method.modifiers: public static
focal_method.parameters: (final FileMatcher fileMatcher,
                                 final Charset propertyFileEncoding,
                                 final File xlsFile)
focal_method.return: void
focal_method.signature: void exportXls(final FileMatcher fileMatcher,
                                 final Charset propertyFileEncoding,
                                 final File xlsFile)