Skip to content

Commit

Permalink
Merge pull request pentaho#4393 from kurtwalker/BACKLOG-18774
Browse files Browse the repository at this point in the history
[BACKLOG-18774] - trans with only one step should consider that step …
  • Loading branch information
DFieldFL authored Sep 15, 2017
2 parents 33e6f61 + 7dcd817 commit 71cf24d
Show file tree
Hide file tree
Showing 4 changed files with 485 additions and 5 deletions.
3 changes: 3 additions & 0 deletions engine/src/main/java/org/pentaho/di/trans/TransMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,9 @@ public List<StepMeta> getUsedSteps() {
list.add( stepMeta );
}
}
if ( list.isEmpty() && getSteps().size() == 1 ) {
list = getSteps();
}

return list;
}
Expand Down
5 changes: 5 additions & 0 deletions engine/src/test/java/org/pentaho/di/trans/TransMetaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -457,4 +457,9 @@ public void testLoadXml() throws KettleException {
Assert.assertEquals( repDirectory.getPath(), meta.getVariable( Const.INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY ) );
}

@Test
public void testTransWithOneStepIsConsideredUsed() throws Exception {
TransMeta transMeta = new TransMeta( getClass().getResource( "one-step-trans.ktr" ).getPath() );
assertEquals( 1, transMeta.getUsedSteps().size() );
}
}
Loading

0 comments on commit 71cf24d

Please sign in to comment.