@Override public void run(Session session) { if (session.getRepositoryInfo().getCmisVersion() == CmisVersion.CMIS_1_0) { addResult(createResult(SKIPPED, "Type mutability is not supported by CMIS 1.0. Test skipped!")); return; } ObjectType parentType = session.getTypeDefinition(getDocumentTestTypeId()); if (parentType.getTypeMutability() == null || !Boolean.TRUE.equals(parentType.getTypeMutability().canCreate())) { addResult(createResult(SKIPPED, "Test document type doesn't allow creating a sub-type. Test skipped!")); return; } createTypeWithoutProperties(session, parentType); createTypeWithProperties(session, parentType); }
if (type.getTypeMutability() == null) { addResult(createResult(FAILURE, "Type does not provide type mutability data! ID: " + typeId)); } else { if (!Boolean.TRUE.equals(type.getTypeMutability().canDelete())) { addResult(createResult(WARNING, "Type indicates that it cannot be deleted. Trying it anyway. ID: " + typeId));
/** * Creates a new type. */ protected ObjectType createType(Session session, TypeDefinition typeDef) { NewTypeSettableAttributes settableAttributes = session.getRepositoryInfo().getCapabilities() .getNewTypeSettableAttributes(); if (settableAttributes == null) { addResult(createResult(WARNING, "Repository Info does not indicate, which type attributes can be set!")); } else { // TODO: add more tests } ObjectType newType = null; try { newType = session.createType(typeDef); addResult(createInfoResult("Created type '" + typeDef.getId() + "'. Repository assigned the following type ID: " + newType.getId())); } catch (CmisBaseException e) { addResult(createResult(FAILURE, "Creating type '" + typeDef.getId() + "' failed: " + e.getMessage(), e, false)); return null; } addResult(checkTypeDefinition(session, newType, "Newly created type spec compliance.")); if (newType.getTypeMutability() == null) { addResult(createResult(FAILURE, "Newly created type does not provide type mutability data! ID: " + newType.getId())); } return newType; }