use of org.pentaho.di.trans.steps.named.cluster.NamedClusterEmbedManager in project pentaho-kettle by pentaho.
the class AbstractMetaTest method testGetNamedClusterEmbedManager.
@Test
public void testGetNamedClusterEmbedManager() throws Exception {
assertNull(meta.getNamedClusterEmbedManager());
NamedClusterEmbedManager mockNamedClusterEmbedManager = mock(NamedClusterEmbedManager.class);
meta.namedClusterEmbedManager = mockNamedClusterEmbedManager;
assertEquals(mockNamedClusterEmbedManager, meta.getNamedClusterEmbedManager());
}
use of org.pentaho.di.trans.steps.named.cluster.NamedClusterEmbedManager in project pentaho-kettle by pentaho.
the class LoadSaveBase method createMeta.
public T createMeta() {
try {
T meta = clazz.newInstance();
if (meta instanceof BaseStepMeta) {
StepMeta mockParentStepMeta = mock(StepMeta.class);
((BaseStepMeta) meta).setParentStepMeta(mockParentStepMeta);
TransMeta mockTransMeta = mock(TransMeta.class);
NamedClusterEmbedManager embedManager = mock(NamedClusterEmbedManager.class);
when(mockParentStepMeta.getParentTransMeta()).thenReturn(mockTransMeta);
when(mockTransMeta.getNamedClusterEmbedManager()).thenReturn(embedManager);
}
return meta;
} catch (Exception e) {
throw new RuntimeException("Unable to create meta of class " + clazz.getCanonicalName(), e);
}
}
use of org.pentaho.di.trans.steps.named.cluster.NamedClusterEmbedManager in project pentaho-kettle by pentaho.
the class TextFileInputMetaTest method setUp.
@Before
public void setUp() throws Exception {
NamedClusterEmbedManager manager = mock(NamedClusterEmbedManager.class);
TransMeta parentTransMeta = mock(TransMeta.class);
doReturn(manager).when(parentTransMeta).getNamedClusterEmbedManager();
StepMeta parentStepMeta = mock(StepMeta.class);
doReturn(parentTransMeta).when(parentStepMeta).getParentTransMeta();
inputMeta = new TextFileInputMeta();
inputMeta.setParentStepMeta(parentStepMeta);
inputMeta = spy(inputMeta);
variableSpace = mock(VariableSpace.class);
doReturn("<def>").when(variableSpace).environmentSubstitute(anyString());
doReturn(FILE_NAME_VALID_PATH).when(variableSpace).environmentSubstitute(FILE_NAME_VALID_PATH);
FileObject mockedFileObject = mock(FileObject.class);
doReturn(mockedFileObject).when(inputMeta).getFileObject(anyString(), eq(variableSpace));
}
use of org.pentaho.di.trans.steps.named.cluster.NamedClusterEmbedManager in project pentaho-kettle by pentaho.
the class ZipFileMetaTest method testLoadAndGetXml.
@Test
public void testLoadAndGetXml() throws Exception {
ZipFileMeta zipFileMeta = new ZipFileMeta();
Node stepnode = getTestNode();
DatabaseMeta dbMeta = mock(DatabaseMeta.class);
IMetaStore metaStore = mock(IMetaStore.class);
StepMeta mockParentStepMeta = mock(StepMeta.class);
zipFileMeta.setParentStepMeta(mockParentStepMeta);
TransMeta mockTransMeta = mock(TransMeta.class);
NamedClusterEmbedManager embedManager = mock(NamedClusterEmbedManager.class);
when(mockParentStepMeta.getParentTransMeta()).thenReturn(mockTransMeta);
when(mockTransMeta.getNamedClusterEmbedManager()).thenReturn(embedManager);
zipFileMeta.loadXML(stepnode, Collections.singletonList(dbMeta), metaStore);
assertXmlOutputMeta(zipFileMeta);
}
Aggregations