use of org.pentaho.platform.plugin.services.importexport.RepositoryFileBundle in project pentaho-platform by pentaho.
the class LocaleFilesProcessorTest method processIsLocalFile.
private boolean processIsLocalFile(String fileName, StringBuffer localeContent) throws Exception {
RepositoryFile file = new RepositoryFile.Builder(fileName).build();
RepositoryFileBundle repoFileBundle = new RepositoryFileBundle(file, null, StringUtils.EMPTY, null, DEFAULT_ENCODING, null);
return localeFilesProcessor.isLocaleFile(repoFileBundle, "/", localeContent.toString().getBytes());
}
use of org.pentaho.platform.plugin.services.importexport.RepositoryFileBundle in project pentaho-platform by pentaho.
the class LocaleImportHandlerTest method processIsLocalFile.
private boolean processIsLocalFile(String fileName, StringBuffer localeContent) throws Exception {
RepositoryFile file = new RepositoryFile.Builder(fileName).build();
RepositoryFileBundle repoFileBundle = new RepositoryFileBundle(file, null, StringUtils.EMPTY, null, DEFAULT_ENCODING, null);
return localeFilesProcessor.isLocaleFile(repoFileBundle, "/", localeContent.toString().getBytes());
}
use of org.pentaho.platform.plugin.services.importexport.RepositoryFileBundle in project pentaho-platform by pentaho.
the class SolutionImportHandlerTest method testGetFile.
@Test
public void testGetFile() {
RepositoryFileImportBundle importBundle = new RepositoryFileImportBundle();
importBundle.setPath("/BASE_PATH/");
RepositoryFile repoFile = new RepositoryFile.Builder("FILE_NAME").build();
IRepositoryFileBundle fileBundle = new RepositoryFileBundle(repoFile, null, "parentDir", null, "UTF-8", null);
fileBundle.setPath("SUB_PATH/");
RepositoryFile expectedFile = new RepositoryFile.Builder("EXPECTED_FILE").build();
Mockito.when(repository.getFile("/BASE_PATH/SUB_PATH/FILE_NAME")).thenReturn(expectedFile);
RepositoryFile actualFile = Deencapsulation.invoke(importHandler, "getFile", importBundle, fileBundle);
Assert.assertEquals(expectedFile, actualFile);
}
Aggregations