content.setDuration(123);
content.setExpression(Expression.SAMPLE);
content.setFilesize(12345);
content.setFramerate(123);
content.setLanguage("en");
MediaTitle title = content.addExtension(TITLE);
title.setType(Type.PLAIN);
title.setText("This is a sample");
ByteArrayOutputStream out = new ByteArrayOutputStream();
entry.writeTo(out);
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
Parser parser = abdera.getParser();
Document<Entry> doc = parser.parse(in);
entry = doc.getRoot();
group = entry.getExtension(GROUP);
List<MediaContent> list = entry.getExtensions(CONTENT);
for (MediaContent item : list) {
assertEquals(item.getUrl().toString(), "http://example.org");
assertEquals(item.getBitrate(), 123);
assertEquals(item.getChannels(), 2);
assertEquals(item.getDuration(), 123);
assertEquals(item.getExpression(), Expression.SAMPLE);
assertEquals(item.getFilesize(), 12345);
assertEquals(item.getFramerate(), 123);
assertEquals(item.getLang(), "en");
title = item.getExtension(TITLE);
assertNotNull(title);
assertEquals(title.getType(), Type.PLAIN);
assertEquals(title.getText(), "This is a sample");
}
}