use of org.pentaho.di.repository.RepositoryElementMetaInterface in project pentaho-kettle by pentaho.
the class DialogUtilsTest method nullDirectoryPath.
@Test
public void nullDirectoryPath() {
RepositoryElementMetaInterface object = mock(RepositoryElementMetaInterface.class);
RepositoryDirectoryInterface directory = mock(RepositoryDirectoryInterface.class);
when(object.getRepositoryDirectory()).thenReturn(directory);
assertNull(getPathOf(object));
}
use of org.pentaho.di.repository.RepositoryElementMetaInterface in project pentaho-kettle by pentaho.
the class KettleFileRepository method getTransformationObjects.
@Override
public List<RepositoryElementMetaInterface> getTransformationObjects(ObjectId idDirectory, boolean includeDeleted) throws KettleException {
try {
List<RepositoryElementMetaInterface> list = new ArrayList<RepositoryElementMetaInterface>();
RepositoryDirectoryInterface tree = loadRepositoryDirectoryTree();
RepositoryDirectoryInterface directory = tree.findDirectory(idDirectory);
String folderName = calcDirectoryName(directory);
FileObject folder = KettleVFS.getFileObject(folderName);
for (FileObject child : folder.getChildren()) {
if (child.getType().equals(FileType.FILE)) {
if (!child.isHidden() || !repositoryMeta.isHidingHiddenFiles()) {
String name = child.getName().getBaseName();
if (name.endsWith(EXT_TRANSFORMATION)) {
String transName = name.substring(0, name.length() - 4);
ObjectId id = new StringObjectId(calcObjectId(directory, transName, EXT_TRANSFORMATION));
Date date = new Date(child.getContent().getLastModifiedTime());
list.add(new RepositoryObject(id, transName, directory, "-", date, RepositoryObjectType.TRANSFORMATION, "", false));
}
}
}
}
return list;
} catch (Exception e) {
throw new KettleException("Unable to get list of transformations in folder with id : " + idDirectory, e);
}
}
use of org.pentaho.di.repository.RepositoryElementMetaInterface in project pentaho-kettle by pentaho.
the class KettleFileRepository method getJobObjects.
@Override
public List<RepositoryElementMetaInterface> getJobObjects(ObjectId id_directory, boolean includeDeleted) throws KettleException {
try {
List<RepositoryElementMetaInterface> list = new ArrayList<RepositoryElementMetaInterface>();
RepositoryDirectoryInterface tree = loadRepositoryDirectoryTree();
RepositoryDirectoryInterface directory = tree.findDirectory(id_directory);
String folderName = calcDirectoryName(directory);
FileObject folder = KettleVFS.getFileObject(folderName);
for (FileObject child : folder.getChildren()) {
if (child.getType().equals(FileType.FILE)) {
if (!child.isHidden() || !repositoryMeta.isHidingHiddenFiles()) {
String name = child.getName().getBaseName();
if (name.endsWith(EXT_JOB)) {
String jobName = name.substring(0, name.length() - 4);
ObjectId id = new StringObjectId(calcObjectId(directory, jobName, EXT_JOB));
Date date = new Date(child.getContent().getLastModifiedTime());
list.add(new RepositoryObject(id, jobName, directory, "-", date, RepositoryObjectType.JOB, "", false));
}
}
}
}
return list;
} catch (Exception e) {
throw new KettleException("Unable to get list of jobs in folder with id : " + id_directory, e);
}
}
use of org.pentaho.di.repository.RepositoryElementMetaInterface in project pentaho-kettle by pentaho.
the class UIEEJobTest method testIllegalArgumentOnConstructor.
@Test(expected = IllegalArgumentException.class)
public void testIllegalArgumentOnConstructor() throws Exception {
RepositoryElementMetaInterface badObject = mock(RepositoryElementMetaInterface.class);
uiJob = new UIEEJob(badObject, mockParent, mockRepository);
}
use of org.pentaho.di.repository.RepositoryElementMetaInterface in project pentaho-kettle by pentaho.
the class UIEETransformationTest method testIllegalArgumentOnConstructor.
@Test(expected = IllegalArgumentException.class)
public void testIllegalArgumentOnConstructor() throws Exception {
RepositoryElementMetaInterface badObject = mock(RepositoryElementMetaInterface.class);
uiTransformation = new UIEETransformation(badObject, mockParent, mockRepository);
}
Aggregations