本文整理汇总了Java中org.pentaho.di.core.KettleClientEnvironment.init方法的典型用法代码示例。如果您正苦于以下问题:Java KettleClientEnvironment.init方法的具体用法?Java KettleClientEnvironment.init怎么用?Java KettleClientEnvironment.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.KettleClientEnvironment
的用法示例。
在下文中一共展示了KettleClientEnvironment.init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initRepository
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
/**
* 初始化资源库
*
* @param repo
* 资源库
* @param isConnected
* (是否重新连接)
*/
private void initRepository(T entity, boolean isConnected)
throws KettleException {
if (null != entity) {
RepositoriesMeta repositoriesMeta = new RepositoriesMeta();
DatabaseMeta db = new DatabaseMeta();
db.setDatabaseType(entity.getDialect());
db.setAccessType(Integer.parseInt(entity.getAccess()));
db.setDBName(entity.getDb());
db.setHostname(entity.getServer());
db.setDBPort(entity.getPort());
db.setUsername(entity.getUsername());
db.setPassword(entity.getPassword());
KettleDatabaseRepositoryMeta rmeta = new KettleDatabaseRepositoryMeta();
rmeta.setConnection(db);
rmeta.setId(entity.getType());
rmeta.setName(entity.getName());
repositoriesMeta.addDatabase(db);
repositoriesMeta.addRepository(rmeta);
// 选择加载过的资源库
RepositoryMeta meta = repositoriesMeta.findRepository(entity
.getName());
KettleClientEnvironment.init();
// 获得资源库实例
repo = PluginRegistry.getInstance().loadClass(
RepositoryPluginType.class, meta.getId(), Repository.class);
repo.init(meta);
// 连接资源库
repo.connect(entity.getUser(), entity.getPass());
if (!isConnected) {
list.add(repo);
}
}
}
示例2: main
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
public static void main(String[] args) {
try {
KettleClientEnvironment.init();
} catch (KettleException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String obfuscated = Encr.encryptPasswordIfNotUsingVariables( "root" );
System.out.println( obfuscated );
}
示例3: setUp
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@Before
public void setUp() throws KettleException {
KettleClientEnvironment.init();
metaStore = new MemoryMetaStore();
repo = new GitRepository();
repo.setName( NAME );
repo.setDescription( DESCRIPTION );
repo.setDirectory( DIRECTORY );
}
示例4: setUp
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
KettleClientEnvironment.init();
metaStore = new MemoryMetaStore();
inputs = new ArrayList<TransUnitTestSetLocation>();
inputs.add( new TransUnitTestSetLocation( "input-step1", "data-set-name1",
Arrays.asList(
new TransUnitTestFieldMapping( "fieldA", "setFieldA"),
new TransUnitTestFieldMapping( "fieldB", "setFieldB"),
new TransUnitTestFieldMapping( "fieldC", "setFieldC")
), Arrays.asList("order1", "order2", "order3")));
inputs.add( new TransUnitTestSetLocation( "input-step2", "data-set-name2",
Arrays.asList(
new TransUnitTestFieldMapping( "fieldX", "setFieldX"),
new TransUnitTestFieldMapping( "fieldY", "setFieldY"),
new TransUnitTestFieldMapping( "fieldW", "setFieldW"),
new TransUnitTestFieldMapping( "fieldZ", "setFieldZ")
), Arrays.asList("order1", "order2", "order3", "order4")));
goldens = new ArrayList<TransUnitTestSetLocation>();
List<TransUnitTestTweak> tweaks = new ArrayList<TransUnitTestTweak>();
tweaks.add( new TransUnitTestTweak(TransTweak.NONE, "step1") );
tweaks.add( new TransUnitTestTweak(TransTweak.BYPASS_STEP, "step2") );
tweaks.add( new TransUnitTestTweak(TransTweak.REMOVE_STEP, "step3") );
test = new TransUnitTest(NAME, DESCRIPTION,
null, null, "sometrans.ktr",
inputs,
goldens,
tweaks,
TestType.UNIT_TEST,
null, new ArrayList<TransUnitTestDatabaseReplacement>()
);
}
示例5: setUp
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
KettleClientEnvironment.init();
metaStore = new MemoryMetaStore();
databaseMeta = new DatabaseMeta( "dataset", "H2", "JDBC", null, "/tmp/datasets", null, null, null );
dataSetGroup = new DataSetGroup( GROUP_NAME, GROUP_DESC, databaseMeta, GROUP_SCHEMA );
List<DataSetField> fields = new ArrayList<>();
for ( int i = 0; i < NR_FIELDS; i++ ) {
fields.add( new DataSetField( "field" + i, "column" + i, ValueMetaInterface.TYPE_STRING, 50, 0, "comment" + i ) );
}
dataSet = new DataSet( NAME, DESC, dataSetGroup, TABLE, fields );
}
示例6: ConnectionControllerITest
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
public ConnectionControllerITest() throws InitializationError {
super(ConnectionControllerITest.class);
try {
KettleClientEnvironment.init();
} catch (Exception e) {
e.printStackTrace();
}
}
示例7: init
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@BeforeClass
public static void init() throws Exception {
KettleClientEnvironment.init();
PluginRegistry.addPluginType( StepPluginType.getInstance() );
PluginRegistry.init();
if ( !Props.isInitialized() ) {
Props.init( 0 );
}
}
示例8: setUpOnce
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@BeforeClass
public static void setUpOnce() throws KettlePluginException, KettleException {
// Register Natives to create a default DatabaseMeta
DatabasePluginType.getInstance().searchPlugins();
ValueMetaPluginType.getInstance().searchPlugins();
KettleClientEnvironment.init();
}
示例9: setupBeforeClass
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@BeforeClass
public static void setupBeforeClass() throws KettleException {
if ( Const.isWindows() ) {
wasEncoding = System.getProperty( "file.encoding" );
fiddleWithDefaultCharset( "utf8" );
}
KettleClientEnvironment.init();
}
示例10: setupOnce
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@Before
public void setupOnce() throws Exception {
nativeMeta = new OracleRDBDatabaseMeta();
odbcMeta = new OracleRDBDatabaseMeta();
jndiMeta = new OracleRDBDatabaseMeta();
nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
odbcMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_ODBC );
jndiMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_JNDI );
KettleClientEnvironment.init();
}
示例11: setupOnce
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@Before
public void setupOnce() throws Exception {
nativeMeta = new ConcreteBaseDatabaseMeta();
nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
odbcMeta = new ConcreteBaseDatabaseMeta();
nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_ODBC );
jndiMeta = new ConcreteBaseDatabaseMeta();
KettleClientEnvironment.init();
}
示例12: main
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
/**
* The main startup of the Aggregation Designer
* @param args
*/
public static void main(String[] args) {
try {
KettleClientEnvironment.init();
ApplicationContext context = new ClassPathXmlApplicationContext(
new String[] {"applicationContext.xml", "plugins.xml"}); //$NON-NLS-1$ //$NON-NLS-2$
UIMain uiMain = (UIMain) context.getBean("uiMain"); //$NON-NLS-1$
uiMain.start(context);
} catch (Throwable t) {
logger.error("uncaught exception in main", t);
System.exit(1);
}
}
示例13: setUp
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
KettleClientEnvironment.init();
metaStore = new MemoryMetaStore();
// metaStore = MetaStoreConst.openLocalPentahoMetaStore();
// Temporary databases and so on.
//
File tmpSharedObjectsFile = File.createTempFile("shared-objects-unit-test", ".xml");
sharedObjects = new SharedObjects();
// This Database needs to be found in a shared objects store...
//
databaseMeta = new DatabaseMeta( "dataset", "H2", "JDBC", null, "/tmp/datasets", null, null, null );
sharedObjects.storeObject(databaseMeta);
sharedObjects.setFilename(tmpSharedObjectsFile.getAbsolutePath());
sharedObjects.saveToFile();
dataSetGroup = new DataSetGroup( GROUP_NAME, GROUP_DESC, databaseMeta, GROUP_SCHEMA );
// Write an input data set...
//
createInputDataSet();
// Write the golden data set...
//
createGoldenDataSet();
// Create a unit test...
//
createUnitTest();
// Create the data set group in the metastore...
//
MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE);
groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, Arrays.asList( databaseMeta ) );
groupFactory.saveElement( dataSetGroup );
// Create the input data set in the metastore...
//
MetaStoreFactory<DataSet> setFactory = new MetaStoreFactory<DataSet>( DataSet.class, metaStore, PentahoDefaults.NAMESPACE);
setFactory.addNameList( DataSetConst.GROUP_LIST_KEY, groupFactory.getElements() );
setFactory.saveElement( inputDataSet );
// Create the golden data set in the metastore...
//
setFactory.saveElement( goldenDataSet );
// Create a unit test...
MetaStoreFactory<TransUnitTest> testFactory = new MetaStoreFactory<TransUnitTest>( TransUnitTest.class, metaStore, PentahoDefaults.NAMESPACE);
testFactory.saveElement( unitTest );
// Reload the whole thing...
factories = new FactoriesHierarchy( metaStore, Arrays.asList( databaseMeta ) );
DataSetGroup verifyGroup = factories.getGroupFactory().loadElement(dataSetGroup.getName());
assertNotNull(verifyGroup.getDatabaseMeta());
}
示例14: setUp
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
KettleClientEnvironment.init();
databaseMeta = new DatabaseMeta( "foo", "H2", "JDBC", null, null, null, null, null );
metaStore = new MemoryMetaStore();
}
示例15: setupBeforeClass
import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@BeforeClass
public static void setupBeforeClass() throws KettleException {
if ( !KettleClientEnvironment.isInitialized() ) {
KettleClientEnvironment.init();
}
}