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


Java JobEntrySpecial.setDummy方法代码示例

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


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

示例1: testRule

import org.pentaho.di.job.entries.special.JobEntrySpecial; //导入方法依赖的package包/类
public void testRule() throws Exception {
  
  // Create a job to test.
  //
  JobMeta jobMeta = new JobMeta();

  // Add 3 dummy steps connected with hops.
  //
  JobEntryCopy lastCopy = null;
  for (int i=0;i<3;i++) {
    JobEntrySpecial dummy = new JobEntrySpecial();
    dummy.setDummy(true);
    dummy.setName("dummy"+(i+1));
    
    JobEntryCopy copy = new JobEntryCopy(dummy);
    copy.setLocation(50+i*50,50);
    copy.setDrawn();
    jobMeta.addJobEntry(copy);
    
    if (lastCopy!=null) {
      JobHopMeta hop = new JobHopMeta(lastCopy, copy);
      jobMeta.addJobHop(hop);
    }
    lastCopy = copy;
  }
 
  // Load the plugin to test from the registry.
  //
  PluginRegistry registry = PluginRegistry.getInstance();
  PluginInterface plugin = registry.findPluginWithId(ImportRulePluginType.class, "JobHasNoDisabledHops");
  assertNotNull("The 'job has no disabled hops' rule could not be found in the plugin registry!", plugin);

  JobHasNoDisabledHopsImportRule rule = (JobHasNoDisabledHopsImportRule) registry.loadClass(plugin);
  assertNotNull("The 'job has no disabled hops' class could not be loaded by the plugin registry!", plugin);

  rule.setEnabled(true);
  
  List<ImportValidationFeedback> feedback = rule.verifyRule(jobMeta);
  assertTrue("We didn't get any feedback from the 'job has no disabled hops'", !feedback.isEmpty());
  assertTrue("An approval ruling was expected", feedback.get(0).getResultType()==ImportValidationResultType.APPROVAL);

  jobMeta.getJobHop(0).setEnabled(false);

  feedback = rule.verifyRule(jobMeta);
  assertTrue("We didn't get any feedback from the 'job has no disabled hops'", !feedback.isEmpty());
  assertTrue("An error ruling was expected", feedback.get(0).getResultType()==ImportValidationResultType.ERROR);

  rule.setEnabled(false);

  feedback = rule.verifyRule(jobMeta);
  assertTrue("We didn't expect any feedback from the 'job has no disabled hops' while disabled", feedback.isEmpty());
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:53,代码来源:JobHasNoDisabledHopsImportRuleTest.java

示例2: testRule

import org.pentaho.di.job.entries.special.JobEntrySpecial; //导入方法依赖的package包/类
public void testRule() throws Exception {

    // Create a job to test.
    //
    JobMeta jobMeta = new JobMeta();

    // Add 3 dummy steps connected with hops.
    //
    JobEntryCopy lastCopy = null;
    for ( int i = 0; i < 3; i++ ) {
      JobEntrySpecial dummy = new JobEntrySpecial();
      dummy.setDummy( true );
      dummy.setName( "dummy" + ( i + 1 ) );

      JobEntryCopy copy = new JobEntryCopy( dummy );
      copy.setLocation( 50 + i * 50, 50 );
      copy.setDrawn();
      jobMeta.addJobEntry( copy );

      if ( lastCopy != null ) {
        JobHopMeta hop = new JobHopMeta( lastCopy, copy );
        jobMeta.addJobHop( hop );
      }
      lastCopy = copy;
    }

    // Load the plugin to test from the registry.
    //
    PluginRegistry registry = PluginRegistry.getInstance();
    PluginInterface plugin = registry.findPluginWithId( ImportRulePluginType.class, "JobHasNoDisabledHops" );
    assertNotNull( "The 'job has no disabled hops' rule could not be found in the plugin registry!", plugin );

    JobHasNoDisabledHopsImportRule rule = (JobHasNoDisabledHopsImportRule) registry.loadClass( plugin );
    assertNotNull( "The 'job has no disabled hops' class could not be loaded by the plugin registry!", plugin );

    rule.setEnabled( true );

    List<ImportValidationFeedback> feedback = rule.verifyRule( jobMeta );
    assertTrue( "We didn't get any feedback from the 'job has no disabled hops'", !feedback.isEmpty() );
    assertTrue(
      "An approval ruling was expected",
      feedback.get( 0 ).getResultType() == ImportValidationResultType.APPROVAL );

    jobMeta.getJobHop( 0 ).setEnabled( false );

    feedback = rule.verifyRule( jobMeta );
    assertTrue( "We didn't get any feedback from the 'job has no disabled hops'", !feedback.isEmpty() );
    assertTrue(
      "An error ruling was expected", feedback.get( 0 ).getResultType() == ImportValidationResultType.ERROR );

    rule.setEnabled( false );

    feedback = rule.verifyRule( jobMeta );
    assertTrue( "We didn't expect any feedback from the 'job has no disabled hops' while disabled", feedback
      .isEmpty() );
  }
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:57,代码来源:JobHasNoDisabledHopsImportRuleIT.java


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