Skip to content

Commit

Permalink
Fixed #193 BehaviorPC.get_deploying_node_p_c() calls getDeployingNode…
Browse files Browse the repository at this point in the history
…PC() that doesn't exists.
  • Loading branch information
ylussaud committed Aug 8, 2024
1 parent b9ae30f commit 3cb8fc0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
17 changes: 3 additions & 14 deletions plugins/Python4Capella/simplified_api/capella.py
Original file line number Diff line number Diff line change
Expand Up @@ -5986,22 +5986,11 @@ def __init__(self, java_object = None):
raise AttributeError("Passed component is an actor.")
else:
raise AttributeError("Passed object is not compatible with " + self.__class__.__name__ + ": " + str(java_object))
def get_deploying_node_p_c(self) -> NodePC:
def get_deploying_node_p_cs(self) -> List[NodePC]:
"""
Returns: NodePC[0..1]
Returns: NodePC[*]
"""
value = self.get_java_object().getDeployingNodePC()
if value is None:
return value
else:
e_object_class = getattr(sys.modules["__main__"], "EObject")
specific_cls = e_object_class.get_class(value)
return specific_cls(value)
def set_deploying_node_p_c(self, value: NodePC):
"""
Parameters: value: NodePC[0..1]
"""
return self.get_java_object().setDeployingNodePC(value.get_java_object())
return create_e_list(self.get_java_object().getDeployingPhysicalComponents(), NodePC)
def get_realized_logical_components(self) -> List[LogicalComponent]:
"""
Returns: LogicalComponent[*]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def get_deploying_node_p_cs(self) -> List[NodePC]:
return create_e_list(self.get_java_object().getDeployingPhysicalComponents(), NodePC)

Original file line number Diff line number Diff line change
Expand Up @@ -12492,12 +12492,13 @@
id="819f041f-a2d9-447d-adbe-ea00de9dcdb6" super="#a5c9af0a-2b12-4b80-adff-c9307c2ab9e2"
sub="#b58e094b-aa71-4bb7-992a-486910f84c80"/>
<ownedFeatures xsi:type="org.polarsys.capella.core.data.information:Property"
id="7a0bf079-e461-4f47-a961-cafbc3a353c2" name="deployingNodePC"
abstractType="#8b417d78-c0d5-4e16-b757-bf103c0b3d97" aggregationKind="ASSOCIATION">
id="7a0bf079-e461-4f47-a961-cafbc3a353c2" name="deployingNodePCs"
abstractType="#8b417d78-c0d5-4e16-b757-bf103c0b3d97" aggregationKind="ASSOCIATION"
isReadOnly="true">
<ownedMinCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="77212009-2171-44fc-b9b7-fea8564d4767" name="" value="0"/>
<ownedMaxCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="26f44e56-1269-47c7-b99c-f0010aed1292" value="1"/>
id="26f44e56-1269-47c7-b99c-f0010aed1292" value="*"/>
</ownedFeatures>
<ownedFeatures xsi:type="org.polarsys.capella.core.data.information:Property"
id="86823835-57f9-4e62-904e-8f2b7f0b348e" name="realizedLogicalComponents"
Expand Down
10 changes: 2 additions & 8 deletions tests/Python4CapellaTests/capella_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15005,15 +15005,9 @@ def test_BehaviorPC_owned_component_exchange_categories_getter(self):
tested.get_owned_component_exchange_categories()
pass

def test_BehaviorPC_deploying_node_p_c_getter(self):
def test_BehaviorPC_deploying_node_p_cs_getter(self):
tested = BehaviorPC()
tested.get_deploying_node_p_c()
pass

def test_BehaviorPC_deploying_node_p_c_setter(self):
tested = BehaviorPC()
value = NodePC()
tested.set_deploying_node_p_c(value)
tested.get_deploying_node_p_cs()
pass

def test_BehaviorPC_realized_logical_components_getter(self):
Expand Down

0 comments on commit 3cb8fc0

Please sign in to comment.