Java Code Examples for org.pentaho.di.trans.TransMeta#setPrivateDatabases()

The following examples show how to use org.pentaho.di.trans.TransMeta#setPrivateDatabases() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StreamToTransNodeConverterTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Test
public void filterPrivateDatabasesWithOnePrivateDatabaseTest() {
  IUnifiedRepository purMock = mock( IUnifiedRepository.class );
  TransMeta transMeta = new TransMeta(  );
  transMeta.setDatabases( getDummyDatabases() );
  Set<String> privateDatabases = new HashSet<>(  );
  privateDatabases.add( "database2" );
  transMeta.setPrivateDatabases( privateDatabases );
  StreamToTransNodeConverter transConverter = new StreamToTransNodeConverter( purMock );
  assertEquals( 1, transConverter.filterPrivateDatabases( transMeta ).getDatabases().size() );
}
 
Example 2
Source File: StreamToTransNodeConverterTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Test
public void filterPrivateDatabasesWithOnePrivateDatabaseAndOneInUseTest() {
  IUnifiedRepository purMock = mock( IUnifiedRepository.class );
  TransMeta transMeta = spy( TransMeta.class );
  transMeta.setDatabases( getDummyDatabases() );
  Set<String> privateDatabases = new HashSet<>(  );
  privateDatabases.add( "database2" );
  transMeta.setPrivateDatabases( privateDatabases );
  when( transMeta.isDatabaseConnectionUsed( getDummyDatabases().get( 0 ) ) ).thenReturn( true );
  StreamToTransNodeConverter transConverter = new StreamToTransNodeConverter( purMock );
  assertEquals( 2, transConverter.filterPrivateDatabases( transMeta ).getDatabases().size() );
}
 
Example 3
Source File: StreamToTransNodeConverterTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Test
public void filterPrivateDatabasesWithOneInUseTest() {
  IUnifiedRepository purMock = mock( IUnifiedRepository.class );
  TransMeta transMeta = spy( TransMeta.class );
  transMeta.setDatabases( getDummyDatabases() );
  transMeta.setPrivateDatabases( new HashSet<>(  ) );
  when( transMeta.isDatabaseConnectionUsed( getDummyDatabases().get( 0 ) ) ).thenReturn( true );
  StreamToTransNodeConverter transConverter = new StreamToTransNodeConverter( purMock );
  assertEquals( 1, transConverter.filterPrivateDatabases( transMeta ).getDatabases().size() );
}
 
Example 4
Source File: StreamToTransNodeConverterTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Test
public void filterPrivateDatabasesNoPrivateDatabaseTest() {
  IUnifiedRepository purMock = mock( IUnifiedRepository.class );
  TransMeta transMeta = new TransMeta(  );
  transMeta.setDatabases( getDummyDatabases() );
  transMeta.setPrivateDatabases( new HashSet<>(  ) );
  StreamToTransNodeConverter transConverter = new StreamToTransNodeConverter( purMock );
  assertEquals( 0, transConverter.filterPrivateDatabases( transMeta ).getDatabases().size() );
}
 
Example 5
Source File: StreamToTransNodeConverterTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Test
public void filterPrivateDatabasesNullPrivateDatabaseTest() {
  IUnifiedRepository purMock = mock( IUnifiedRepository.class );
  TransMeta transMeta = new TransMeta(  );
  transMeta.setDatabases( getDummyDatabases() );
  transMeta.setPrivateDatabases( null );
  StreamToTransNodeConverter transConverter = new StreamToTransNodeConverter( purMock );
  assertEquals( transMeta.getDatabases().size(), transConverter.filterPrivateDatabases( transMeta ).getDatabases().size() );
}