*/
public class ConverterTest extends TestCase {
public void testRepositoryInfo() throws Exception {
// dry run
RepositoryInfoImpl obj1 = new RepositoryInfoImpl();
RepositoryInfo obj2 = Converter.convert(Converter.convert(obj1));
assertDataObjectsEquals("RepositoryInfo", obj1, obj2);
// values
obj1 = new RepositoryInfoImpl();
obj1.setChangesIncomplete(Boolean.TRUE);
obj1.setChangesOnType(Collections.singletonList(BaseTypeId.CMIS_DOCUMENT));
obj1.setCmisVersionSupported("1.0");
obj1.setLatestChangeLogToken("changeLogToken");
obj1.setPrincipalAnonymous("principalAnonymous");
obj1.setPrincipalAnyone("principalAnyone");
obj1.setProductName("productName");
obj1.setProductVersion("productVersion");
obj1.setDescription("description");
obj1.setId("id");
obj1.setName("name");
obj1.setRootFolder("rootFolderId");
obj1.setThinClientUri("thinClientUri");
obj1.setVendorName("vendorName");
RepositoryCapabilitiesImpl cap1 = new RepositoryCapabilitiesImpl();
cap1.setAllVersionsSearchable(Boolean.TRUE);
cap1.setCapabilityAcl(CapabilityAcl.DISCOVER);
cap1.setCapabilityChanges(CapabilityChanges.ALL);
cap1.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.ANYTIME);
cap1.setCapabilityJoin(CapabilityJoin.INNERANDOUTER);
cap1.setCapabilityQuery(CapabilityQuery.BOTHCOMBINED);
cap1.setCapabilityRendition(CapabilityRenditions.READ);
cap1.setIsPwcSearchable(Boolean.TRUE);
cap1.setIsPwcUpdatable(Boolean.TRUE);
cap1.setSupportsGetDescendants(Boolean.TRUE);
cap1.setSupportsGetFolderTree(Boolean.TRUE);
cap1.setSupportsMultifiling(Boolean.TRUE);
cap1.setSupportsUnfiling(Boolean.TRUE);
cap1.setSupportsVersionSpecificFiling(Boolean.TRUE);
obj1.setCapabilities(cap1);
AclCapabilitiesDataImpl acl1 = new AclCapabilitiesDataImpl();
acl1.setAclPropagation(AclPropagation.PROPAGATE);
List<PermissionDefinition> pddList = new ArrayList<PermissionDefinition>();
PermissionDefinitionDataImpl pdd1 = new PermissionDefinitionDataImpl();
pdd1.setPermission("test:perm1");
pdd1.setDescription("Permission1");
pddList.add(pdd1);
PermissionDefinitionDataImpl pdd2 = new PermissionDefinitionDataImpl();
pdd2.setPermission("test:perm2");
pdd2.setDescription("Permission2");
pddList.add(pdd2);
acl1.setPermissionDefinitionData(pddList);
Map<String, PermissionMapping> pmd = new LinkedHashMap<String, PermissionMapping>();
PermissionMappingDataImpl pmd1 = new PermissionMappingDataImpl();
pmd1.setKey(PermissionMapping.CAN_CREATE_DOCUMENT_FOLDER);
pmd1.setPermissions(Arrays.asList(new String[] { "p1", "p2" }));
pmd.put(pmd1.getKey(), pmd1);
PermissionMappingDataImpl pmd2 = new PermissionMappingDataImpl();
pmd2.setKey(PermissionMapping.CAN_DELETE_OBJECT);
pmd2.setPermissions(Arrays.asList(new String[] { "p3", "p4" }));
pmd.put(pmd2.getKey(), pmd2);
acl1.setPermissionMappingData(pmd);
obj1.setAclCapabilities(acl1);
obj2 = Converter.convert(Converter.convert(obj1));
assertDataObjectsEquals("RepositoryInfo", obj1, obj2);
}