use of org.pentaho.di.repository.Repository in project pentaho-metaverse by pentaho.
the class JobJobEntryAnalyzerTest method testAnalyzeWithRepoByName.
@Test
public void testAnalyzeWithRepoByName() throws Exception {
Repository repo = mock(Repository.class);
RepositoryDirectoryInterface repoDir = mock(RepositoryDirectoryInterface.class);
when(mockParentJobMeta.getRepository()).thenReturn(repo);
when(jobEntryJob.getSpecificationMethod()).thenReturn(ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME);
// Test exception
when(repo.findDirectory(anyString())).thenReturn(repoDir);
when(repo.loadJob(anyString(), eq(repoDir), any(ProgressMonitorListener.class), anyString())).thenReturn(childJobMeta);
spyAnalyzer.analyze(descriptor, jobEntryJob);
}
use of org.pentaho.di.repository.Repository in project pentaho-metaverse by pentaho.
the class JobJobEntryAnalyzerTest method testAnalyzeWithRepoByRef.
@Test
public void testAnalyzeWithRepoByRef() throws Exception {
Repository repo = mock(Repository.class);
when(mockParentJobMeta.getRepository()).thenReturn(repo);
when(jobEntryJob.getSpecificationMethod()).thenReturn(ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE);
// Test exception
when(repo.loadJob(any(ObjectId.class), anyString())).thenReturn(childJobMeta);
spyAnalyzer.analyze(descriptor, jobEntryJob);
}
use of org.pentaho.di.repository.Repository in project pentaho-metaverse by pentaho.
the class TransJobEntryAnalyzerTest method testAnalyzeWithRepoByRef.
@Test
public void testAnalyzeWithRepoByRef() throws Exception {
Repository repo = mock(Repository.class);
when(mockParentJobMeta.getRepository()).thenReturn(repo);
when(jobEntryTrans.getSpecificationMethod()).thenReturn(ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE);
when(repo.loadTransformation(any(ObjectId.class), anyString())).thenReturn(childTransMeta);
when(childTransMeta.getPathAndName()).thenReturn("/path/to/test");
when(childTransMeta.getDefaultExtension()).thenReturn("ktr");
spyAnalyzer.analyze(descriptor, jobEntryTrans);
}
use of org.pentaho.di.repository.Repository in project pentaho-metaverse by pentaho.
the class TransJobEntryAnalyzerTest method testAnalyzeWithRepoByName.
@Test
public void testAnalyzeWithRepoByName() throws Exception {
Repository repo = mock(Repository.class);
RepositoryDirectoryInterface repoDir = mock(RepositoryDirectoryInterface.class);
when(mockParentJobMeta.getRepository()).thenReturn(repo);
when(jobEntryTrans.getSpecificationMethod()).thenReturn(ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME);
when(repo.findDirectory(anyString())).thenReturn(repoDir);
when(repo.loadTransformation(anyString(), eq(repoDir), any(ProgressMonitorListener.class), anyBoolean(), anyString())).thenReturn(childTransMeta);
spyAnalyzer.analyze(descriptor, jobEntryTrans);
}
use of org.pentaho.di.repository.Repository in project pentaho-metaverse by pentaho.
the class TransExecutorStepAnalyzerTest method testCustomAnalyze_repoFile_NoRepo.
@Test(expected = MetaverseAnalyzerException.class)
public void testCustomAnalyze_repoFile_NoRepo() throws Exception {
// we should get an exception if the sub transformation isn't found in the repo
when(meta.getDirectoryPath()).thenReturn("/home/admin");
when(meta.getTransName()).thenReturn("my.ktr");
Repository repo = null;
when(parentTransMeta.getRepository()).thenReturn(repo);
when(meta.getSpecificationMethod()).thenReturn(ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME);
spyAnalyzer.customAnalyze(meta, node);
}
Aggregations