*/
public class DocumentBinderTest {
@Test
public void setAsText() throws Exception {
DES3CiphererDecipherer crypto = new DES3CiphererDecipherer();
crypto.init();
DocumentBinder binder = new DocumentBinder(crypto);
binder.setAsText("mimeType=image/gif\nsizeInBytes=200\nuri=" + crypto.encrypt("/xx/yy.gif") + "\ncreated=2008-03-18\nidentifier=coverdata\n");
Document doc = (Document) binder.getValue();
assertEquals("coverdata", doc.getIdentifier());
assertTrue(200 == doc.getSizeInBytes());
Calendar c = Calendar.getInstance();
assertTrue(doc.getCreated().compareTo(c.getTime()) < 0);