Bug 414079

Summary: No unit tests for association available
Product: [Applications] umbrello Reporter: Ralf Habacker <ralf.habacker>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 2.29.3 (KDE Applications 19.08.3)   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In: 2.29.90 (KDE Applications 19.11.90)
Bug Depends on:    
Bug Blocks: 413569    

Description Ralf Habacker 2019-11-12 21:41:49 UTC
STEPS TO REPRODUCE
1. build umbrello from source with unit tests enabled
2. run make test

OBSERVED RESULT
There is no unit test for association available

EXPECTED RESULT
There should be a unit test for association present


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Leap 15.1
KDE Frameworks Version: 5.55
Qt Version: 5.97
Comment 1 Ralf Habacker 2019-11-12 21:44:13 UTC
The unit test is required to see why compositions and aggregations could not be fetched from a UML classifier instance in bug 413569.
Comment 2 Ralf Habacker 2019-11-12 23:28:33 UTC
Git commit 907a5b8b7fa73624eee2fe257c0b0ce58f3a9c4b by Ralf Habacker.
Committed on 12/11/2019 at 23:28.
Pushed by habacker into branch 'release/19.12'.

Fix crash in test_toString()

M  +2    -17   umbrello/uml1model/association.cpp
M  +15   -0    umbrello/uml1model/umlrole.cpp
M  +2    -0    umbrello/uml1model/umlrole.h

https://commits.kde.org/umbrello/907a5b8b7fa73624eee2fe257c0b0ce58f3a9c4b
Comment 3 Ralf Habacker 2019-11-12 23:28:33 UTC
Git commit e881a97729831e114266f0033a388e3f59fd4e76 by Ralf Habacker.
Committed on 12/11/2019 at 23:28.
Pushed by habacker into branch 'release/19.12'.

Add unit tests for associations

Comparing UMLAssociations does not work yet and test_toString() crashes.

M  +7    -0    unittests/CMakeLists.txt
A  +205  -0    unittests/testassociation.cpp     [License: GPL (v2/3)]
A  +43   -0    unittests/testassociation.h     [License: GPL (v2/3)]

https://commits.kde.org/umbrello/e881a97729831e114266f0033a388e3f59fd4e76
Comment 4 Ralf Habacker 2019-11-14 20:56:15 UTC
Git commit 5891beb1a217b564df34907ebd581041d9af64a1 by Ralf Habacker.
Committed on 14/11/2019 at 20:59.
Pushed by habacker into branch 'release/19.12'.

Add xmi load and save test for class UMLAssociation

In initTestCase() we set loading state for all test cases, which is
required to prevent signaling.

Because operator== is still unfunctional, the load and save test
simply compares xml strings.

M  +67   -0    unittests/testassociation.cpp
M  +15   -0    unittests/testassociation.h
M  +12   -0    unittests/testbase.cpp
M  +45   -0    unittests/testbase.h

https://commits.kde.org/umbrello/5891beb1a217b564df34907ebd581041d9af64a1
Comment 5 Ralf Habacker 2019-11-14 23:41:25 UTC
Git commit 017d8249db30177a830f3f5b94d3ceaf2b838d9e by Ralf Habacker.
Committed on 14/11/2019 at 23:40.
Pushed by habacker into branch 'release/19.12'.

Refactor base class for testing load/save support to be a template

M  +4    -43   unittests/testassociation.cpp
M  +52   -1    unittests/testbase.h

https://commits.kde.org/umbrello/017d8249db30177a830f3f5b94d3ceaf2b838d9e
Comment 6 Ralf Habacker 2019-11-16 00:11:40 UTC
Git commit 72be4c70f11598cd2c6460c3e382642fcc6a547e by Ralf Habacker.
Committed on 16/11/2019 at 00:03.
Pushed by habacker into branch 'release/19.12'.

Let UMLObject unit test case uses TestUML template too

M  +7    -0    unittests/testbase.h
M  +2    -14   unittests/testumlobject.cpp

https://commits.kde.org/umbrello/72be4c70f11598cd2c6460c3e382642fcc6a547e