Search in sources :

Example 1 with RepositoryFileBundle

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());
}
Also used : RepositoryFileBundle(org.pentaho.platform.plugin.services.importexport.RepositoryFileBundle) RepositoryFile(org.pentaho.platform.api.repository2.unified.RepositoryFile)

Example 2 with RepositoryFileBundle

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());
}
Also used : RepositoryFileBundle(org.pentaho.platform.plugin.services.importexport.RepositoryFileBundle) RepositoryFile(org.pentaho.platform.api.repository2.unified.RepositoryFile)

Example 3 with RepositoryFileBundle

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);
}
Also used : IRepositoryFileBundle(org.pentaho.platform.plugin.services.importexport.ImportSource.IRepositoryFileBundle) RepositoryFileBundle(org.pentaho.platform.plugin.services.importexport.RepositoryFileBundle) RepositoryFile(org.pentaho.platform.api.repository2.unified.RepositoryFile) IRepositoryFileBundle(org.pentaho.platform.plugin.services.importexport.ImportSource.IRepositoryFileBundle) Test(org.junit.Test)

Aggregations

RepositoryFile (org.pentaho.platform.api.repository2.unified.RepositoryFile)3 RepositoryFileBundle (org.pentaho.platform.plugin.services.importexport.RepositoryFileBundle)3 Test (org.junit.Test)1 IRepositoryFileBundle (org.pentaho.platform.plugin.services.importexport.ImportSource.IRepositoryFileBundle)1