Skip to content

Commit

Permalink
add testVisitMethodWithAnnotation
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Jun 3, 2024
1 parent 3b004ca commit 25488cb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Famix2Java-Tests/FAMIX2JavaVisitorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,36 @@ FAMIX2JavaVisitorTest >> testVisitMethodDeclaredTypePrimitiveVoid [
}'
]

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

| method methodClass model resultString annotationType anAnnotationInstance |
model := FamixJavaModel new.

annotationType := model newAnnotationType.
annotationType name: 'override'.
anAnnotationInstance := model newAnnotationInstance.
anAnnotationInstance annotationType: annotationType.

method := FamixJavaMethod new.
method name: 'aMethod'.
method addAnnotationInstance: anAnnotationInstance.


methodClass := FamixJavaClass new.
methodClass addMethod: method.
model addAll: {
method.
methodClass }.
resultString := String streamContents: [ :stream |
visitor currentStream: stream.
method accept: visitor ].
self assert: resultString equals: '@override
aMethod() {
}'
]

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

Expand Down

0 comments on commit 25488cb

Please sign in to comment.