Skip to content

Commit

Permalink
Fixed #202 Add API for DataPkg.ownedDataTypes.
Browse files Browse the repository at this point in the history
also added:
- ownedCollections
- ownedExceptions
- ownedUnits
  • Loading branch information
ylussaud committed Aug 7, 2024
1 parent 162249f commit e57f430
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
20 changes: 20 additions & 0 deletions plugins/Python4Capella/simplified_api/capella.py
Original file line number Diff line number Diff line change
Expand Up @@ -4340,6 +4340,26 @@ def get_owned_data_pkgs(self) -> List[DataPkg]:
Returns: DataPkg[*]
"""
return create_e_list(self.get_java_object().getOwnedDataPkgs(), DataPkg)
def get_owned_collections(self) -> List[Collection]:
"""
Returns: Collection[*]
"""
return create_e_list(self.get_java_object().getOwnedCollections(), Collection)
def get_owned_data_types(self) -> List[DataType]:
"""
Returns: DataType[*]
"""
return create_e_list(self.get_java_object().getOwnedDataTypes(), DataType)
def get_owned_exceptions(self) -> List[CapellaException]:
"""
Returns: CapellaException[*]
"""
return create_e_list(self.get_java_object().getOwnedExceptions(), CapellaException)
def get_owned_units(self) -> List[Unit]:
"""
Returns: Unit[*]
"""
return create_e_list(self.get_java_object().getOwnedUnits(), Unit)

class DataType(CapellaElement):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24134,6 +24134,38 @@
<ownedMaxCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="d5502cb2-c1bd-4e42-97a7-1095a831db0f" name="" value="*"/>
</ownedFeatures>
<ownedFeatures xsi:type="org.polarsys.capella.core.data.information:Property"
id="c4c2e877-4d99-4bfd-8605-995b243a921d" name="ownedCollections"
abstractType="#ba938816-c64e-45de-9f2e-d4a682d2e608" aggregationKind="COMPOSITION">
<ownedMinCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="04403fc5-82b8-4c87-970f-060c39a0568b" name="" value="0"/>
<ownedMaxCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="1dc8cb51-a16c-4339-8b60-5eba86151fd6" name="" value="*"/>
</ownedFeatures>
<ownedFeatures xsi:type="org.polarsys.capella.core.data.information:Property"
id="54cf7f99-d945-405d-94d5-5222dbf60000" name="ownedDataTypes"
abstractType="#d28e6b9f-65e2-45f2-a52c-b6a860047e71" aggregationKind="COMPOSITION">
<ownedMinCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="6d2884ee-a364-4e9a-ada3-50d4349a8c8f" name="" value="0"/>
<ownedMaxCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="33df3c36-1f98-471e-b910-4d5278efae58" name="" value="*"/>
</ownedFeatures>
<ownedFeatures xsi:type="org.polarsys.capella.core.data.information:Property"
id="d64e34a3-5bd1-427a-b80f-632815a28a6b" name="ownedExceptions"
abstractType="#85479e43-1868-40af-96d1-02f4e23c79f4" aggregationKind="COMPOSITION">
<ownedMinCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="0c8c609f-e332-43c1-bcf6-290974602331" name="" value="0"/>
<ownedMaxCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="a894dfb4-6ddf-4986-b604-98f570ec06a0" name="" value="*"/>
</ownedFeatures>
<ownedFeatures xsi:type="org.polarsys.capella.core.data.information:Property"
id="59c0a3e3-201b-49c3-8f9e-cb391b361898" name="ownedUnits" abstractType="#582d8750-a42a-41db-939d-515b545481ab"
aggregationKind="COMPOSITION">
<ownedMinCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="9f42b885-d04c-496b-af56-ff83431f4570" name="" value="0"/>
<ownedMaxCard xsi:type="org.polarsys.capella.core.data.information.datavalue:LiteralNumericValue"
id="a31d82e5-d002-4995-acd6-960611f80493" name="" value="*"/>
</ownedFeatures>
</ownedClasses>
<ownedClasses xsi:type="org.polarsys.capella.core.data.information:Class"
id="d28e6b9f-65e2-45f2-a52c-b6a860047e71" name="DataType" abstract="true">
Expand Down
44 changes: 44 additions & 0 deletions tests/Python4CapellaTests/capella_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -30124,6 +30124,50 @@ def test_DataPkg_owned_data_pkgs_setter(self):
tested.get_owned_data_pkgs().add(value)
pass

def test_DataPkg_owned_collections_getter(self):
tested = DataPkg()
tested.get_owned_collections()
pass

def test_DataPkg_owned_collections_setter(self):
tested = DataPkg()
value = Collection()
tested.get_owned_collections().add(value)
pass

def test_DataPkg_owned_data_types_getter(self):
tested = DataPkg()
tested.get_owned_data_types()
pass

def test_DataPkg_owned_data_types_setter(self):
tested = DataPkg()
value = PhysicalQuantity()
tested.get_owned_data_types().add(value)
pass

def test_DataPkg_owned_exceptions_getter(self):
tested = DataPkg()
tested.get_owned_exceptions()
pass

def test_DataPkg_owned_exceptions_setter(self):
tested = DataPkg()
value = CapellaException()
tested.get_owned_exceptions().add(value)
pass

def test_DataPkg_owned_units_getter(self):
tested = DataPkg()
tested.get_owned_units()
pass

def test_DataPkg_owned_units_setter(self):
tested = DataPkg()
value = Unit()
tested.get_owned_units().add(value)
pass

def test_Class_id_getter(self):
tested = Class()
tested.get_id()
Expand Down

0 comments on commit e57f430

Please sign in to comment.