Skip to content

Commit

Permalink
add testExportAnnotationImport
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed May 2, 2024
1 parent 1897f8e commit 60b462a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Famix2Java-Tests/FAMIX2JavaVisitorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,28 @@ FAMIX2JavaVisitorTest >> testDoNotExportPackageStub [
isFile
]

{ #category : #test }
FAMIX2JavaVisitorTest >> testExportAnnotationImport [

| model resultString aClass annotationType anAnnotationInstance package |
model := FamixJavaModel new.
aClass := model newClassNamed: 'DemoClass'.
annotationType := model newAnnotationType.
annotationType name: 'AnAnnotation'.
anAnnotationInstance := model newAnnotationInstance.
anAnnotationInstance annotationType: annotationType.
aClass addAnnotationInstance: anAnnotationInstance.
package := model newPackageNamed: 'fr'.
annotationType typeContainer: package.


resultString := String streamContents: [ :stream |
visitor currentStream: stream.
visitor printImports: aClass ].
self assert: resultString equals: 'import fr.AnAnnotation;
'
]

{ #category : #test }
FAMIX2JavaVisitorTest >> testExportOnePackageWithMultipleClasses [

Expand Down

0 comments on commit 60b462a

Please sign in to comment.