Search in sources :

Example 16 with DataServiceMeta

use of org.pentaho.di.trans.dataservice.DataServiceMeta in project pdi-dataservice-server-plugin by pentaho.

the class ParameterPushdownTest method setUp.

@Before
public void setUp() throws Exception {
    optimizationMeta = new PushDownOptimizationMeta();
    optimizationMeta.setType(parameterPushdown);
    optimizationMeta.setStepName("OUTPUT");
    dataService = new DataServiceMeta(transMeta);
    dataService.setStepname("OUTPUT");
    dataService.getPushDownOptimizationMeta().add(optimizationMeta);
    parameterPushdown.createDefinition().setFieldName("ARTIST").setParameter("ARTIST_FIELD").setFormat("artist: \"%s\",");
    parameterPushdown.createDefinition().setFieldName("ALBUM").setParameter("ALBUM_FIELD").setFormat("album: \"%s\",");
    parameterPushdown.createDefinition().setFieldName("LIVE").setParameter("LIVE_FIELD");
    when(executor.getServiceTransMeta()).thenReturn(transMeta);
    when(executor.getParameters()).thenReturn(parameters = Maps.newHashMap());
    rowMeta = new RowMeta();
    rowMeta.addValueMeta(new ValueMetaString("ARTIST"));
    rowMeta.addValueMeta(new ValueMetaString("ALBUM"));
    rowMeta.addValueMeta(new ValueMetaBoolean("LIVE"));
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) DataServiceMeta(org.pentaho.di.trans.dataservice.DataServiceMeta) RowMeta(org.pentaho.di.core.row.RowMeta) PushDownOptimizationMeta(org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) Before(org.junit.Before)

Example 17 with DataServiceMeta

use of org.pentaho.di.trans.dataservice.DataServiceMeta in project pdi-dataservice-server-plugin by pentaho.

the class DataServiceResolverDelegateTest method testGetDataServiceWithNameRetNull.

@Test
public void testGetDataServiceWithNameRetNull() {
    when(resolver.getDataService(DATA_SERVICE_NAME)).thenReturn(null);
    DataServiceMeta returnDataServiceMeta = dataServiceResolverDelegate.getDataService(DATA_SERVICE_NAME);
    assertNull(returnDataServiceMeta);
    verify(resolver).getDataService(DATA_SERVICE_NAME);
}
Also used : DataServiceMeta(org.pentaho.di.trans.dataservice.DataServiceMeta) Test(org.junit.Test)

Example 18 with DataServiceMeta

use of org.pentaho.di.trans.dataservice.DataServiceMeta in project pdi-dataservice-server-plugin by pentaho.

the class DataServiceResolverDelegateTest method testGetDataServiceNoResolvers.

@Test
public void testGetDataServiceNoResolvers() {
    DataServiceResolverDelegate nullDataServiceResolverDelegate = new DataServiceResolverDelegate(new ArrayList<DataServiceResolver>());
    DataServiceMeta returnDataServiceMeta = nullDataServiceResolverDelegate.getDataService(DATA_SERVICE_NAME);
    assertNull(returnDataServiceMeta);
}
Also used : DataServiceMeta(org.pentaho.di.trans.dataservice.DataServiceMeta) Test(org.junit.Test)

Example 19 with DataServiceMeta

use of org.pentaho.di.trans.dataservice.DataServiceMeta in project pdi-dataservice-server-plugin by pentaho.

the class TransientResolverTest method testBuildStreamingLocalTransient.

@Test
public void testBuildStreamingLocalTransient() throws Exception {
    String transientId = TransientResolver.buildTransient("/path/to/file.ktr", "streaming:local:OUTPUT");
    String[] parts = transientResolver.splitTransient(transientId);
    assertEquals(parts.length, 2);
    DataServiceMeta dataServiceMeta = transientResolver.getDataService(transientId);
    assertEquals(dataServiceMeta.getStepname(), "OUTPUT");
}
Also used : DataServiceMeta(org.pentaho.di.trans.dataservice.DataServiceMeta) Test(org.junit.Test)

Example 20 with DataServiceMeta

use of org.pentaho.di.trans.dataservice.DataServiceMeta in project pdi-dataservice-server-plugin by pentaho.

the class TransientResolverTest method testBuildLocalStreamingTransient.

@Test
public void testBuildLocalStreamingTransient() throws Exception {
    String transientId = TransientResolver.buildTransient("/path/to/file.ktr", "local:streaming:OUTPUT");
    String[] parts = transientResolver.splitTransient(transientId);
    assertEquals(parts.length, 2);
    DataServiceMeta dataServiceMeta = transientResolver.getDataService(transientId);
    assertEquals(dataServiceMeta.getStepname(), "OUTPUT");
}
Also used : DataServiceMeta(org.pentaho.di.trans.dataservice.DataServiceMeta) Test(org.junit.Test)

Aggregations

DataServiceMeta (org.pentaho.di.trans.dataservice.DataServiceMeta)52 Test (org.junit.Test)29 TransMeta (org.pentaho.di.trans.TransMeta)16 PushDownOptimizationMeta (org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta)9 KettleException (org.pentaho.di.core.exception.KettleException)8 DataServiceContext (org.pentaho.di.trans.dataservice.DataServiceContext)6 DataServiceDelegate (org.pentaho.di.trans.dataservice.ui.DataServiceDelegate)6 StepMeta (org.pentaho.di.trans.step.StepMeta)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 Before (org.junit.Before)4 RowMeta (org.pentaho.di.core.row.RowMeta)4 DataServiceResolver (org.pentaho.di.trans.dataservice.resolvers.DataServiceResolver)4 DummyTransMeta (org.pentaho.di.trans.steps.dummytrans.DummyTransMeta)4 MetaStoreException (org.pentaho.metastore.api.exceptions.MetaStoreException)4 MetastoreLocator (org.pentaho.osgi.metastore.locator.api.MetastoreLocator)4 ModelAnnotationGroup (org.pentaho.agilebi.modeler.models.annotations.ModelAnnotationGroup)3 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)3 File (java.io.File)2 IOException (java.io.IOException)2 URL (java.net.URL)2