use of org.pentaho.metaverse.api.analyzer.kettle.ComponentDerivationRecord in project pentaho-metaverse by pentaho.
the class MergeJoinStepAnalyzerTest method testGetChangeRecords.
@Test
public void testGetChangeRecords() throws Exception {
Set<ComponentDerivationRecord> changeRecords = analyzer.getChangeRecords(mergeJoinMeta);
assertNotNull(changeRecords);
assertEquals(1, changeRecords.size());
ComponentDerivationRecord cr = changeRecords.iterator().next();
assertEquals(ChangeType.METADATA, cr.getChangeType());
assertEquals(1, cr.getOperations().size());
}
use of org.pentaho.metaverse.api.analyzer.kettle.ComponentDerivationRecord in project pentaho-metaverse by pentaho.
the class NumberRangeStepAnalyzerTest method testGetChangeRecords.
@Test
public void testGetChangeRecords() throws Exception {
Set<ComponentDerivationRecord> changeRecords = analyzer.getChangeRecords(meta);
assertEquals(1, changeRecords.size());
ComponentDerivationRecord changeRecord = changeRecords.iterator().next();
assertEquals("inField", changeRecord.getOriginalEntityName());
assertEquals("outField", changeRecord.getChangedEntityName());
Operations operations = changeRecord.getOperations();
// Only data operations
assertEquals(1, operations.size());
List<IOperation> dataOperations = operations.get(ChangeType.DATA);
assertEquals(2, dataOperations.size());
}
use of org.pentaho.metaverse.api.analyzer.kettle.ComponentDerivationRecord in project pentaho-metaverse by pentaho.
the class SelectValuesStepAnalyzerTest method testGetChangeRecords_meta.
@Test
public void testGetChangeRecords_meta() throws Exception {
SelectMetadataChange[] metadataChanges = new SelectMetadataChange[] { testChange1, testChange2 };
when(selectValuesMeta.getMeta()).thenReturn(metadataChanges);
ValueMetaInterface vmiFirst = mock(ValueMetaInterface.class);
ValueMetaInterface vmiLast = mock(ValueMetaInterface.class);
when(rmi.searchValueMeta("first")).thenReturn(vmiFirst);
when(rmi.searchValueMeta("last")).thenReturn(vmiLast);
when(vmiFirst.getName()).thenReturn("first");
when(vmiFirst.getCurrencySymbol()).thenReturn("$");
when(vmiFirst.getStorageType()).thenReturn(ValueMetaInterface.STORAGE_TYPE_NORMAL);
when(vmiLast.getDateFormatLocale()).thenReturn(Locale.US);
when(vmiLast.getGroupingSymbol()).thenReturn(",");
when(vmiLast.getName()).thenReturn("last");
when(vmiLast.getConversionMask()).thenReturn("000.##");
when(vmiLast.getDateFormatTimeZone()).thenReturn(TimeZone.getDefault());
when(vmiLast.getDecimalSymbol()).thenReturn(".");
when(vmiLast.isDateFormatLenient()).thenReturn(false);
Set<ComponentDerivationRecord> changeRecords = analyzer.getChangeRecords(selectValuesMeta);
assertNotNull(changeRecords);
assertEquals(metadataChanges.length, changeRecords.size());
}
use of org.pentaho.metaverse.api.analyzer.kettle.ComponentDerivationRecord in project pentaho-metaverse by pentaho.
the class StreamLookupStepAnalyzerTest method testGetChangeRecords.
@Test
public void testGetChangeRecords() throws Exception {
analyzer.setStepMeta(streamLookupMeta);
Set<ComponentDerivationRecord> changeRecords = analyzer.getChangeRecords(streamLookupMeta);
assertNotNull(changeRecords);
assertEquals(1, changeRecords.size());
ComponentDerivationRecord cr = changeRecords.iterator().next();
assertEquals(ChangeType.METADATA, cr.getChangeType());
assertEquals(1, cr.getOperations().size());
}
use of org.pentaho.metaverse.api.analyzer.kettle.ComponentDerivationRecord in project pentaho-metaverse by pentaho.
the class StringOperationsStepAnalyzerTest method testGetChangeRecords.
@Test
public void testGetChangeRecords() throws Exception {
Set<ComponentDerivationRecord> changeRecords = analyzer.getChangeRecords(stringOperationsMeta);
assertEquals(changeRecords.size(), 3);
List<String> inFields = Arrays.asList(stringOperationsMeta.getFieldInStream());
for (ComponentDerivationRecord change : changeRecords) {
assertTrue(inFields.contains(change.getOriginalEntityName()));
assertEquals(1, change.getOperations(ChangeType.DATA).size());
assertNull(change.getOperations(ChangeType.METADATA));
}
}
Aggregations