/** * Initializes the Kettle environment. This method will attempt to configure Simple JNDI, by simply calling * init(true). * * @throws KettleException Any errors that occur during initialization will throw a KettleException. * @see KettleEnvironment#init(boolean) */ public static void init() throws KettleException { init( true ); }
public static void main( String[] args ) throws Exception { // startup Scale ( a.k.a. PDI minimal/headless environment ) KettleClientEnvironment.getInstance().setClient( KettleClientEnvironment.ClientType.SCALE ); KettleEnvironment.init(); } }
@Override public KettleException call() throws Exception { registerUIPluginObjectTypes(); KettleClientEnvironment.getInstance().setClient( KettleClientEnvironment.ClientType.SPOON ); try { KettleEnvironment.init(); } catch ( KettleException e ) { return e; } return null; } } );
@Before public void setupBefore() throws Exception { // Without initialization of the Kettle Environment, the load of the transformation fails // when run in Windows (saying it cannot find the Database plugin ID for Oracle). Digging into // it I discovered that it's during the read of the shared objects xml which doesn't reference Oracle // at all. Initializing the environment fixed everything. KettleEnvironment.init(); }
@Override void defaultInit() throws Throwable { super.defaultInit(); KettleEnvironment.init(); }
@BeforeClass public static void init() throws Exception { KettleEnvironment.init(); }
@Before public void before() throws KettleException { KettleEnvironment.init(); }
@BeforeClass public static void setUpClass() throws Exception { KettleEnvironment.init(); }
@Before public void setUp() throws KettleException { KettleEnvironment.init(); oldSecurityManager = System.getSecurityManager(); sysOutContent = new ByteArrayOutputStream(); sysErrContent = new ByteArrayOutputStream(); System.setSecurityManager( new MySecurityManager( oldSecurityManager ) ); mockRepositoriesMeta = mock( RepositoriesMeta.class ); mockRepositoryMeta = mock( RepositoryMeta.class ); mockRepository = mock( Repository.class ); mockRepositoryDirectory = mock( RepositoryDirectoryInterface.class ); }
@BeforeClass public static void setUp() throws KettleException { KettleEnvironment.init(); smh = new StepMockHelper<TextFileInputMeta, TextFileInputData>( "CsvInputTest", TextFileInputMeta.class, TextFileInputData.class ); when( smh.logChannelInterfaceFactory.create( any(), any( LoggingObjectInterface.class ) ) ) .thenReturn( smh.logChannelInterface ); when( smh.trans.isRunning() ).thenReturn( true ); }
@BeforeClass public static void setUp() throws KettleException { KettleEnvironment.init(); helper = new StepMockHelper<>( "ExcelOutputTest", ExcelOutputMeta.class, ExcelOutputData.class ); when( helper.logChannelInterfaceFactory.create( any(), any( LoggingObjectInterface.class ) ) ).thenReturn( helper.logChannelInterface ); when( helper.trans.isRunning() ).thenReturn( true ); }
@BeforeClass public static void setUp() throws KettleException { KettleEnvironment.init(); smh = new StepMockHelper<TextFileInputMeta, TextFileInputData>( "CsvInputTest", TextFileInputMeta.class, TextFileInputData.class ); when( smh.logChannelInterfaceFactory.create( any(), any( LoggingObjectInterface.class ) ) ) .thenReturn( smh.logChannelInterface ); when( smh.trans.isRunning() ).thenReturn( true ); }
@BeforeClass public static void setUp() throws KettleException { KettleEnvironment.init(); helper = new StepMockHelper<ExcelOutputMeta, ExcelOutputData>( "ExcelOutputTest", ExcelOutputMeta.class, ExcelOutputData.class ); when( helper.logChannelInterfaceFactory.create( any(), any( LoggingObjectInterface.class ) ) ).thenReturn( helper.logChannelInterface ); when( helper.trans.isRunning() ).thenReturn( true ); }
@BeforeClass public static void setUpBeforeClass() throws KettleException { KettleEnvironment.init(); PluginRegistry.init( false ); }
@Before public void setUpLoadSave() throws Exception { KettleEnvironment.init(); PluginRegistry.init( false ); List<String> attributes = Arrays.asList( "linesRange", "lineNumberField" ); Map<String, String> aMap = new HashMap<String, String>(); loadSaveTester = new LoadSaveTester( testMetaClass, attributes, aMap, aMap ); }
@BeforeClass public static void initKettle() throws Exception { if ( Props.isInitialized() ) { Props.getInstance().setOnlyUsedConnectionsSavedToXML( false ); } KettleEnvironment.init(); }
@Test public void dataReturnsCachedValues() throws Exception { KettleEnvironment.init( false ); CalculatorData data = new CalculatorData(); ValueMetaInterface valueMeta = data.getValueMetaFor( ValueMetaInterface.TYPE_INTEGER, null ); ValueMetaInterface shouldBeTheSame = data.getValueMetaFor( ValueMetaInterface.TYPE_INTEGER, null ); assertTrue( "CalculatorData should cache loaded value meta instances", valueMeta == shouldBeTheSame ); } }
@BeforeClass public static void init() throws KettleException { assertEquals( DEFAULT_ROUND_2_MODE, getRound2Mode() ); setRound2Mode( OBSOLETE_ROUND_2_MODE ); assertEquals( OBSOLETE_ROUND_2_MODE, getRound2Mode() ); KettleEnvironment.init( false ); }
@Before public void setUp() throws Exception { KettleEnvironment.init(); meta = new ExcelInputMeta(); meta.setFileName( new String[] { "1", "2", "3" } ); meta.setSheetName( new String[] { "1", "2", "3", "4" } ); meta.setField( new ExcelInputField[] { new ExcelInputField( "1", 1, 1 ), new ExcelInputField( "2", 2, 2 ) } ); meta.normilizeAllocation(); }
@Test public void testOracleDBRepoStringLength() throws Exception { KettleEnvironment.init(); DatabaseMeta databaseMeta = new DatabaseMeta( "OraRepo", "ORACLE", "JDBC", null, "test", null, null, null ); repositoryMeta = new KettleDatabaseRepositoryMeta( "KettleDatabaseRepository", "OraRepo", "Ora Repository", databaseMeta ); repository = new KettleDatabaseRepository(); repository.init( repositoryMeta ); KettleDatabaseRepositoryCreationHelper helper = new KettleDatabaseRepositoryCreationHelper( repository ); int repoStringLength = helper.getRepoStringLength(); assertEquals( EXPECTED_ORACLE_DB_REPO_STRING, repoStringLength ); }