use of org.opencastproject.composer.api.EncodingProfile in project opencast by opencast.
the class EncodingProfileTest method testHasExtensions.
/**
* Test method for {@link org.opencastproject.composer.api.EncodingProfileImpl#hasExtensions()}.
*/
@Test
public void testHasExtensions() {
EncodingProfile profile = profiles.get(h264ProfileId);
assertFalse(profile.hasExtensions());
// Test profile with existing extension
profile = profiles.get(coverProfileId);
assertTrue(profile.hasExtensions());
}
use of org.opencastproject.composer.api.EncodingProfile in project opencast by opencast.
the class EncodingProfileTest method testGetApplicableMediaTypes.
/**
* Test method for {@link org.opencastproject.composer.api.EncodingProfileImpl#getApplicableMediaTypes()}.
*/
@Test
public void testGetApplicableMediaTypes() {
EncodingProfile profile = profiles.get(h264ProfileId);
MediaType type = profile.getApplicableMediaType();
assertNotNull(type);
assertEquals(MediaType.Visual, type);
}
use of org.opencastproject.composer.api.EncodingProfile in project opencast by opencast.
the class ComposerRestServiceTest method setUp.
@Before
public void setUp() throws Exception {
MediaPackageElementBuilder builder = MediaPackageElementBuilderFactory.newInstance().newElementBuilder();
// Set up our arguments and return values
audioTrack = (Track) builder.newElement(Track.TYPE, MediaPackageElements.PRESENTATION_SOURCE);
audioTrack.setIdentifier("audio1");
videoTrack = (Track) builder.newElement(Track.TYPE, MediaPackageElements.PRESENTATION_SOURCE);
videoTrack.setIdentifier("video1");
profileId = "profile1";
job = new JobImpl(1);
job.setStatus(Job.Status.QUEUED);
job.setJobType(ComposerService.JOB_TYPE);
profile = new EncodingProfileImpl();
profile.setIdentifier(profileId);
List<EncodingProfileImpl> list = new ArrayList<EncodingProfileImpl>();
list.add(profile);
profileList = new EncodingProfileList(list);
// Train a mock composer with some known behavior
ComposerService composer = EasyMock.createNiceMock(ComposerService.class);
EasyMock.expect(composer.encode(videoTrack, profileId)).andReturn(job).anyTimes();
EasyMock.expect(composer.mux(videoTrack, audioTrack, profileId)).andReturn(job).anyTimes();
EasyMock.expect(composer.listProfiles()).andReturn(list.toArray(new EncodingProfile[list.size()]));
EasyMock.expect(composer.getProfile(profileId)).andReturn(profile);
EasyMock.expect(composer.concat(EasyMock.eq(profileId), EasyMock.eq(new Dimension(640, 480)), (Track) EasyMock.notNull(), (Track) EasyMock.notNull())).andReturn(job);
EasyMock.expect(composer.concat(EasyMock.eq(profileId), EasyMock.eq(new Dimension(640, 480)), EasyMock.gt(0.0f), (Track) EasyMock.notNull(), (Track) EasyMock.notNull())).andReturn(job);
EasyMock.replay(composer);
// Set up the rest endpoint
restService = new ComposerRestService();
restService.setComposerService(composer);
restService.activate(null);
}
Aggregations