本文整理汇总了Java中org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator类的典型用法代码示例。如果您正苦于以下问题:Java ListLoadSaveValidator类的具体用法?Java ListLoadSaveValidator怎么用?Java ListLoadSaveValidator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ListLoadSaveValidator类属于org.pentaho.di.trans.steps.loadsave.validator包,在下文中一共展示了ListLoadSaveValidator类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpLoadSave
import org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator; //导入依赖的package包/类
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init( true );
List<String> attributes =
Arrays.asList( "transName", "fileName", "directoryPath", "allowingMultipleInputs", "allowingMultipleOutputs",
"specificationMethod", "transObjectId", "inputMappings", "outputMappings", "mappingParameters" );
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put( "specificationMethod", new ObjectLocationSpecificationMethodLoadSaveValidator() );
attrValidatorMap.put( "transObjectId", new ObjectIdLoadSaveValidator() );
attrValidatorMap.put( "inputMappings", new ListLoadSaveValidator<MappingIODefinition>( new MappingIODefinitionLoadSaveValidator(), 5 ) );
attrValidatorMap.put( "outputMappings", new ListLoadSaveValidator<MappingIODefinition>( new MappingIODefinitionLoadSaveValidator(), 5 ) );
attrValidatorMap.put( "mappingParameters", new MappingParametersLoadSaveValidator() );
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester =
new LoadSaveTester( testMetaClass, attributes, new HashMap<String, String>(), new HashMap<String, String>(),
attrValidatorMap, typeValidatorMap );
}
示例2: setUpLoadSave
import org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator; //导入依赖的package包/类
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init( true );
List<String> attributes =
Arrays.asList( "url", "operationName", "operationRequestName", "operationNamespace", "inFieldContainerName",
"inFieldArgumentName", "outFieldContainerName", "outFieldArgumentName", "proxyHost", "proxyPort", "httpLogin",
"httpPassword", "passingInputData", "callStep", "compatible", "repeatingElementName", "returningReplyAsString",
"fieldsIn", "fieldsOut" );
Map<String, String> getterMap = new HashMap<String, String>();
Map<String, String> setterMap = new HashMap<String, String>();
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put( "fieldsIn",
new ListLoadSaveValidator<WebServiceField>( new WebServiceFieldLoadSaveValidator(), 5 ) );
attrValidatorMap.put( "fieldsOut",
new ListLoadSaveValidator<WebServiceField>( new WebServiceFieldLoadSaveValidator(), 5 ) );
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester =
new LoadSaveTester( testMetaClass, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap );
}
示例3: setUpLoadSave
import org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator; //导入依赖的package包/类
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init( true );
List<String> attributes =
Arrays.asList( "acceptingField", "outputFields" );
Map<String, String> gsMap = new HashMap<String, String>();
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put( "outputFields",
new ListLoadSaveValidator<SasInputField>( new SasInputFieldLoadSaveValidator(), 5 ) );
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester =
new LoadSaveTester( testMetaClass, attributes, gsMap, gsMap, attrValidatorMap, typeValidatorMap );
}
示例4: testStepMeta
import org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator; //导入依赖的package包/类
@Test
public void testStepMeta() throws KettleException {
List<String> attributes = Arrays.asList( "inputField", "outputField", "fallBackValue", "rules" );
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put( "inputField", "getInputField" );
getterMap.put( "outputField", "getOutputField" );
getterMap.put( "fallBackValue", "getFallBackValue" );
getterMap.put( "rules", "getRules" );
Map<String, String> setterMap = new HashMap<String, String>();
setterMap.put( "inputField", "setInputField" );
setterMap.put( "outputField", "setOutputField" );
setterMap.put( "fallBackValue", "setFallBackValue" );
setterMap.put( "rules", "setRules" );
Map<String, FieldLoadSaveValidator<?>> fieldLoadSaveValidatorAttributeMap =
new HashMap<String, FieldLoadSaveValidator<?>>();
fieldLoadSaveValidatorAttributeMap.put( "rules",
new ListLoadSaveValidator<NumberRangeRule>( new NumberRangeRuleFieldLoadSaveValidator(), 25 ) );
LoadSaveTester loadSaveTester = new LoadSaveTester(
NumberRangeMeta.class, attributes, getterMap, setterMap,
fieldLoadSaveValidatorAttributeMap, new HashMap<String, FieldLoadSaveValidator<?>>() );
loadSaveTester.testSerialization();
}
示例5: setUpLoadSave
import org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator; //导入依赖的package包/类
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init( true );
List<String> attributes =
Arrays.asList( "validatingAll", "concatenatingErrors", "concatenationSeparator", "validations" );
Map<String, String> getterMap = new HashMap<String, String>() {
{
put( "validatingAll", "isValidatingAll" );
put( "concatenatingErrors", "isConcatenatingErrors" );
put( "concatenationSeparator", "getConcatenationSeparator" );
put( "validations", "getValidations" );
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put( "validatingAll", "setValidatingAll" );
put( "concatenatingErrors", "setConcatenatingErrors" );
put( "concatenationSeparator", "setConcatenationSeparator" );
put( "validations", "setValidations" );
}
};
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put( "validations", new ListLoadSaveValidator<Validation>( new ValidationLoadSaveValidator(), 5 ) );
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester =
new LoadSaveTester( testMetaClass, attributes, new ArrayList<String>(), new ArrayList<String>(),
getterMap, setterMap, attrValidatorMap, typeValidatorMap, this );
}
示例6: setUpLoadSave
import org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator; //导入依赖的package包/类
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init( true );
List<String> attributes =
Arrays.asList( "transName", "fileName", "directoryPath", "sourceStepName", "targetFile",
"noExecution", "streamSourceStepname", "streamTargetStepname", "transObjectId",
"specificationMethod", "sourceOutputFields" );
Map<String, String> getterMap = new HashMap<String, String>();
Map<String, String> setterMap = new HashMap<String, String>();
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put( "transObjectId", new ObjectIdLoadSaveValidator() );
attrValidatorMap.put( "specificationMethod", new ObjectLocationSpecificationMethodLoadSaveValidator() );
attrValidatorMap.put( "sourceOutputFields",
new ListLoadSaveValidator<MetaInjectOutputField>( new MetaInjectOutputFieldLoadSaveValidator(), 5 ) );
//
// Note - these seem to be runtime-built and not persisted.
// attrValidatorMap.put( "metaInjectMapping",
// new ListLoadSaveValidator<MetaInjectMapping>( new MetaInjectMappingLoadSaveValidator(), 5 ) );
// attrValidatorMap.put( "targetSourceMapping",
// new MapLoadSaveValidator<TargetStepAttribute, SourceStepField>(
// new TargetStepAttributeLoadSaveValidator(),
// new SourceStepFieldLoadSaveValidator(),
// 5 ) );
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester =
new LoadSaveTester( testMetaClass, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap );
}
示例7: testRoundTrips
import org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator; //导入依赖的package包/类
@Test public void testRoundTrips() throws KettleException, NoSuchMethodException, SecurityException {
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put( "hostname", "getHostnames" );
getterMap.put( "auth_user", "getAuthenticationUser" );
getterMap.put( "auth_password", "getAuthenticationPassword" );
getterMap.put( "auth_kerberos", "getUseKerberosAuthentication" );
getterMap.put( "use_all_replica_members", "getUseAllReplicaSetMembers" );
getterMap.put( "execute_for_each_row", "getExecuteForEachIncomingRow" );
getterMap.put( "mongo_fields", "getMongoFields" );
getterMap.put( "tag_sets", "getReadPrefTagSets" );
Map<String, String> setterMap = new HashMap<String, String>();
setterMap.put( "hostname", "setHostnames" );
setterMap.put( "auth_user", "setAuthenticationUser" );
setterMap.put( "auth_password", "setAuthenticationPassword" );
setterMap.put( "auth_kerberos", "setUseKerberosAuthentication" );
setterMap.put( "use_all_replica_members", "setUseAllReplicaSetMembers" );
setterMap.put( "execute_for_each_row", "setExecuteForEachIncomingRow" );
setterMap.put( "mongo_fields", "setMongoFields" );
setterMap.put( "tag_sets", "setReadPrefTagSets" );
Map<String, FieldLoadSaveValidator<?>>
fieldLoadSaveValidatorAttributeMap =
new HashMap<String, FieldLoadSaveValidator<?>>();
fieldLoadSaveValidatorAttributeMap.put( "tag_sets", new ListLoadSaveValidator<String>(
new FieldLoadSaveValidator<String>() {
@Override
public String getTestObject() {
return "{" + UUID.randomUUID().toString() + "}";
}
@Override
public boolean validateTestObject( String testObject, Object actual ) {
return testObject.equals( actual );
}
} ) );
Map<String, FieldLoadSaveValidator<?>>
fieldLoadSaveValidatorTypeMap =
new HashMap<String, FieldLoadSaveValidator<?>>();
LoadSaveTester
tester =
new LoadSaveTester( MongoDbInputMeta.class, Arrays.<String>asList( "hostname", "port", "db_name",
"fields_name", "collection", "json_field_name", "json_query", "auth_user", "auth_password",
"auth_kerberos", "connect_timeout", "socket_timeout", "read_preference", "output_json",
"use_all_replica_members", "query_is_pipeline", "execute_for_each_row", "mongo_fields", "tag_sets" ),
getterMap, setterMap, fieldLoadSaveValidatorAttributeMap, fieldLoadSaveValidatorTypeMap );
FieldLoadSaveValidatorFactory validatorFactory = tester.getFieldLoadSaveValidatorFactory();
validatorFactory.registerValidator( validatorFactory.getName( List.class, MongoField.class ),
new ListLoadSaveValidator<MongoField>( new ObjectValidator<MongoField>( validatorFactory, MongoField.class,
Arrays.<String>asList( "m_fieldName", "m_fieldPath", "m_kettleType", "m_indexedVals" ) ) ) );
tester.testXmlRoundTrip();
tester.testRepoRoundTrip();
}
示例8: testRoundTrips
import org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator; //导入依赖的package包/类
@Test public void testRoundTrips() throws KettleException {
List<String> commonFields =
Arrays.asList( "mongo_host", "mongo_port", "use_all_replica_members", "mongo_user", "mongo_password",
"auth_kerberos", "mongo_db", "mongo_collection", "batch_insert_size", "connect_timeout", "socket_timeout",
"read_preference", "write_concern", "w_timeout", "journaled_writes", "truncate", "update", "upsert",
"multi", "modifier_update", "write_retries", "write_retry_delay", "mongo_fields", "mongo_indexes" );
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put( "mongo_host", "getHostnames" );
getterMap.put( "mongo_port", "getPort" );
getterMap.put( "use_all_replica_members", "getUseAllReplicaSetMembers" );
getterMap.put( "mongo_user", "getAuthenticationUser" );
getterMap.put( "mongo_password", "getAuthenticationPassword" );
getterMap.put( "auth_kerberos", "getUseKerberosAuthentication" );
getterMap.put( "mongo_db", "getDbName" );
getterMap.put( "mongo_collection", "getCollection" );
getterMap.put( "journaled_writes", "getJournal" );
Map<String, String> setterMap = new HashMap<String, String>();
setterMap.put( "mongo_host", "setHostnames" );
setterMap.put( "mongo_port", "setPort" );
setterMap.put( "use_all_replica_members", "setUseAllReplicaSetMembers" );
setterMap.put( "mongo_user", "setAuthenticationUser" );
setterMap.put( "mongo_password", "setAuthenticationPassword" );
setterMap.put( "auth_kerberos", "setUseKerberosAuthentication" );
setterMap.put( "mongo_db", "setDbName" );
setterMap.put( "mongo_collection", "setCollection" );
setterMap.put( "batch_insert_size", "setBatchInsertSize" );
setterMap.put( "journaled_writes", "setJournal" );
LoadSaveTester tester = new LoadSaveTester( MongoDbOutputMeta.class, commonFields, getterMap, setterMap );
FieldLoadSaveValidatorFactory validatorFactory = tester.getFieldLoadSaveValidatorFactory();
validatorFactory.registerValidator( validatorFactory.getName( List.class, MongoField.class ),
new ListLoadSaveValidator<MongoField>( new ObjectValidator<MongoField>( validatorFactory, MongoField.class,
Arrays.<String>asList( "m_incomingFieldName", "m_mongoDocPath", "m_useIncomingFieldNameAsMongoFieldName",
"m_updateMatchField", "m_modifierUpdateOperation", "m_modifierOperationApplyPolicy", "m_JSON",
"insertNull" ) ) ) );
validatorFactory.registerValidator( validatorFactory.getName( List.class, MongoIndex.class ),
new ListLoadSaveValidator<MongoIndex>( new ObjectValidator<MongoIndex>( validatorFactory, MongoIndex.class,
Arrays.<String>asList( "m_pathToFields", "m_drop", "m_unique", "m_sparse" ) ) ) );
tester.testXmlRoundTrip();
tester.testRepoRoundTrip();
}
示例9: SwitchCaseMetaTest
import org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator; //导入依赖的package包/类
public SwitchCaseMetaTest() {
//SwitchCaseMeta bean-like attributes
List<String> attributes = Arrays.asList(
"fieldname",
"isContains",
"caseValueFormat", "caseValueDecimal", /* "caseValueType",*/"caseValueGroup",
"defaultTargetStepname",
"caseTargets" );
//Non-standard getters & setters
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put( "isContains", "isContains" );
Map<String, String> setterMap = new HashMap<String, String>();
setterMap.put( "isContains", "setContains" );
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap =
new HashMap<String, FieldLoadSaveValidator<?>>();
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap =
new HashMap<String, FieldLoadSaveValidator<?>>();
this.loadSaveTester = new LoadSaveTester<>( SwitchCaseMeta.class,
attributes,
getterMap, setterMap,
attrValidatorMap, typeValidatorMap );
FieldLoadSaveValidatorFactory validatorFactory = loadSaveTester.getFieldLoadSaveValidatorFactory();
FieldLoadSaveValidator<SwitchCaseTarget> targetValidator = new FieldLoadSaveValidator<SwitchCaseTarget>() {
private final StepMetaInterface targetStepInterface = new DummyTransMeta();
@Override
public SwitchCaseTarget getTestObject() {
return new SwitchCaseTarget() {
{
caseValue = UUID.randomUUID().toString();
caseTargetStepname = UUID.randomUUID().toString();
caseTargetStep = new StepMeta( caseTargetStepname, targetStepInterface );
}
};
}
@Override
public boolean validateTestObject( SwitchCaseTarget testObject, Object actual ) {
return testObject.caseValue.equals( ( (SwitchCaseTarget) actual ).caseValue )
&& testObject.caseTargetStepname.equals( ( (SwitchCaseTarget) actual ).caseTargetStepname );
}
};
validatorFactory.registerValidator( validatorFactory.getName( SwitchCaseTarget.class ), targetValidator );
validatorFactory.registerValidator( validatorFactory.getName( List.class, SwitchCaseTarget.class ),
new ListLoadSaveValidator<SwitchCaseTarget>( targetValidator ) );
}
示例10: testRoundTrip
import org.pentaho.di.trans.steps.loadsave.validator.ListLoadSaveValidator; //导入依赖的package包/类
@Test
public void testRoundTrip() throws KettleException {
List<String> attributes =
Arrays.asList( "index", "type", "batchSize", "timeout", "timeoutUnit", "isJson", "jsonField", "idOutputField",
"idField", "overwriteIfExists", "useOutput", "stopOnError", "fields", "servers", "settings" );
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put( "index", "getIndex" );
getterMap.put( "type", "getType" );
getterMap.put( "batchSize", "getBatchSize" );
getterMap.put( "timeout", "getTimeOut" );
getterMap.put( "timeoutUnit", "getTimeoutUnit" );
getterMap.put( "isJson", "isJsonInsert" );
getterMap.put( "jsonField", "getJsonField" );
getterMap.put( "idOutputField", "getIdOutField" );
getterMap.put( "idField", "getIdInField" );
getterMap.put( "overwriteIfExists", "isOverWriteIfSameId" );
getterMap.put( "useOutput", "isUseOutput" );
getterMap.put( "stopOnError", "isStopOnError" );
getterMap.put( "fields", "getFieldsMap" );
getterMap.put( "servers", "getServers" );
getterMap.put( "settings", "getSettingsMap" );
Map<String, String> setterMap = new HashMap<String, String>();
setterMap.put( "index", "setIndex" );
setterMap.put( "type", "setType" );
setterMap.put( "batchSize", "setBatchSize" );
setterMap.put( "timeout", "setTimeOut" );
setterMap.put( "timeoutUnit", "setTimeoutUnit" );
setterMap.put( "isJson", "setJsonInsert" );
setterMap.put( "jsonField", "setJsonField" );
setterMap.put( "idOutputField", "setIdOutField" );
setterMap.put( "idField", "setIdInField" );
setterMap.put( "overwriteIfExists", "setOverWriteIfSameId" );
setterMap.put( "useOutput", "setUseOutput" );
setterMap.put( "stopOnError", "setStopOnError" );
setterMap.put( "fields", "setFieldsMap" );
setterMap.put( "servers", "setServers" );
setterMap.put( "settings", "setSettingsMap" );
Map<String, FieldLoadSaveValidator<?>> fieldLoadSaveValidatorAttributeMap =
new HashMap<String, FieldLoadSaveValidator<?>>();
Map<String, FieldLoadSaveValidator<?>> fieldLoadSaveValidatorTypeMap =
new HashMap<String, FieldLoadSaveValidator<?>>();
fieldLoadSaveValidatorAttributeMap.put( "fields", new MapLoadSaveValidator<String, String>(
new StringLoadSaveValidator(), new StringLoadSaveValidator() ) );
fieldLoadSaveValidatorAttributeMap.put( "settings", new MapLoadSaveValidator<String, String>(
new StringLoadSaveValidator(), new StringLoadSaveValidator() ) );
fieldLoadSaveValidatorAttributeMap.put( "servers", new ListLoadSaveValidator<ElasticSearchBulkMeta.Server>(
new FieldLoadSaveValidator<ElasticSearchBulkMeta.Server>() {
Random rand = new Random();
@Override
public ElasticSearchBulkMeta.Server getTestObject() {
ElasticSearchBulkMeta.Server r = new ElasticSearchBulkMeta.Server();
r.address = rand.nextLong() + "";
r.port = rand.nextInt();
return r;
}
@Override
public boolean validateTestObject( ElasticSearchBulkMeta.Server testObject, Object actual ) {
ElasticSearchBulkMeta.Server ac = (ElasticSearchBulkMeta.Server) actual;
return ac.address.equals( testObject.address ) && ac.port == testObject.port;
}
} ) );
fieldLoadSaveValidatorTypeMap.put( TimeUnit.class.getCanonicalName(), new TimeUnitFieldLoadSaveValidator() );
LoadSaveTester loadSaveTester =
new LoadSaveTester( ElasticSearchBulkMeta.class, attributes, getterMap, setterMap,
fieldLoadSaveValidatorAttributeMap, fieldLoadSaveValidatorTypeMap );
loadSaveTester.testRepoRoundTrip();
loadSaveTester.testXmlRoundTrip();
}