@Test public void synchronizePartitionSchemasDeleteFromRepository() throws Exception { try { spoon.rep = repository; when( spoon.getRepository() ).thenReturn( repository ); final String objectId = "object-id"; final String partitionName = "partsch"; TransMeta trans1 = createTransMeta(); trans1.setRepository( repository ); trans1.setSharedObjects( createSharedObjects( SHARED_OBJECTS_FILE ) ); PartitionSchema part1 = createPartitionSchema( partitionName, false ); part1.setObjectId( new StringObjectId( objectId ) ); trans1.addOrReplacePartitionSchema( part1 ); spoon.delegates.trans.addTransformation( trans1 ); TransMeta trans2 = createTransMeta(); trans2.setRepository( repository ); trans2.setSharedObjects( createSharedObjects( SHARED_OBJECTS_FILE ) ); PartitionSchema part2 = createPartitionSchema( partitionName, false ); part2.setObjectId( new StringObjectId( objectId ) ); trans2.addOrReplacePartitionSchema( part2 ); spoon.delegates.trans.addTransformation( trans2 ); assertFalse( trans1.getPartitionSchemas().isEmpty() ); spoon.delegates.partitions.delPartitionSchema( trans2, part2 ); verify( repository ).deletePartitionSchema( part2.getObjectId() ); assertTrue( trans1.getPartitionSchemas().isEmpty() ); } finally { spoon.rep = null; when( spoon.getRepository() ).thenReturn( null ); } }
public synchronized void deletePartitionSchema( PartitionSchema removed ) { synchronizeTransformations( true, transMeta -> transMeta.getPartitionSchemas().remove( removed ) ); }
SharedObjectSyncUtil { public synchronized void deletePartitionSchema( PartitionSchema removed ) { synchronizeTransformations( true, transMeta -> transMeta.getPartitionSchemas().remove( removed ) ); } }
SharedObjectSyncUtil { public synchronized void deletePartitionSchema( PartitionSchema removed ) { synchronizeTransformations( true, transMeta -> transMeta.getPartitionSchemas().remove( removed ) ); } SharedObjectSyncUtil( Spoon spoon ); }
SharedObjectSyncUtil { public synchronized void deletePartitionSchema( PartitionSchema removed ) { synchronizeTransformations( true, transMeta -> transMeta.getPartitionSchemas().remove( removed ) ); } SharedObjectSyncUtil( Spoon spoon ); synchronized void synchronizeConnections( DatabaseMeta database ); synchronized void synchronizeConnections( DatabaseMeta database, String originalName ); synchronized void synchronizeSlaveServers( SlaveServer slaveServer ); synchronized void synchronizeSlaveServers( SlaveServer slaveServer, String originalName ); synchronized void deleteSlaveServer( SlaveServer removed ); synchronized void deleteClusterSchema( ClusterSchema removed ); synchronized void deletePartitionSchema( PartitionSchema removed ); synchronized void reloadTransformationRepositoryObjects( boolean includeActive ); synchronized void reloadJobRepositoryObjects( boolean includeActive ); synchronized void reloadSharedObjects(); synchronized void synchronizeClusterSchemas( ClusterSchema clusterSchema ); synchronized void synchronizeClusterSchemas( ClusterSchema clusterSchema, String originalName ); synchronized void synchronizePartitionSchemas( PartitionSchema partitionSchema ); synchronized void synchronizePartitionSchemas( PartitionSchema partitionSchema, String originalName ); synchronized void synchronizeSteps( StepMeta step ); synchronized void synchronizeSteps( StepMeta step, String originalName ); }
SharedObjectSyncUtil { public synchronized void deletePartitionSchema( PartitionSchema removed ) { synchronizeTransformations( true, transMeta -> transMeta.getPartitionSchemas().remove( removed ) ); } SharedObjectSyncUtil( Spoon spoon ); synchronized void synchronizeConnections( DatabaseMeta database ); synchronized void synchronizeConnections( DatabaseMeta database, String originalName ); synchronized void synchronizeSlaveServers( SlaveServer slaveServer ); synchronized void synchronizeSlaveServers( SlaveServer slaveServer, String originalName ); synchronized void deleteSlaveServer( SlaveServer removed ); synchronized void deleteClusterSchema( ClusterSchema removed ); synchronized void deletePartitionSchema( PartitionSchema removed ); synchronized void reloadTransformationRepositoryObjects( boolean includeActive ); synchronized void reloadJobRepositoryObjects( boolean includeActive ); synchronized void reloadSharedObjects(); synchronized void synchronizeClusterSchemas( ClusterSchema clusterSchema ); synchronized void synchronizeClusterSchemas( ClusterSchema clusterSchema, String originalName ); synchronized void synchronizePartitionSchemas( PartitionSchema partitionSchema ); synchronized void synchronizePartitionSchemas( PartitionSchema partitionSchema, String originalName ); synchronized void synchronizeSteps( StepMeta step ); synchronized void synchronizeSteps( StepMeta step, String originalName );  }