TieredStorageAssetManagerJobProducer extends AbstractJobProducer { protected String internalMoveById(final String mpId, final String targetStorage) { RichAResult results = tsam.getSnapshotsById(mpId); List<Job> subjobs = spawnSubjobs(results, targetStorage); return Integer.toString(subjobs.size()); } TieredStorageAssetManagerJobProducer(); @Override void activate(ComponentContext cc); boolean datastoreExists(String storeId); Job moveByIdAndVersion(final Version version, final String mpId, final String targetStorage); Job moveById(final String mpId, final String targetStorage); Job moveByDate(final Date start, final Date end, final String targetStorage); Job moveByIdAndDate(final String mpId, final Date start, final Date end, final String targetStorage); static final String JOB_TYPE; static final Float JOB_LOAD; static final Float NONTERMINAL_JOB_LOAD; }
@Test public void testInternalById() throws ServiceRegistryException { String[] mp = createAndAddMediaPackagesSimple(2, 2, 2, Opt.<String>none()); createIdAndVersionExpectation(mp[1], 0, 2); EasyMock.replay(sr); Assert.assertEquals("Both versions should move", "2", tsamjp.internalMoveById(mp[1], REMOTE_STORE_1_ID)); EasyMock.verify(sr); }