@Test
public void testPartialDistribution() throws Exception {

  // Distribute only some of the elements in the mediapackage
  Job job1 = service.distribute("engage-player", mp, "track-1");
  Job job2 = service.distribute("engage-player", mp, "catalog-1");
  Job job3 = service.distribute("oai-pmh", mp, "catalog-1");
  JobBarrier jobBarrier = new JobBarrier(null, serviceRegistry, 500, job1, job2, job3);
  jobBarrier.waitForJobs();
  File mpDir = new File(distributionRoot,
          PathSupport.path(defaultOrganization.getId(), "engage-player", mp.getIdentifier().toString()));
  Assert.assertTrue(mpDir.exists());
  File mediaDir = new File(mpDir, "track-1");
  File metadataDir = new File(mpDir, "catalog-1");
  File attachmentsDir = new File(mpDir, "notes");
  Assert.assertTrue(mediaDir.exists());
  Assert.assertTrue(metadataDir.exists());
  Assert.assertFalse(attachmentsDir.exists());
  Assert.assertTrue(new File(mediaDir, "media.mov").exists()); // the filenames are changed to reflect the element ID
  Assert.assertTrue(new File(metadataDir, "dublincore.xml").exists());
  Assert.assertFalse(new File(metadataDir, "mpeg7.xml").exists());
  Assert.assertFalse(new File(attachmentsDir, "attachment.txt").exists());
}