当前位置: 首页>>代码示例>>Java>>正文


Java RepositoryElementInterface.setRepositoryDirectory方法代码示例

本文整理汇总了Java中org.pentaho.di.repository.RepositoryElementInterface.setRepositoryDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryElementInterface.setRepositoryDirectory方法的具体用法?Java RepositoryElementInterface.setRepositoryDirectory怎么用?Java RepositoryElementInterface.setRepositoryDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.repository.RepositoryElementInterface的用法示例。


在下文中一共展示了RepositoryElementInterface.setRepositoryDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testDeletedFlagForObject

import org.pentaho.di.repository.RepositoryElementInterface; //导入方法依赖的package包/类
private void testDeletedFlagForObject( Callable<RepositoryElementInterface> elementProvider ) throws Exception {
  TransDelegate transDelegate = new TransDelegate( purRepository, unifiedRepository );
  JobDelegate jobDelegate = new JobDelegate( purRepository, unifiedRepository );
  FieldUtils.writeField( purRepository, "transDelegate", transDelegate, true );
  FieldUtils.writeField( purRepository, "jobDelegate", jobDelegate, true );

  RepositoryElementInterface element = elementProvider.call();
  RepositoryDirectoryInterface directory = purRepository.findDirectory( element.getRepositoryDirectory().getPath() );
  element.setRepositoryDirectory( directory );

  purRepository.save( element, null, null );
  assertNotNull( "Element was saved", element.getObjectId() );

  RepositoryObject information;
  information = purRepository.getObjectInformation( element.getObjectId(), element.getRepositoryElementType() );
  assertNotNull( information );
  assertFalse( information.isDeleted() );

  purRepository.deleteTransformation( element.getObjectId() );
  assertNotNull( "Element was moved to Trash", unifiedRepository.getFileById( element.getObjectId().getId() ) );

  information = purRepository.getObjectInformation( element.getObjectId(), element.getRepositoryElementType() );
  assertNotNull( information );
  assertTrue( information.isDeleted() );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:PurRepository_GetObjectInformation_IT.java

示例2: testOnlyRevision_DateAndCommentAreSaved

import org.pentaho.di.repository.RepositoryElementInterface; //导入方法依赖的package包/类
private void testOnlyRevision_DateAndCommentAreSaved( RepositoryElementInterface transOrJob ) throws Exception {
  final String elementName = "onlyRevision_" + transOrJob.getRepositoryElementType();
  final String comment = "onlyRevision";
  final Calendar date = Calendar.getInstance();
  date.setTimeInMillis( 0 );

  transOrJob.setName( elementName );
  transOrJob.setRepositoryDirectory( purRepository.getDefaultSaveDirectory( transOrJob ) );
  purRepository.save( transOrJob, comment, date, null, false );

  assertCommentAndDate( transOrJob.getObjectRevision(), date, comment );

  List<VersionSummary> versions = assertExistsAndGetRevisions( transOrJob );
  assertEquals( 1, versions.size() );
  assertCommentAndDate( versions.get( 0 ), date, comment );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:17,代码来源:PurRepository_Revisions_IT.java

示例3: testOnlyRevision_DateAndCommentAreNull

import org.pentaho.di.repository.RepositoryElementInterface; //导入方法依赖的package包/类
private void testOnlyRevision_DateAndCommentAreNull( RepositoryElementInterface transOrJob ) throws Exception {
  final String elementName = "revisionWithOutComment_" + transOrJob.getRepositoryElementType();

  transOrJob.setName( elementName );
  transOrJob.setRepositoryDirectory( purRepository.getDefaultSaveDirectory( transOrJob ) );

  final long before = System.currentTimeMillis();
  purRepository.save( transOrJob, null, null, null, false );
  final long after = System.currentTimeMillis();

  assertNull( transOrJob.getObjectRevision().getComment() );

  final long revisionDate = transOrJob.getObjectRevision().getCreationDate().getTime();
  assertTrue( "Revision date should be inside 'before' and 'after' measurements", before <= revisionDate
      && revisionDate <= after );

  List<VersionSummary> versions = assertExistsAndGetRevisions( transOrJob );
  assertEquals( 1, versions.size() );
  assertNull( versions.get( 0 ).getMessage() );

  final long versionSummaryDate = versions.get( 0 ).getDate().getTime();
  assertTrue( "Revision date should be inside 'before' and 'after' measurements", before <= versionSummaryDate
      && versionSummaryDate <= after );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:25,代码来源:PurRepository_Revisions_IT.java

示例4: testTwoRevisions_DateAndCommentAreSaved

import org.pentaho.di.repository.RepositoryElementInterface; //导入方法依赖的package包/类
private void testTwoRevisions_DateAndCommentAreSaved( RepositoryElementInterface transOrJob ) throws Exception {
  final String elementName = "twoRevisions_" + transOrJob.getRepositoryElementType();

  final String comment1 = "first";
  final Calendar date1 = Calendar.getInstance();
  date1.setTimeInMillis( 0 );

  final String comment2 = "second";
  final Calendar date2 = Calendar.getInstance();
  date2.setTimeInMillis( 100 );

  transOrJob.setName( elementName );
  transOrJob.setRepositoryDirectory( purRepository.getDefaultSaveDirectory( transOrJob ) );

  purRepository.save( transOrJob, comment1, date1, null, false );
  assertCommentAndDate( transOrJob.getObjectRevision(), date1, comment1 );

  purRepository.save( transOrJob, comment2, date2, null, false );
  assertCommentAndDate( transOrJob.getObjectRevision(), date2, comment2 );

  List<VersionSummary> versions = assertExistsAndGetRevisions( transOrJob );
  assertEquals( 2, versions.size() );
  assertCommentAndDate( versions.get( 0 ), date1, comment1 );
  assertCommentAndDate( versions.get( 1 ), date2, comment2 );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:PurRepository_Revisions_IT.java


注:本文中的org.pentaho.di.repository.RepositoryElementInterface.setRepositoryDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。