Search in sources :

Example 21 with IMetaverseNode

use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.

the class JobAnalyzerTest method testAnalyzerJobWithEntries.

@Test
public void testAnalyzerJobWithEntries() throws MetaverseAnalyzerException {
    // increases line code coverage by adding entries to the job
    IMetaverseNode node = analyzer.analyze(descriptor, mockJobDoc);
    assertNotNull(node);
}
Also used : IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) Test(org.junit.Test)

Example 22 with IMetaverseNode

use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.

the class JobAnalyzerTest method testAnalyzerJobWithEntriesAndHop.

@Test
public void testAnalyzerJobWithEntriesAndHop() throws MetaverseAnalyzerException {
    JobEntryCopy mockToEntryMeta = mock(JobEntryCopy.class);
    when(mockToEntryMeta.getEntry()).thenReturn(mockJobEntryInterface);
    when(mockToEntryMeta.getParentJobMeta()).thenReturn(mockContent);
    when(mockContent.nrJobEntries()).thenReturn(2);
    when(mockContent.getJobEntry(0)).thenReturn(mockJobEntry);
    when(mockContent.getJobEntry(1)).thenReturn(mockToEntryMeta);
    when(mockContent.nrJobHops()).thenReturn(1);
    final JobHopMeta hop = new JobHopMeta(mockJobEntry, mockToEntryMeta);
    when(mockContent.getJobHop(0)).thenReturn(hop);
    IMetaverseNode node = analyzer.analyze(descriptor, mockJobDoc);
    assertNotNull(node);
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) JobHopMeta(org.pentaho.di.job.JobHopMeta) IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) Test(org.junit.Test)

Example 23 with IMetaverseNode

use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.

the class TransformationAnalyzerTest method testAnalyzerTransformWithFullMetadata.

@Test
public void testAnalyzerTransformWithFullMetadata() throws MetaverseAnalyzerException {
    when(mockContent.getDescription()).thenReturn("I am a description");
    when(mockContent.getExtendedDescription()).thenReturn("I am an extended description");
    when(mockContent.getTransversion()).thenReturn("1.0");
    Date now = Calendar.getInstance().getTime();
    when(mockContent.getCreatedDate()).thenReturn(now);
    when(mockContent.getCreatedUser()).thenReturn("joe");
    when(mockContent.getModifiedDate()).thenReturn(now);
    when(mockContent.getModifiedUser()).thenReturn("suzy");
    // Production
    when(mockContent.getTransstatus()).thenReturn(1);
    IMetaverseNode node = analyzer.analyze(descriptor, mockTransDoc);
    assertNotNull(node);
}
Also used : IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) Date(java.util.Date) Test(org.junit.Test)

Example 24 with IMetaverseNode

use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.

the class TransformationAnalyzerTest method testAnalyzerTransformWithStep.

@Test
public void testAnalyzerTransformWithStep() throws MetaverseAnalyzerException {
    // increases line code coverage by adding step to transformation
    IMetaverseNode node = analyzer.analyze(descriptor, mockTransDoc);
    assertNotNull(node);
}
Also used : IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) Test(org.junit.Test)

Example 25 with IMetaverseNode

use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.

the class CsvFileInputStepAnalyzerTest method testCreateResourceNode.

@Test
public void testCreateResourceNode() throws Exception {
    IExternalResourceInfo res = mock(IExternalResourceInfo.class);
    when(res.getName()).thenReturn("file:///Users/home/tmp/xyz.ktr");
    IMetaverseNode resourceNode = analyzer.createResourceNode(res);
    assertNotNull(resourceNode);
    assertEquals(DictionaryConst.NODE_TYPE_FILE, resourceNode.getType());
}
Also used : IExternalResourceInfo(org.pentaho.metaverse.api.model.IExternalResourceInfo) IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) Test(org.junit.Test)

Aggregations

IMetaverseNode (org.pentaho.metaverse.api.IMetaverseNode)131 Test (org.junit.Test)77 IComponentDescriptor (org.pentaho.metaverse.api.IComponentDescriptor)30 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)23 MetaverseComponentDescriptor (org.pentaho.metaverse.api.MetaverseComponentDescriptor)16 ValueMeta (org.pentaho.di.core.row.ValueMeta)13 IExternalResourceInfo (org.pentaho.metaverse.api.model.IExternalResourceInfo)12 IAnalysisContext (org.pentaho.metaverse.api.IAnalysisContext)11 MetaverseAnalyzerException (org.pentaho.metaverse.api.MetaverseAnalyzerException)11 Vertex (com.tinkerpop.blueprints.Vertex)10 ArrayList (java.util.ArrayList)10 INamespace (org.pentaho.metaverse.api.INamespace)10 TransMeta (org.pentaho.di.trans.TransMeta)9 BaseStepMeta (org.pentaho.di.trans.step.BaseStepMeta)9 MetaverseTransientNode (org.pentaho.dictionary.MetaverseTransientNode)9 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)8 Namespace (org.pentaho.metaverse.api.Namespace)8 StepField (org.pentaho.metaverse.api.StepField)8 HashMap (java.util.HashMap)7 Matchers.anyString (org.mockito.Matchers.anyString)7