• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / Famix-UnitTest / 15590759202

11 Jun 2025 04:47PM UTC coverage: 27.322% (-4.2%) from 31.536%
15590759202

push

github

Gabriel-Darbord
Complete mappings
And finally fix tests!?

64 of 199 new or added lines in 10 files covered. (32.16%)

614 existing lines in 23 files now uncovered.

603 of 2207 relevant lines covered (27.32%)

0.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Famix-UnitTest-Exporter/FamixUTAssertJJavaAssertionStrategy.class.st
1
Class {
2
        #name : 'FamixUTAssertJJavaAssertionStrategy',
3
        #superclass : 'FamixUTAbstractJavaAssertionStrategy',
4
        #instVars : [
5
                'ignoringFieldsOfTypes',
6
                'usingRecursiveComparison',
7
                'ignoringCollectionOrder'
8
        ],
9
        #category : 'Famix-UnitTest-Exporter-Strategies',
10
        #package : 'Famix-UnitTest-Exporter',
11
        #tag : 'Strategies'
12
}
13

14
{ #category : 'ast' }
15
FamixUTAssertJJavaAssertionStrategy >> dependencyImportsOn: aFamixUTExporter [
×
16

×
17
        | model |
×
18
        model := aFamixUTExporter model.
×
19
        ^ { (model newImportDeclaration
×
20
                   qualifiedName: (model newQualifiedName name:
×
21
                                            'org.assertj.core.api.Assertions.assertThat');
×
UNCOV
22
                   isStatic: true) }
×
UNCOV
23
]
×
24

25
{ #category : 'exporting' }
26
FamixUTAssertJJavaAssertionStrategy >> export: aFamixUTAssertion on: exporter [
×
27
        "Make an assertion using AssertJ: assertThat(actual).{options}.isEqualTo(expected)"
×
28

×
29
        | model expected assertion |
×
30
        model := exporter model.
×
31
        expected := aFamixUTAssertion expected.
×
32
        assertion := model newMethodInvocation
×
33
                             addArgument:
×
34
                                     (model newVariableExpression name: 'actual');
×
35
                             name: 'assertThat'.
×
36

×
37
        (self usingRecursiveComparison and: [
×
38
                 expected isOfObject or: [
×
39
                         expected isOfCollection or: [ expected isOfDictionary ] ] ])
×
40
                ifTrue: [
×
41
                        assertion := model newMethodInvocation
×
42
                                             receiver: assertion;
×
43
                                             name: 'usingRecursiveComparison'.
×
44
                        (self ignoringCollectionOrder and: [ expected containsCollection ])
×
45
                                ifTrue: [
×
46
                                        assertion := model newMethodInvocation
×
47
                                                             receiver: assertion;
×
48
                                                             name: 'ignoringCollectionOrder' ].
×
49
                        (self ignoringFieldsOfTypes isNotEmpty and: [
×
50
                                 expected containsObject ]) ifTrue: [
×
51
                                assertion := model newMethodInvocation
×
52
                                                     receiver: assertion;
×
53
                                                     name: 'ignoringFieldsOfTypes';
×
54
                                                     arguments:
×
55
                                                             (ignoringFieldsOfTypes collect: [ :typeName |
×
56
                                                                              model newClassProperty
×
57
                                                                                      type: (model newIdentifier name: typeName);
×
58
                                                                                      fieldName: 'class' ]) ] ].
×
59

×
60
        assertion := model newMethodInvocation
×
61
                             receiver: assertion;
×
UNCOV
62
                             addArgument:
×
UNCOV
63
                                     (exporter valueExporter makeVariableExpression:
×
64
                                                      expected);
×
65
                             name: 'isEqualTo'.
×
66
        ^ model newExpressionStatement expression: assertion
×
67
]
×
68

69
{ #category : 'accessing' }
70
FamixUTAssertJJavaAssertionStrategy >> ignoringCollectionOrder [
×
71

×
72
        ^ ignoringCollectionOrder ifNil: [ ignoringCollectionOrder := false ]
×
73
]
×
74

75
{ #category : 'accessing' }
76
FamixUTAssertJJavaAssertionStrategy >> ignoringCollectionOrder: aBoolean [
×
77

×
78
        ignoringCollectionOrder := aBoolean
×
79
]
×
80

81
{ #category : 'accessing' }
82
FamixUTAssertJJavaAssertionStrategy >> ignoringFieldsOfTypes [
×
83

×
84
        ^ ignoringFieldsOfTypes ifNil: [ ignoringFieldsOfTypes := {  } ]
×
85
]
×
86

87
{ #category : 'accessing' }
88
FamixUTAssertJJavaAssertionStrategy >> ignoringFieldsOfTypes: aCollection [
×
89

×
90
        ignoringFieldsOfTypes := aCollection
×
91
]
×
92

93
{ #category : 'accessing' }
UNCOV
94
FamixUTAssertJJavaAssertionStrategy >> usingRecursiveComparison [
×
95

×
96
        ^ usingRecursiveComparison ifNil: [
×
97
                  usingRecursiveComparison := false ]
×
98
]
×
99

100
{ #category : 'accessing' }
UNCOV
101
FamixUTAssertJJavaAssertionStrategy >> usingRecursiveComparison: aBoolean [
×
UNCOV
102

×
UNCOV
103
        usingRecursiveComparison := aBoolean
×
UNCOV
104
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc