@Test public void testGetStringResourceLoaderFromModuleName() { System.out.println("getStringResourceLoaderFromModuleName"); String moduleName = "Testmodul"; StringResourceLoader result = instance.getStringResourceLoaderFromModuleName(moduleName); LinkedList<String> inputList = new LinkedList<>(); inputList.add("test : this is a test"); inputList.add("test2 : also a test"); StringResourceLoader exp = new StringResourceLoader(inputList); assertEquals(exp.containsId("test"), result.containsId("test")); assertEquals(exp.containsId("test2"), result.containsId("test2")); assertEquals(exp.getIdForString("test"), result.getIdForString("test")); assertEquals(exp.getIdForString("test2"), result.getIdForString("test2")); }
protected final StringResourceLoader getStringResourceLoaderFromModuleName(String moduleName) { String subFolderAndFilename = getFileLocationString(moduleName); String superFolder = SuperFolderFinder.getSuperFolder(); String location = superFolder + subFolderAndFilename; File file = new File(location); { LinkedList<String> inputList; try { inputList = FileLoader.loadFileAsString(file); return new StringResourceLoader(inputList); } catch (IOException ex) { fileNotFound(file); } catch (IndexOutOfBoundsException ie) { errorFileHasWrongFormat(file); } } return null; }
StringResourceProvider { protected final StringResourceLoader getStringResourceLoaderFromModuleName(String moduleName) { String subFolderAndFilename = getFileLocationString(moduleName); String superFolder = SuperFolderFinder.getSuperFolder(); String location = superFolder + subFolderAndFilename; File file = new File(location); { LinkedList<String> inputList; try { inputList = FileLoader.loadFileAsString(file); return new StringResourceLoader(inputList); } catch (IOException ex) { fileNotFound(file); } catch (IndexOutOfBoundsException ie) { errorFileHasWrongFormat(file); } } return null; } }
StringResourceProvider { protected final StringResourceLoader getStringResourceLoaderFromModuleName(String moduleName) { String subFolderAndFilename = getFileLocationString(moduleName); String superFolder = SuperFolderFinder.getSuperFolder(); String location = superFolder + subFolderAndFilename; File file = new File(location); { LinkedList<String> inputList; try { inputList = FileLoader.loadFileAsString(file); return new StringResourceLoader(inputList); } catch (IOException ex) { fileNotFound(file); } catch (IndexOutOfBoundsException ie) { errorFileHasWrongFormat(file); } } return null; } StringResourceProvider(String languageId); }
StringResourceProvider { protected final StringResourceLoader getStringResourceLoaderFromModuleName(String moduleName) { String subFolderAndFilename = getFileLocationString(moduleName); String superFolder = SuperFolderFinder.getSuperFolder(); String location = superFolder + subFolderAndFilename; File file = new File(location); { LinkedList<String> inputList; try { inputList = FileLoader.loadFileAsString(file); return new StringResourceLoader(inputList); } catch (IOException ex) { fileNotFound(file); } catch (IndexOutOfBoundsException ie) { errorFileHasWrongFormat(file); } } return null; } StringResourceProvider(String languageId); void changeLanguage(String languageId); }
StringResourceProvider { protected final StringResourceLoader getStringResourceLoaderFromModuleName(String moduleName) { String subFolderAndFilename = getFileLocationString(moduleName); String superFolder = SuperFolderFinder.getSuperFolder(); String location = superFolder + subFolderAndFilename; File file = new File(location); { LinkedList<String> inputList; try { inputList = FileLoader.loadFileAsString(file); return new StringResourceLoader(inputList); } catch (IOException ex) { fileNotFound(file); } catch (IndexOutOfBoundsException ie) { errorFileHasWrongFormat(file); } } return null; } StringResourceProvider(String languageId); void changeLanguage(String languageId);  }