Assert.assertEquals(doc, expected);
}
@Test
public void testWithOptions() throws ParserConfigurationException {
ZencoderOutput output = new ZencoderOutput("test", "http://testpath/");
output.setAspectMode(ZencoderAspectMode.crop);
output.setAudioBitrate(128);
output.setAudioChannels(1);
output.setAudioCodec(ZencoderAudioCodec.mp3);
output.setAudioQuality(1);
output.setAudioSamplerate(12300);
output.setBufferSize(12345);
output.setClipLength("12.5");
output.setDecimate(2);
output.setDeinterlace(ZencoderDeinterlace.on);
output.setFrameRate(13);
output.setHeight(1234);
output.setKeyFrameInterval(12);
output.setMaxFrameRate(29);
output.setRotate(90);
output.setSize("123X456");
output.setSkipAudio(true);
output.setSpeed(1);
output.setStartClip("56:00");
output.setSkipVideo(true);
output.setUpscale(true);
output.setVideoBitrate(12345);
output.setVideoBitrateCap(123);
output.setVideoQuality(1);
output.setVideoCodec(ZencoderVideoCodec.theora);
output.setWidth(12);
output.setPublic(true);
output.setDeblock(true);
output.setAutolevel(true);
output.setDenoise(ZencoderDenoiseFilter.WEAK);
String doc = StringUtil.stripSpacesAndLineBreaksFrom(output.toString());
// System.out.println("TestWithOptions: " + doc);
String expected = "<?xmlversion=\"1.0\"encoding=\"UTF-8\"?><output><label>test</label><url>http://testpath/</url><speed>1</speed><start_clip>56:00</start_clip><clip_length>12.5</clip_length><public>1</public><video_codec>theora</video_codec><width>12</width><height>1234</height><size>123X456</size><upscale>1</upscale><aspect_mode>crop</aspect_mode><quality>1</quality><video_bitrate>12345</video_bitrate><bitrate_cap>123</bitrate_cap><buffer_size>12345</buffer_size><deinterlace>on</deinterlace><max_frame_rate>29.0</max_frame_rate><frame_rate>13.0</frame_rate><decimate>2</decimate><keyframe_interval>12</keyframe_interval><rotate>90</rotate><skip_video>1</skip_video><denoise>weak</denoise><deblock>1</deblock><autolevel>1</autolevel><audio_codec>mp3</audio_codec><audio_bitrate>128</audio_bitrate><audio_sample_rate>12300</audio_sample_rate><audio_quality>1</audio_quality><audio_channels>1</audio_channels><skip_audio>1</skip_audio></output>";
Assert.assertEquals(doc, expected);
}