Search in sources :

Example 81 with LongObjectId

use of org.pentaho.di.repository.LongObjectId in project pentaho-kettle by pentaho.

the class UIRepositoryDirectoryTest method testRefresh.

@Test
public void testRefresh() throws Exception {
    RepositoryDirectory root = new RepositoryDirectory();
    LongObjectId rootObjectId = new LongObjectId(0L);
    root.setObjectId(rootObjectId);
    RepositoryDirectory dir = new RepositoryDirectory();
    dir.setObjectId(new LongObjectId(1L));
    root.addSubdirectory(dir);
    RepositoryExtended repo = mock(RepositoryExtended.class);
    UserInfo userInfo = new UserInfo();
    userInfo.setAdmin(true);
    Mockito.when(repo.getUserInfo()).thenReturn(userInfo);
    RepositoryDirectory rd = Mockito.mock(RepositoryDirectory.class);
    Mockito.when(rd.findDirectory(Mockito.eq(rootObjectId))).thenReturn(Mockito.mock(RepositoryDirectory.class));
    Mockito.when(repo.loadRepositoryDirectoryTree("/", "*.ktr|*.kjb", -1, true, true, true)).thenReturn(rd);
    UIRepositoryDirectory uiDir = new UIRepositoryDirectory(root, null, repo);
    uiDir.refresh();
    Mockito.verify(repo).loadRepositoryDirectoryTree("/", "*.ktr|*.kjb", -1, true, true, true);
}
Also used : RepositoryDirectory(org.pentaho.di.repository.RepositoryDirectory) RepositoryExtended(org.pentaho.di.repository.RepositoryExtended) UserInfo(org.pentaho.di.repository.UserInfo) LongObjectId(org.pentaho.di.repository.LongObjectId) Test(org.junit.Test)

Aggregations

LongObjectId (org.pentaho.di.repository.LongObjectId)81 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)54 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)36 ObjectId (org.pentaho.di.repository.ObjectId)30 KettleException (org.pentaho.di.core.exception.KettleException)18 Test (org.junit.Test)17 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)17 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)14 Matchers.anyString (org.mockito.Matchers.anyString)10 MetaStoreException (org.pentaho.metastore.api.exceptions.MetaStoreException)10 ArrayList (java.util.ArrayList)9 RepositoryDirectory (org.pentaho.di.repository.RepositoryDirectory)9 RepositoryObject (org.pentaho.di.repository.RepositoryObject)8 MetaStoreDependenciesExistsException (org.pentaho.metastore.api.exceptions.MetaStoreDependenciesExistsException)8 MetaStoreElementExistException (org.pentaho.metastore.api.exceptions.MetaStoreElementExistException)8 MetaStoreElementTypeExistsException (org.pentaho.metastore.api.exceptions.MetaStoreElementTypeExistsException)8 MetaStoreNamespaceExistsException (org.pentaho.metastore.api.exceptions.MetaStoreNamespaceExistsException)8 SimpleLoggingObject (org.pentaho.di.core.logging.SimpleLoggingObject)7 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)7 StringObjectId (org.pentaho.di.repository.StringObjectId)7