Search in sources :

Example 1 with NamedClusterEmbedManager

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());
}
Also used : NamedClusterEmbedManager(org.pentaho.di.trans.steps.named.cluster.NamedClusterEmbedManager) Test(org.junit.Test)

Example 2 with NamedClusterEmbedManager

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);
    }
}
Also used : TransMeta(org.pentaho.di.trans.TransMeta) NamedClusterEmbedManager(org.pentaho.di.trans.steps.named.cluster.NamedClusterEmbedManager) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta) StepMeta(org.pentaho.di.trans.step.StepMeta) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta) KettleException(org.pentaho.di.core.exception.KettleException)

Example 3 with NamedClusterEmbedManager

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));
}
Also used : VariableSpace(org.pentaho.di.core.variables.VariableSpace) NamedClusterEmbedManager(org.pentaho.di.trans.steps.named.cluster.NamedClusterEmbedManager) TransMeta(org.pentaho.di.trans.TransMeta) FileObject(org.apache.commons.vfs2.FileObject) StepMeta(org.pentaho.di.trans.step.StepMeta) Before(org.junit.Before)

Example 4 with NamedClusterEmbedManager

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);
}
Also used : Node(org.w3c.dom.Node) TransMeta(org.pentaho.di.trans.TransMeta) NamedClusterEmbedManager(org.pentaho.di.trans.steps.named.cluster.NamedClusterEmbedManager) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) IMetaStore(org.pentaho.metastore.api.IMetaStore) StepMeta(org.pentaho.di.trans.step.StepMeta) Test(org.junit.Test)

Aggregations

NamedClusterEmbedManager (org.pentaho.di.trans.steps.named.cluster.NamedClusterEmbedManager)4 TransMeta (org.pentaho.di.trans.TransMeta)3 StepMeta (org.pentaho.di.trans.step.StepMeta)3 Test (org.junit.Test)2 FileObject (org.apache.commons.vfs2.FileObject)1 Before (org.junit.Before)1 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)1 KettleException (org.pentaho.di.core.exception.KettleException)1 VariableSpace (org.pentaho.di.core.variables.VariableSpace)1 BaseStepMeta (org.pentaho.di.trans.step.BaseStepMeta)1 IMetaStore (org.pentaho.metastore.api.IMetaStore)1 Node (org.w3c.dom.Node)1