Search in sources :

Example 76 with IMetaverseNode

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

the class HTTPClientStepAnalyzer method createResourceNode.

@Override
public IMetaverseNode createResourceNode(IExternalResourceInfo resource) throws MetaverseException {
    MetaverseComponentDescriptor componentDescriptor = new MetaverseComponentDescriptor(resource.getName(), getResourceInputNodeType(), descriptor.getNamespace(), descriptor.getContext());
    IMetaverseNode node = createNodeFromDescriptor(componentDescriptor);
    return node;
}
Also used : IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor)

Example 77 with IMetaverseNode

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

the class JobAnalyzerTest method testAnalyzerJobWithParamException.

@Test(expected = MetaverseAnalyzerException.class)
public void testAnalyzerJobWithParamException() throws Exception {
    when(mockContent.getParameterDefault(anyString())).thenThrow(UnknownParamException.class);
    // increases line code coverage by adding step to transformation
    IMetaverseNode node = analyzer.analyze(descriptor, mockJobDoc);
    assertNotNull(node);
}
Also used : IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) Test(org.junit.Test)

Example 78 with IMetaverseNode

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

the class JobAnalyzerTest method testAnalyzerWithEntriesSpecificAnalyzer.

@Test
public void testAnalyzerWithEntriesSpecificAnalyzer() throws MetaverseAnalyzerException {
    analyzer.setJobEntryAnalyzerProvider(jobEntryAnalyzerProvider);
    final Set<IJobEntryAnalyzer> jobEntryAnalyzers = null;
    when(jobEntryAnalyzerProvider.getAnalyzers(any(Collection.class))).thenReturn(new ArrayList<IJobEntryAnalyzer>() {

        {
            add(mock(IJobEntryAnalyzer.class));
        }
    });
    IMetaverseNode node = analyzer.analyze(descriptor, mockJobDoc);
    assertNotNull(node);
}
Also used : IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) IJobEntryAnalyzer(org.pentaho.metaverse.api.analyzer.kettle.jobentry.IJobEntryAnalyzer) Collection(java.util.Collection) Test(org.junit.Test)

Example 79 with IMetaverseNode

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

the class JobAnalyzerTest method testAnalyzerJobWithFullMetadata.

@Test
public void testAnalyzerJobWithFullMetadata() throws MetaverseAnalyzerException {
    when(mockContent.getDescription()).thenReturn("I am a description");
    when(mockContent.getExtendedDescription()).thenReturn("I am an extended description");
    when(mockContent.getJobversion()).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.getJobstatus()).thenReturn(1);
    IMetaverseNode node = analyzer.analyze(descriptor, mockJobDoc);
    assertNotNull(node);
}
Also used : IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) Date(java.util.Date) Test(org.junit.Test)

Example 80 with IMetaverseNode

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

the class JobAnalyzerTest method testAnalyzerWithEntriesGenericAnalyzer.

@Test
public void testAnalyzerWithEntriesGenericAnalyzer() throws MetaverseAnalyzerException {
    analyzer.setJobEntryAnalyzerProvider(jobEntryAnalyzerProvider);
    final List<IJobEntryAnalyzer> jobEntryAnalyzers = null;
    when(jobEntryAnalyzerProvider.getAnalyzers(any(Collection.class))).thenReturn(jobEntryAnalyzers);
    IMetaverseNode node = analyzer.analyze(descriptor, mockJobDoc);
    assertNotNull(node);
}
Also used : IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) IJobEntryAnalyzer(org.pentaho.metaverse.api.analyzer.kettle.jobentry.IJobEntryAnalyzer) Collection(java.util.Collection) 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