本文整理汇总了Java中org.pentaho.di.repository.RepositoryDirectory.addSubdirectory方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryDirectory.addSubdirectory方法的具体用法?Java RepositoryDirectory.addSubdirectory怎么用?Java RepositoryDirectory.addSubdirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.repository.RepositoryDirectory
的用法示例。
在下文中一共展示了RepositoryDirectory.addSubdirectory方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testLoadRepositoryObjectsFilled
import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
@Test
public void testLoadRepositoryObjectsFilled() throws Exception {
RepositoryDirectory root = new RepositoryDirectory();
root.setObjectId( new LongObjectId( 0L ) );
RepositoryDirectory dir = new RepositoryDirectory();
dir.setObjectId( new LongObjectId( 1L ) );
root.addSubdirectory( dir );
RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );
root.setRepositoryObjects( Collections.emptyList() );
dir.setRepositoryObjects( Collections.singletonList( meta ) );
Repository repo = mock( Repository.class );
assertTrue( RepositoryDirectoryUI.loadRepositoryObjects( root, true, true, repo ).isEmpty() );
assertEquals( 1, RepositoryDirectoryUI.loadRepositoryObjects( dir, true, true, repo ).size() );
verifyZeroInteractions( repo );
}
示例2: testLoadRepositoryObjectsNulled
import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
@Test
public void testLoadRepositoryObjectsNulled() throws Exception {
RepositoryDirectory root = new RepositoryDirectory();
root.setObjectId( new LongObjectId( 0L ) );
RepositoryDirectory dir = new RepositoryDirectory();
dir.setObjectId( new LongObjectId( 1L ) );
root.addSubdirectory( dir );
RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );
Repository repo = mock( Repository.class );
when( repo.getJobAndTransformationObjects( dir.getObjectId(), false ) ).thenReturn(
Collections.singletonList( meta ) );
when( repo.getJobAndTransformationObjects( root.getObjectId(), false ) ).thenReturn( Collections.emptyList() );
assertTrue( RepositoryDirectoryUI.loadRepositoryObjects( root, true, true, repo ).isEmpty() );
assertEquals( 1, RepositoryDirectoryUI.loadRepositoryObjects( dir, true, true, repo ).size() );
}
示例3: testGetRepositoryObjectsFilled
import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
@Test
public void testGetRepositoryObjectsFilled() throws Exception {
RepositoryDirectory root = new RepositoryDirectory();
root.setObjectId( new LongObjectId( 0L ) );
RepositoryDirectory dir = new RepositoryDirectory();
dir.setObjectId( new LongObjectId( 1L ) );
root.addSubdirectory( dir );
RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );
root.setRepositoryObjects( Collections.emptyList() );
dir.setRepositoryObjects( Collections.singletonList( meta ) );
Repository repo = mock( Repository.class );
UIRepositoryDirectory uiDir = new UIRepositoryDirectory( root, null, repo );
UIRepositoryObjects objects = uiDir.getRepositoryObjects();
assertNotNull( objects );
uiDir = new UIRepositoryDirectory( dir, uiDir, repo );
objects = uiDir.getRepositoryObjects();
assertEquals( 1, objects.size() );
verifyZeroInteractions( repo );
}
示例4: testGetRepositoryObjectsNulled
import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
@Test
public void testGetRepositoryObjectsNulled() throws Exception {
RepositoryDirectory root = new RepositoryDirectory();
root.setObjectId( new LongObjectId( 0L ) );
RepositoryDirectory dir = new RepositoryDirectory();
dir.setObjectId( new LongObjectId( 1L ) );
root.addSubdirectory( dir );
RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );
Repository repo = mock( Repository.class );
when( repo.getJobAndTransformationObjects( dir.getObjectId(), false ) ).thenReturn(
Collections.singletonList( meta ) );
when( repo.getJobAndTransformationObjects( root.getObjectId(), false ) ).thenReturn( Collections.emptyList() );
UIRepositoryDirectory uiDir = new UIRepositoryDirectory( root, null, repo );
UIRepositoryObjects objects = uiDir.getRepositoryObjects();
assertNotNull( objects );
uiDir = new UIRepositoryDirectory( dir, uiDir, repo );
objects = uiDir.getRepositoryObjects();
assertEquals( 1, objects.size() );
}
示例5: testRefresh
import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
@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 );
}
示例6: initRepositoryDirectoryTree
import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
private RepositoryDirectoryInterface initRepositoryDirectoryTree( RepositoryFileTree repoTree )
throws KettleException {
RepositoryFile rootFolder = repoTree.getFile();
RepositoryDirectory rootDir = new RepositoryDirectory();
rootDir.setObjectId( new StringObjectId( rootFolder.getId().toString() ) );
fillRepositoryDirectoryFromTree( rootDir, repoTree );
// Example: /etc
RepositoryDirectory etcDir = rootDir.findDirectory( ClientRepositoryPaths.getEtcFolderPath() );
RepositoryDirectory newRoot = new RepositoryDirectory();
newRoot.setObjectId( rootDir.getObjectId() );
newRoot.setVisible( false );
for ( int i = 0; i < rootDir.getNrSubdirectories(); i++ ) {
RepositoryDirectory childDir = rootDir.getSubdirectory( i );
// Don't show /etc
boolean isEtcChild = childDir.equals( etcDir );
if ( isEtcChild ) {
continue;
}
newRoot.addSubdirectory( childDir );
}
return newRoot;
}