Search in sources :

Example 1 with SharedObjectInterface

use of org.pentaho.di.shared.SharedObjectInterface in project pentaho-kettle by pentaho.

the class SpoonSharedObjectDelegateTest method mockObject.

private SharedObjectInterface mockObject(String name) {
    SharedObjectInterface obj = mock(SharedObjectInterface.class);
    when(obj.getName()).thenReturn(name);
    return obj;
}
Also used : SharedObjectInterface(org.pentaho.di.shared.SharedObjectInterface)

Example 2 with SharedObjectInterface

use of org.pentaho.di.shared.SharedObjectInterface in project pentaho-kettle by pentaho.

the class DialogUtilsTest method objectWithTheSameNameExists_false_if_not_exist.

@Test
public void objectWithTheSameNameExists_false_if_not_exist() {
    SharedObjectInterface sharedObject = mock(SharedObjectInterface.class);
    when(sharedObject.getName()).thenReturn("NEW_TEST_OBJECT");
    assertFalse(objectWithTheSameNameExists(sharedObject, createTestScope("TEST_OBJECT")));
}
Also used : SharedObjectInterface(org.pentaho.di.shared.SharedObjectInterface) Test(org.junit.Test)

Example 3 with SharedObjectInterface

use of org.pentaho.di.shared.SharedObjectInterface in project pentaho-kettle by pentaho.

the class DialogUtilsTest method objectWithTheSameNameExists_false_if_same_object.

@Test
public void objectWithTheSameNameExists_false_if_same_object() {
    SharedObjectInterface sharedObject = mock(SharedObjectInterface.class);
    when(sharedObject.getName()).thenReturn("TEST_OBJECT");
    assertFalse(objectWithTheSameNameExists(sharedObject, Collections.singleton(sharedObject)));
}
Also used : SharedObjectInterface(org.pentaho.di.shared.SharedObjectInterface) Test(org.junit.Test)

Example 4 with SharedObjectInterface

use of org.pentaho.di.shared.SharedObjectInterface in project pentaho-kettle by pentaho.

the class DialogUtilsTest method objectWithTheSameNameExists_true_if_exists.

@Test
public void objectWithTheSameNameExists_true_if_exists() {
    SharedObjectInterface sharedObject = mock(SharedObjectInterface.class);
    when(sharedObject.getName()).thenReturn("TEST_OBJECT");
    assertTrue(objectWithTheSameNameExists(sharedObject, createTestScope("TEST_OBJECT")));
}
Also used : SharedObjectInterface(org.pentaho.di.shared.SharedObjectInterface) Test(org.junit.Test)

Example 5 with SharedObjectInterface

use of org.pentaho.di.shared.SharedObjectInterface in project pentaho-kettle by pentaho.

the class DialogUtilsTest method createTestScope.

private static Collection<SharedObjectInterface> createTestScope(String objectName) {
    SharedObjectInterface sharedObject = mock(SharedObjectInterface.class);
    when(sharedObject.getName()).thenReturn(objectName);
    return Collections.singleton(sharedObject);
}
Also used : SharedObjectInterface(org.pentaho.di.shared.SharedObjectInterface)

Aggregations

SharedObjectInterface (org.pentaho.di.shared.SharedObjectInterface)18 List (java.util.List)7 RepositoryObjectType (org.pentaho.di.repository.RepositoryObjectType)7 ArrayList (java.util.ArrayList)6 KettleException (org.pentaho.di.core.exception.KettleException)6 Test (org.junit.Test)5 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)5 SlaveServer (org.pentaho.di.cluster.SlaveServer)4 PartitionSchema (org.pentaho.di.partition.PartitionSchema)4 KettleFileException (org.pentaho.di.core.exception.KettleFileException)3 SharedObjects (org.pentaho.di.shared.SharedObjects)3 MetaStoreException (org.pentaho.metastore.api.exceptions.MetaStoreException)3 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)2 ClusterSchema (org.pentaho.di.cluster.ClusterSchema)2 IdNotFoundException (org.pentaho.di.core.exception.IdNotFoundException)2 KettleSecurityException (org.pentaho.di.core.exception.KettleSecurityException)2 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)2 ObjectId (org.pentaho.di.repository.ObjectId)2 RepositoryElementInterface (org.pentaho.di.repository.RepositoryElementInterface)2 StringObjectId (org.pentaho.di.repository.StringObjectId)2