[ 
https://issues.apache.org/jira/browse/ARIA-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15809384#comment-15809384
 ] 

ASF GitHub Bot commented on ARIA-52:
------------------------------------

Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/46#discussion_r95078087
  
    --- Diff: tests/storage/test_model_storage.py ---
    @@ -144,3 +152,77 @@ def test_application_storage_factory():
         assert storage.execution
     
         release_sqlite_storage(storage)
    +
    +
    +def test_relationship_model_ordering(context):
    +    deployment = 
context.model.deployment.get_by_name(models.DEPLOYMENT_NAME)
    +    source_node = 
context.model.node.get_by_name(models.DEPENDENT_NODE_NAME)
    +    source_node_instance = context.model.node_instance.get_by_name(
    +        models.DEPENDENT_NODE_INSTANCE_NAME)
    +    new_node = model.Node(
    +        name='new_node',
    +        type='test_node_type',
    +        type_hierarchy=[],
    +        number_of_instances=1,
    +        planned_number_of_instances=1,
    +        deploy_number_of_instances=1,
    +        properties={},
    +        operations=dict((key, {}) for key in operations.NODE_OPERATIONS),
    +        min_number_of_instances=1,
    +        max_number_of_instances=1,
    +        deployment=deployment
    +    )
    +    new_relationship = model.Relationship(
    +        source_node=source_node,
    +        target_node=new_node,
    +        source_interfaces={},
    +        source_operations=dict((key, {}) for key in 
operations.RELATIONSHIP_OPERATIONS),
    +        target_interfaces={},
    +        target_operations=dict((key, {}) for key in 
operations.RELATIONSHIP_OPERATIONS),
    +        type='rel_type',
    +        type_hierarchy=[],
    +        properties={},
    +    )
    +    new_node_instance = model.NodeInstance(
    +        name='new_node_instance',
    +        runtime_properties={},
    +        version=None,
    +        node=new_node,
    +        state='',
    +        scaling_groups=[]
    +    )
    +    new_relationship_instance = model.RelationshipInstance(
    +        relationship=new_relationship,
    +        target_node_instance=new_node_instance,
    +        source_node_instance=source_node_instance,
    +    )
    +
    +    context.model.node.put(new_node)
    +    context.model.node_instance.put(new_node_instance)
    +    context.model.relationship.put(new_relationship)
    +    context.model.relationship_instance.put(new_relationship_instance)
    +
    +    assert len(source_node.outbound_relationships) == 2
    +    assert len(source_node_instance.outbound_relationship_instances) == 2
    +    first_rel, second_rel = source_node.outbound_relationships
    +    first_rel_instance, second_rel_instance = 
source_node_instance.outbound_relationship_instances
    +
    +    assert first_rel.position == first_rel_instance.position == 0
    +    assert second_rel.position == second_rel_instance.position == 0
    --- End diff --
    
    wtf


> Support order management in relationships
> -----------------------------------------
>
>                 Key: ARIA-52
>                 URL: https://issues.apache.org/jira/browse/ARIA-52
>             Project: AriaTosca
>          Issue Type: Bug
>            Reporter: Maxim Orlov
>            Assignee: Maxim Orlov
>            Priority: Minor
>
> Currently changing the order of a node's (or node instance) relationships 
> does not affect the storage. The storage should reflect any order changes 
> applied to the relationships.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to