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


Java RepositoryElementInterface.setName方法代码示例

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


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

示例1: testDoesNotChangeFileWhenFailsToRename

import org.pentaho.di.repository.RepositoryElementInterface; //导入方法依赖的package包/类
private void testDoesNotChangeFileWhenFailsToRename( RepositoryElementInterface element1,
    RepositoryElementInterface element2, Callable<RepositoryElementInterface> loader ) throws Exception {
  final String name1 = "name1";
  final String name2 = "name2";

  element1.setName( name1 );
  element2.setName( name2 );

  repository.save( element1, "", null );
  repository.save( element2, "", null );

  element2.setName( name1 );
  try {
    repository.save( element2, "", null, true );
    fail( "A naming conflict should occur" );
  } catch ( KettleException e ) {
    // expected to be thrown
    element2.setName( name2 );
  }
  RepositoryElementInterface loaded = loader.call();
  assertEquals( element2, loaded );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:PurRepositoryIT.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.setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。