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;
}
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);
}
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);
}
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);
}
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);
}
Aggregations