Search in sources :

Example 46 with IntLoadSaveValidator

use of org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator in project pentaho-kettle by pentaho.

the class JobEntryCheckDbConnectionsLoadSaveTest method createAttributeValidatorsMap.

@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
    Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
    int entries = new Random().nextInt(10) + 1;
    validators.put("connections", new ArrayLoadSaveValidator<DatabaseMeta>(new DatabaseMetaLoadSaveValidator(), entries));
    validators.put("waitfors", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), entries));
    validators.put("waittimes", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(JobEntryCheckDbConnections.unitTimeCode.length), entries));
    return validators;
}
Also used : IntLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator) HashMap(java.util.HashMap) FieldLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator) DatabaseMetaLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.DatabaseMetaLoadSaveValidator) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) Random(java.util.Random) PrimitiveIntArrayLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.PrimitiveIntArrayLoadSaveValidator) StringLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator)

Aggregations

IntLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator)46 HashMap (java.util.HashMap)45 FieldLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator)45 LoadSaveTester (org.pentaho.di.trans.steps.loadsave.LoadSaveTester)32 StringLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator)31 PrimitiveIntArrayLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.PrimitiveIntArrayLoadSaveValidator)27 Before (org.junit.Before)22 ArrayLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.ArrayLoadSaveValidator)20 ArrayList (java.util.ArrayList)18 Test (org.junit.Test)12 BooleanLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.BooleanLoadSaveValidator)7 PrimitiveBooleanArrayLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.PrimitiveBooleanArrayLoadSaveValidator)6 Random (java.util.Random)5 DatabaseMetaLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.DatabaseMetaLoadSaveValidator)3 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)2 EnumMap (java.util.EnumMap)1 Matchers.anyString (org.mockito.Matchers.anyString)1 Mockito.anyString (org.mockito.Mockito.anyString)1 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)1 StepInjectionMetaEntry (org.pentaho.di.trans.step.StepInjectionMetaEntry)1