Skip to content

Commit

Permalink
JunitExporter: more imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Darbord committed May 17, 2024
1 parent b7aa627 commit b21359e
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/Famix-UnitTest-Exporter/FamixUTJUnitExporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,24 @@ FamixUTJUnitExporter >> exportCaseCompilationUnit: aFamixUTCase [
FamixUTJUnitExporter >> exportCaseImports: aFamixUTCase [

| imports |
imports := valueExporter builder makeImportDeclarations: aFamixUTCase.
imports add:
(valueExporter builder makeImportDeclaration:
aFamixUTCase testedClass).
imports addAll: self makeJUnitImports.
imports addAll: (self assertionStrategy dependencyImportsOn: self).
(imports := valueExporter builder makeImportDeclarations:
aFamixUTCase)
add:
(valueExporter builder makeImportDeclaration:
aFamixUTCase testedClass);
addAll: self makeJUnitImports;
addAll: (self assertionStrategy dependencyImportsOn: self);
addAll: (self methodSetUpStrategy dependencyImportsOn: self).

caseSuperclass ifNotNil: [ "import configured superclass"
imports add:
(valueExporter builder makeImportDeclaration: caseSuperclass) ].

self flag: #TODO. "exportCaseImports: after exportCase: then add the autowired check"
"self currentClassHasAutowiredProperty ifTrue: ["
imports add: (model newImportDeclaration qualifiedName:
(model newQualifiedName name:
'org.springframework.beans.factory.annotation.Autowired')) "]".
^ imports
]

Expand Down

0 comments on commit b21359e

Please sign in to comment.