/** * Create an instance of {@link BusinessObjectFormat } * */ public BusinessObjectFormat createBusinessObjectFormat() { return new BusinessObjectFormat(); }
theId = this.getId(); strategy.appendField(locator, this, "id", buffer, theId, true); theNamespace = this.getNamespace(); strategy.appendField(locator, this, "namespace", buffer, theNamespace, (this.namespace!= null)); theBusinessObjectDefinitionName = this.getBusinessObjectDefinitionName(); strategy.appendField(locator, this, "businessObjectDefinitionName", buffer, theBusinessObjectDefinitionName, (this.businessObjectDefinitionName!= null)); theBusinessObjectFormatUsage = this.getBusinessObjectFormatUsage(); strategy.appendField(locator, this, "businessObjectFormatUsage", buffer, theBusinessObjectFormatUsage, (this.businessObjectFormatUsage!= null)); theBusinessObjectFormatFileType = this.getBusinessObjectFormatFileType(); strategy.appendField(locator, this, "businessObjectFormatFileType", buffer, theBusinessObjectFormatFileType, (this.businessObjectFormatFileType!= null)); theBusinessObjectFormatVersion = this.getBusinessObjectFormatVersion(); strategy.appendField(locator, this, "businessObjectFormatVersion", buffer, theBusinessObjectFormatVersion, true); theLatestVersion = this.isLatestVersion(); strategy.appendField(locator, this, "latestVersion", buffer, theLatestVersion, true); thePartitionKey = this.getPartitionKey(); strategy.appendField(locator, this, "partitionKey", buffer, thePartitionKey, (this.partitionKey!= null)); theDescription = this.getDescription(); strategy.appendField(locator, this, "description", buffer, theDescription, (this.description!= null)); theDocumentSchema = this.getDocumentSchema(); strategy.appendField(locator, this, "documentSchema", buffer, theDocumentSchema, (this.documentSchema!= null));
/** * Returns a business object format key for the business object format. * * @param businessObjectFormat the business object format * * @return the business object format key */ public BusinessObjectFormatKey getBusinessObjectFormatKey(BusinessObjectFormat businessObjectFormat) { return new BusinessObjectFormatKey(businessObjectFormat.getNamespace(), businessObjectFormat.getBusinessObjectDefinitionName(), businessObjectFormat.getBusinessObjectFormatUsage(), businessObjectFormat.getBusinessObjectFormatFileType(), businessObjectFormat.getBusinessObjectFormatVersion()); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof BusinessObjectFormat) { final BusinessObjectFormat copy = ((BusinessObjectFormat) draftCopy); if (idShouldBeCopiedAndSet == Boolean.TRUE) { int sourceId; sourceId = this.getId(); int copyId = strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, true); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) { if (namespaceShouldBeCopiedAndSet == Boolean.TRUE) { String sourceNamespace; sourceNamespace = this.getNamespace(); String copyNamespace = ((String) strategy.copy(LocatorUtils.property(locator, "namespace", sourceNamespace), sourceNamespace, (this.namespace!= null))); copy.setNamespace(copyNamespace); } else { if (namespaceShouldBeCopiedAndSet == Boolean.FALSE) { if (businessObjectDefinitionNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceBusinessObjectDefinitionName; sourceBusinessObjectDefinitionName = this.getBusinessObjectDefinitionName(); String copyBusinessObjectDefinitionName = ((String) strategy.copy(LocatorUtils.property(locator, "businessObjectDefinitionName", sourceBusinessObjectDefinitionName), sourceBusinessObjectDefinitionName, (this.businessObjectDefinitionName!= null))); copy.setBusinessObjectDefinitionName(copyBusinessObjectDefinitionName); } else { if (businessObjectDefinitionNameShouldBeCopiedAndSet == Boolean.FALSE) { if (businessObjectFormatUsageShouldBeCopiedAndSet == Boolean.TRUE) {
BusinessObjectFormat businessObjectFormat = new BusinessObjectFormat(); businessObjectFormat.setId(businessObjectFormatEntity.getId()); businessObjectFormat.setNamespace(businessObjectFormatEntity.getBusinessObjectDefinition().getNamespace().getCode()); businessObjectFormat.setBusinessObjectDefinitionName(businessObjectFormatEntity.getBusinessObjectDefinition().getName()); businessObjectFormat.setBusinessObjectFormatUsage(businessObjectFormatEntity.getUsage()); businessObjectFormat.setBusinessObjectFormatFileType(businessObjectFormatEntity.getFileType().getCode()); businessObjectFormat.setBusinessObjectFormatVersion(businessObjectFormatEntity.getBusinessObjectFormatVersion()); businessObjectFormat.setLatestVersion(businessObjectFormatEntity.getLatestVersion()); businessObjectFormat.setPartitionKey(businessObjectFormatEntity.getPartitionKey()); businessObjectFormat.setDescription(businessObjectFormatEntity.getDescription()); businessObjectFormat.setDocumentSchema(businessObjectFormatEntity.getDocumentSchema()); businessObjectFormat.setAttributes(attributes); for (BusinessObjectFormatAttributeEntity attributeEntity : businessObjectFormatEntity.getAttributes()) businessObjectFormat.setAttributeDefinitions(attributeDefinitions); businessObjectFormat.setSchema(schema); schema.setNullValue(businessObjectFormatEntity.getNullValue()); schema.setDelimiter(businessObjectFormatEntity.getDelimiter()); businessObjectFormat.setBusinessObjectFormatParents(businessObjectFormatParents); for (BusinessObjectFormatEntity businessObjectFormatEntityParent : latestVersionBusinessObjectFormatEntity.getBusinessObjectFormatParents()) businessObjectFormat.setBusinessObjectFormatChildren(businessObjectFormatChildren); for (BusinessObjectFormatEntity businessObjectFormatEntityChild : latestVersionBusinessObjectFormatEntity.getBusinessObjectFormatChildren()) businessObjectFormat.setBusinessObjectFormatExternalInterfaces(businessObjectFormatExternalInterfaceKeys); for (BusinessObjectFormatExternalInterfaceEntity businessObjectFormatExternalInterfaceEntity : latestVersionBusinessObjectFormatEntity
BusinessObjectFormat expectedBusinessObjectFormat = new BusinessObjectFormat(); expectedBusinessObjectFormat.setId(businessObjectFormat.getId()); expectedBusinessObjectFormat.setNamespace(BDEF_NAMESPACE); expectedBusinessObjectFormat.setBusinessObjectDefinitionName(BDEF_NAME); expectedBusinessObjectFormat.setBusinessObjectFormatUsage(FORMAT_USAGE_CODE); expectedBusinessObjectFormat.setBusinessObjectFormatFileType(FileTypeEntity.RELATIONAL_TABLE_FILE_TYPE); expectedBusinessObjectFormat.setBusinessObjectFormatVersion(INITIAL_FORMAT_VERSION); expectedBusinessObjectFormat.setLatestVersion(LATEST_VERSION_FLAG_SET); expectedBusinessObjectFormat.setPartitionKey(BusinessObjectDataServiceImpl.NO_PARTITIONING_PARTITION_KEY); expectedBusinessObjectFormat.setBusinessObjectFormatParents(new ArrayList<>()); expectedBusinessObjectFormat.setBusinessObjectFormatChildren(new ArrayList<>()); expectedBusinessObjectFormat.setBusinessObjectFormatExternalInterfaces(new ArrayList<>()); expectedBusinessObjectFormat.setAttributeDefinitions(new ArrayList<>()); expectedBusinessObjectFormat.setAttributes(Arrays.asList( new Attribute(configurationHelper.getProperty(ConfigurationValue.BUSINESS_OBJECT_FORMAT_ATTRIBUTE_NAME_RELATIONAL_SCHEMA_NAME), relationalSchemaName), new Attribute(configurationHelper.getProperty(ConfigurationValue.BUSINESS_OBJECT_FORMAT_ATTRIBUTE_NAME_RELATIONAL_TABLE_NAME), relationalTableName))); expectedBusinessObjectFormat.setSchema(expectedSchema); expectedBusinessObjectFormat.setAllowNonBackwardsCompatibleChanges(true);
assertEquals(expectedBusinessObjectFormatId, Integer.valueOf(actualBusinessObjectFormat.getId())); assertEquals(expectedNamespaceCode, actualBusinessObjectFormat.getNamespace()); assertEquals(expectedBusinessObjectDefinitionName, actualBusinessObjectFormat.getBusinessObjectDefinitionName()); assertEquals(expectedBusinessObjectFormatUsage, actualBusinessObjectFormat.getBusinessObjectFormatUsage()); assertEquals(expectedBusinessObjectFormatFileType, actualBusinessObjectFormat.getBusinessObjectFormatFileType()); assertEquals(expectedBusinessObjectFormatVersion, Integer.valueOf(actualBusinessObjectFormat.getBusinessObjectFormatVersion())); assertEquals(expectedIsLatestVersion, actualBusinessObjectFormat.isLatestVersion()); assertEquals(expectedPartitionKey, actualBusinessObjectFormat.getPartitionKey()); assertEquals(expectedDocumentSchema, actualBusinessObjectFormat.getDocumentSchema()); AbstractServiceTest.assertEqualsIgnoreNullOrEmpty("description", expectedDescription, actualBusinessObjectFormat.getDescription()); assertEquals(expectedAttributes, actualBusinessObjectFormat.getAttributes()); assertEquals(0, actualBusinessObjectFormat.getAttributes().size()); assertEquals(expectedAttributeDefinitions, actualBusinessObjectFormat.getAttributeDefinitions()); assertEquals(0, actualBusinessObjectFormat.getAttributeDefinitions().size()); assertNotNull(actualBusinessObjectFormat.getSchema()); AbstractServiceTest .assertEqualsIgnoreNullOrEmpty("null value", expectedSchema.getNullValue(), actualBusinessObjectFormat.getSchema().getNullValue()); AbstractServiceTest .assertEqualsIgnoreNullOrEmpty("delimiter", expectedSchema.getDelimiter(), actualBusinessObjectFormat.getSchema().getDelimiter()); AbstractServiceTest.assertEqualsIgnoreNullOrEmpty("escape character", expectedSchema.getEscapeCharacter(), actualBusinessObjectFormat.getSchema().getEscapeCharacter()); assertEquals(expectedSchema.getPartitionKeyGroup(), actualBusinessObjectFormat.getSchema().getPartitionKeyGroup()); assertEquals(expectedSchema.getColumns().size(), actualBusinessObjectFormat.getSchema().getColumns().size());
expectedBusinessObjectFormatChild.setId(resultBusinessObjectFormatChildV1.getId()); expectedBusinessObjectFormatChild.setBusinessObjectFormatVersion(resultBusinessObjectFormatChildV1.getBusinessObjectFormatVersion()); expectedBusinessObjectFormatChild.setBusinessObjectFormatParents(resultBusinessObjectFormatChildV1.getBusinessObjectFormatParents()); assertEquals(resultBusinessObjectFormatChildV1.getBusinessObjectFormatParents().size(), 1); assertEquals(expectedBusinessObjectFormatChild, resultBusinessObjectFormatChildV1); assertEquals(resultBusinessObjectFormatParentV2.getBusinessObjectFormatChildren().size(), 1); BusinessObjectFormat expectedBusinessObjectParent = resultBusinessObjectFormatV0; expectedBusinessObjectParent.setId(resultBusinessObjectFormatParentV2.getId()); expectedBusinessObjectParent.setBusinessObjectFormatVersion(resultBusinessObjectFormatParentV2.getBusinessObjectFormatVersion()); expectedBusinessObjectParent.setBusinessObjectFormatChildren(resultBusinessObjectFormatParentV2.getBusinessObjectFormatChildren()); assertEquals(expectedBusinessObjectParent, resultBusinessObjectFormatParentV2);
context.put("namespace", s3KeyPrefixFormat(businessObjectFormat.getNamespace())); context.put("dataProviderName", s3KeyPrefixFormat(dataProviderName)); context.put("businessObjectDefinitionName", s3KeyPrefixFormat(businessObjectFormat.getBusinessObjectDefinitionName())); context.put("businessObjectFormatUsage", s3KeyPrefixFormat(businessObjectFormat.getBusinessObjectFormatUsage())); context.put("businessObjectFormatFileType", s3KeyPrefixFormat(businessObjectFormat.getBusinessObjectFormatFileType())); context.put("businessObjectFormatVersion", s3KeyPrefixFormat(String.valueOf(businessObjectFormat.getBusinessObjectFormatVersion()))); context.put("businessObjectDataVersion", s3KeyPrefixFormat(String.valueOf(businessObjectDataKey.getBusinessObjectDataVersion()))); context.put("businessObjectFormatPartitionKey", s3KeyPrefixFormat(s3KeyPrefixFormat(businessObjectFormat.getPartitionKey()))); context.put("businessObjectDataPartitionValue", businessObjectDataKey.getPartitionValue()); Assert.notNull(businessObjectFormat.getSchema(), String .format("Schema must be defined when using subpartition values for business object format {%s}.", businessObjectFormatHelper.businessObjectFormatKeyToString(businessObjectFormatHelper.getBusinessObjectFormatKey(businessObjectFormat)))); Assert.notNull(businessObjectFormat.getSchema().getPartitions(), String .format("Schema partition(s) must be defined when using subpartition values for business object " + "format {%s}.", businessObjectFormatHelper.businessObjectFormatKeyToString(businessObjectFormatHelper.getBusinessObjectFormatKey(businessObjectFormat)))); Assert.isTrue(businessObjectFormat.getSchema().getPartitions().size() > businessObjectDataKey.getSubPartitionValues().size(), String.format("Number of subpartition values specified for the business object data is greater than or equal to " + "the number of partition columns defined in the schema for the associated business object format." + subPartitions.put(s3KeyPrefixFormat(businessObjectFormat.getSchema().getPartitions().get(i + 1).getName()), businessObjectDataKey.getSubPartitionValues().get(i));
businessObjectFormatCreateRequest.setNamespace(relationalTableRegistrationDto.getBusinessObjectFormat().getNamespace()); businessObjectFormatCreateRequest .setBusinessObjectDefinitionName(relationalTableRegistrationDto.getBusinessObjectFormat().getBusinessObjectDefinitionName()); businessObjectFormatCreateRequest.setBusinessObjectFormatUsage(relationalTableRegistrationDto.getBusinessObjectFormat().getBusinessObjectFormatUsage()); businessObjectFormatCreateRequest .setBusinessObjectFormatFileType(relationalTableRegistrationDto.getBusinessObjectFormat().getBusinessObjectFormatFileType()); businessObjectFormatCreateRequest.setPartitionKey(relationalTableRegistrationDto.getBusinessObjectFormat().getPartitionKey()); businessObjectFormatCreateRequest.setAttributes(relationalTableRegistrationDto.getBusinessObjectFormat().getAttributes()); businessObjectFormatCreateRequest.setSchema(new Schema(schemaColumns, null, "", null, null, null));
new BusinessObjectFormatExternalInterfaceKey(businessObjectFormat.getNamespace(), businessObjectFormat.getBusinessObjectDefinitionName(), businessObjectFormat.getBusinessObjectFormatUsage(), businessObjectFormat.getBusinessObjectFormatFileType(), externalInterfaceEntity.getCode()); velocityContext.put("CollectionUtils", CollectionUtils.class); velocityContext.put("Collections", Collections.class); velocityContext.put("namespace", businessObjectFormat.getNamespace()); velocityContext.put("businessObjectDefinitionName", businessObjectFormat.getBusinessObjectDefinitionName()); velocityContext.put("businessObjectFormatUsage", businessObjectFormat.getBusinessObjectFormatUsage()); velocityContext.put("businessObjectFormatFileType", businessObjectFormat.getBusinessObjectFormatFileType()); for (Attribute attribute : businessObjectFormat.getAttributes()) if (businessObjectFormat.getSchema() != null) for (SchemaColumn schemaColumn : businessObjectFormat.getSchema().getPartitions())
BusinessObjectFormat businessObjectFormat = new BusinessObjectFormat(); businessObjectFormat.setId(ID);
new BusinessObjectFormatCreateRequest(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_DESCRIPTION, PARTITION_KEY, NO_FORMAT_DOCUMENT_SCHEMA, NO_ATTRIBUTES, NO_ATTRIBUTE_DEFINITIONS, NO_SCHEMA)); assertEquals(SECOND_FORMAT_VERSION, Integer.valueOf(createdBusinessObjectFormat.getBusinessObjectFormatVersion())); assertTrue(createdBusinessObjectFormat.isLatestVersion()); assertEquals(expectedBusinessObjectFormatExternalInterfaceKeys, createdBusinessObjectFormat.getBusinessObjectFormatExternalInterfaces()); assertEquals(businessObjectFormatVersion, Integer.valueOf(result.getBusinessObjectFormatVersion())); assertEquals(businessObjectFormatVersion.equals(SECOND_FORMAT_VERSION), result.isLatestVersion()); assertEquals(expectedBusinessObjectFormatExternalInterfaceKeys, result.getBusinessObjectFormatExternalInterfaces());
@Test public void testUpdateBusinessObjectFormatAttributes() { List<Attribute> attributes = businessObjectDefinitionServiceTestHelper.getNewAttributes2(); BusinessObjectFormat businessObjectFormat = new BusinessObjectFormat(); businessObjectFormat.setAttributes(attributes); BusinessObjectFormatKey businessObjectFormatKey = new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION); BusinessObjectFormatAttributesUpdateRequest request = new BusinessObjectFormatAttributesUpdateRequest(attributes); when(businessObjectFormatService.updateBusinessObjectFormatAttributes(businessObjectFormatKey, request)).thenReturn(businessObjectFormat); BusinessObjectFormat updatedBusinessObjectFormat = businessObjectFormatRestController .updateBusinessObjectFormatAttributes(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION, request); // Verify the external calls. verify(businessObjectFormatService).updateBusinessObjectFormatAttributes(businessObjectFormatKey, request); verifyNoMoreInteractions(businessObjectFormatService); // Validate the returned object. assertEquals(businessObjectFormat, updatedBusinessObjectFormat); }
@Test public void testUpdateBusinessObjectFormatAttributeDefinitions() { List<AttributeDefinition> attributeDefinitions = businessObjectFormatServiceTestHelper.getTestAttributeDefinitions(); BusinessObjectFormat businessObjectFormat = new BusinessObjectFormat(); businessObjectFormat.setAttributeDefinitions(attributeDefinitions); BusinessObjectFormatKey businessObjectFormatKey = new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION); BusinessObjectFormatAttributeDefinitionsUpdateRequest request = new BusinessObjectFormatAttributeDefinitionsUpdateRequest(attributeDefinitions); when(businessObjectFormatService.updateBusinessObjectFormatAttributeDefinitions(businessObjectFormatKey, request)).thenReturn(businessObjectFormat); BusinessObjectFormat result = businessObjectFormatRestController .updateBusinessObjectFormatAttributeDefinitions(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION, request); // Verify the external calls. verify(businessObjectFormatService).updateBusinessObjectFormatAttributeDefinitions(businessObjectFormatKey, request); verifyNoMoreInteractions(businessObjectFormatService); // Validate the returned object. assertEquals(businessObjectFormat, result); }
@Test public void testUpdateBusinessObjectFormatParents() { BusinessObjectFormatKey businessObjectFormatKey = new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, null); BusinessObjectFormatKey parentBusinessObjectFormatKey = new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE, null); BusinessObjectFormatParentsUpdateRequest updateRequest = new BusinessObjectFormatParentsUpdateRequest(); updateRequest.setBusinessObjectFormatParents(Collections.singletonList(parentBusinessObjectFormatKey)); BusinessObjectFormat businessObjectFormat = new BusinessObjectFormat(); businessObjectFormat.setBusinessObjectFormatParents(Collections.singletonList(parentBusinessObjectFormatKey)); when(businessObjectFormatService.updateBusinessObjectFormatParents(businessObjectFormatKey, updateRequest)).thenReturn(businessObjectFormat); BusinessObjectFormat resultBusinessObjectFormat = businessObjectFormatRestController .updateBusinessObjectFormatParents(businessObjectFormatKey.getNamespace(), businessObjectFormatKey.getBusinessObjectDefinitionName(), businessObjectFormatKey.getBusinessObjectFormatUsage(), businessObjectFormatKey.getBusinessObjectFormatFileType(), updateRequest); // Verify the external calls. verify(businessObjectFormatService).updateBusinessObjectFormatParents(businessObjectFormatKey, updateRequest); verifyNoMoreInteractions(businessObjectFormatService); // Validate the returned object. assertEquals(businessObjectFormat, resultBusinessObjectFormat); }
assertNull(businessObjectFormatV0.isAllowNonBackwardsCompatibleChanges()); assertFalse(businessObjectFormatV0.isAllowNonBackwardsCompatibleChanges()); assertEquals(true, businessObjectFormatV1.isAllowNonBackwardsCompatibleChanges()); assertEquals(SECOND_FORMAT_VERSION, Integer.valueOf(businessObjectFormatV1.getBusinessObjectFormatVersion())); assertNull(businessObjectFormatEntityV0.isAllowNonBackwardsCompatibleChanges()); assertTrue(businessObjectFormatV0.isAllowNonBackwardsCompatibleChanges()); .deleteBusinessObjectFormat(new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, SECOND_FORMAT_VERSION)); assertNotNull(deletedBusinessObjectFormat); assertTrue(deletedBusinessObjectFormat.isAllowNonBackwardsCompatibleChanges());
assertEquals(businessObjectFormatKey.getBusinessObjectFormatVersion(), Integer.valueOf(result.getBusinessObjectFormatVersion())); assertEquals(expectedBusinessObjectFormatExternalInterfaceKeys, result.getBusinessObjectFormatExternalInterfaces());
@Test public void testUpdateBusinessObjectFormatParents() { // Create relative database entities including a business object definition. setupBusinessObjectFormatParentChild(); BusinessObjectFormatKey businessObjectFormatKey = new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, null); BusinessObjectFormatKey parentBusinessObjectFormatKey = new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE, null); BusinessObjectFormatParentsUpdateRequest updateRequest = new BusinessObjectFormatParentsUpdateRequest(); updateRequest.setBusinessObjectFormatParents(Arrays.asList(parentBusinessObjectFormatKey)); BusinessObjectFormat format = businessObjectFormatService.getBusinessObjectFormat(businessObjectFormatKey); format.setBusinessObjectFormatParents(Arrays.asList(parentBusinessObjectFormatKey)); BusinessObjectFormat resultFormat = businessObjectFormatService.updateBusinessObjectFormatParents(businessObjectFormatKey, updateRequest); Assert.assertEquals(format, resultFormat); //wipe out the parents businessObjectFormatService.getBusinessObjectFormat(businessObjectFormatKey); format.setBusinessObjectFormatParents(new ArrayList<>()); updateRequest.setBusinessObjectFormatParents(new ArrayList<>()); resultFormat = businessObjectFormatService.updateBusinessObjectFormatParents(businessObjectFormatKey, updateRequest); format.setBusinessObjectFormatParents(new ArrayList<>()); Assert.assertEquals(format, resultFormat); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof BusinessObjectFormat) { final BusinessObjectFormat copy = ((BusinessObjectFormat) draftCopy); if (idShouldBeCopiedAndSet == Boolean.TRUE) { int sourceId; sourceId = this.getId(); int copyId = strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, true); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) { if (namespaceShouldBeCopiedAndSet == Boolean.TRUE) { String sourceNamespace; sourceNamespace = this.getNamespace(); String copyNamespace = ((String) strategy.copy(LocatorUtils.property(locator, "namespace", sourceNamespace), sourceNamespace, (this.namespace!= null))); copy.setNamespace(copyNamespace); } else { if (namespaceShouldBeCopiedAndSet == Boolean.FALSE) { if (businessObjectDefinitionNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceBusinessObjectDefinitionName; sourceBusinessObjectDefinitionName = this.getBusinessObjectDefinitionName(); String copyBusinessObjectDefinitionName = ((String) strategy.copy(LocatorUtils.property(locator, "businessObjectDefinitionName", sourceBusinessObjectDefinitionName), sourceBusinessObjectDefinitionName, (this.businessObjectDefinitionName!= null))); copy.setBusinessObjectDefinitionName(copyBusinessObjectDefinitionName); } else { if (businessObjectDefinitionNameShouldBeCopiedAndSet == Boolean.FALSE) { if (businessObjectFormatUsageShouldBeCopiedAndSet == Boolean.TRUE) {