1 17 package org.alfresco.service.cmr.repository; 18 19 import junit.framework.TestCase; 20 21 26 public class ContentDataTest extends TestCase 27 { 28 29 public ContentDataTest(String name) 30 { 31 super(name); 32 } 33 34 public void testToAndFromString() throws Exception 35 { 36 ContentData property = new ContentData(null, null, 0L, null); 37 38 String propertyStr = property.toString(); 40 assertEquals("Null values not converted correctly", 41 "contentUrl=|mimetype=|size=0|encoding=", propertyStr); 42 43 ContentData checkProperty = ContentData.createContentProperty(propertyStr); 45 assertEquals("Conversion from string failed", property, checkProperty); 46 47 property = new ContentData("uuu", "mmm", 123L, "eee"); 48 49 propertyStr = property.toString(); 51 assertEquals("Incorrect property string representation", 52 "contentUrl=uuu|mimetype=mmm|size=123|encoding=eee", propertyStr); 53 54 checkProperty = ContentData.createContentProperty(propertyStr); 56 assertEquals("Conversion from string failed", property, checkProperty); 57 } 58 } 59 | Popular Tags |