Skip to content

Commit

Permalink
Major Java update
Browse files Browse the repository at this point in the history
Model:
- change relation of testedClass from being with TClass to TType
- mooseName for ActArgument

Importer:
- from OpenTelemetry: skip spans that were previously skipped when importing values
- order fixtures: receiver, arguments, expected

Exporter:
- handle receiver fixture
- dispatch part of helper naming to value with `roleName`
- fix JUnit 5
- ensure valid package names
- work around VerveineJ problems by adding nil checks where they should normally never occur
  • Loading branch information
Gabriel-Darbord committed Oct 28, 2024
1 parent dd4def3 commit 0294066
Show file tree
Hide file tree
Showing 38 changed files with 426 additions and 278 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FamixUTAct }
Extension { #name : 'FamixUTAct' }

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTAct >> mooseNameOn: aStream [

aStream nextPutAll: 'Act'.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Extension { #name : 'FamixUTActArgument' }

{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTActArgument >> mooseNameOn: aStream [

aStream nextPutAll: 'Argument'.
self value ifNotNil: [ :value |
aStream nextPut: $(.
value mooseNameOn: aStream.
aStream nextPut: $) ].
act ifNotNil: [
aStream nextPutAll: ' of '.
act mooseNameOn: aStream ]
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FamixUTAssertion }
Extension { #name : 'FamixUTAssertion' }

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTAssertion >> mooseNameOn: aStream [

aStream nextPutAll: 'Assertion'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Extension { #name : #FamixUTCase }
Extension { #name : 'FamixUTCase' }

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTCase >> mooseNameOn: aStream [

aStream nextPutAll: self name
]

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTCase >> name [

^ self testedClass name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FamixUTEntity }
Extension { #name : 'FamixUTEntity' }

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTEntity >> mooseNameOn: aStream [

self subclassResponsibility
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Extension { #name : #FamixUTFixture }
Extension { #name : 'FamixUTFixture' }

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTFixture >> forAllInCase [

self subclassResponsibility
]

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTFixture >> forEachInCase [

self subclassResponsibility
]

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTFixture >> method [

self subclassResponsibility
]

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTFixture >> mooseNameOn: aStream [

self suite ifNotNil: [ :suite |
Expand All @@ -35,7 +35,7 @@ FamixUTFixture >> mooseNameOn: aStream [
method mooseNameOn: aStream ]
]

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTFixture >> suite [

self subclassResponsibility
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FamixUTMethod }
Extension { #name : 'FamixUTMethod' }

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTMethod >> name [

^ name ifNil: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FamixUTSetUp }
Extension { #name : 'FamixUTSetUp' }

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTSetUp >> mooseNameOn: aStream [

aStream nextPutAll: 'SetUp'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FamixUTSuite }
Extension { #name : 'FamixUTSuite' }

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTSuite >> mooseNameOn: aStream [


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FamixUTTearDown }
Extension { #name : 'FamixUTTearDown' }

{ #category : #'*Famix-UnitTest-Entities-Extensions' }
{ #category : '*Famix-UnitTest-Entities-Extensions' }
FamixUTTearDown >> mooseNameOn: aStream [

aStream nextPutAll: 'TearDown'.
Expand Down
2 changes: 1 addition & 1 deletion src/Famix-UnitTest-Entities-Extensions/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'Famix-UnitTest-Entities-Extensions' }
Package { #name : 'Famix-UnitTest-Entities-Extensions' }
6 changes: 3 additions & 3 deletions src/Famix-UnitTest-Entities/FamixTMethod.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FamixTMethod }
Extension { #name : 'FamixTMethod' }

{ #category : #'*Famix-UnitTest-Entities-accessing' }
{ #category : '*Famix-UnitTest-Entities-accessing' }
FamixTMethod >> unitTests [
"Relation named: #unitTests type: #FamixUTMethod opposite: #testedMethod"

Expand All @@ -11,7 +11,7 @@ FamixTMethod >> unitTests [
^ self attributeAt: #unitTests ifAbsentPut: [ FMMultivalueLink on: self opposite: #testedMethod: ]
]

{ #category : #'*Famix-UnitTest-Entities-accessing' }
{ #category : '*Famix-UnitTest-Entities-accessing' }
FamixTMethod >> unitTests: anObject [

<generated>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Extension { #name : #FamixTClass }
Extension { #name : 'FamixTType' }

{ #category : #'*Famix-UnitTest-Entities-accessing' }
FamixTClass >> testCase [
{ #category : '*Famix-UnitTest-Entities-accessing' }
FamixTType >> testCase [
"Relation named: #testCase type: #FamixUTCase opposite: #testedClass"

<generated>
Expand All @@ -11,8 +11,8 @@ FamixTClass >> testCase [
^ self attributeAt: #testCase ifAbsent: [ nil ]
]

{ #category : #'*Famix-UnitTest-Entities-accessing' }
FamixTClass >> testCase: anObject [
{ #category : '*Famix-UnitTest-Entities-accessing' }
FamixTType >> testCase: anObject [

<generated>
(self attributeAt: #testCase ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ].
Expand Down
26 changes: 14 additions & 12 deletions src/Famix-UnitTest-Entities/FamixUTAct.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ Execution of the system under test.
"
Class {
#name : #FamixUTAct,
#superclass : #FamixUTEntity,
#name : 'FamixUTAct',
#superclass : 'FamixUTEntity',
#instVars : [
'#arguments => FMMany type: #FamixUTActArgument opposite: #act',
'#method => FMOne type: #FamixUTMethod opposite: #act'
],
#category : #'Famix-UnitTest-Entities-Entities'
#category : 'Famix-UnitTest-Entities-Entities',
#package : 'Famix-UnitTest-Entities',
#tag : 'Entities'
}

{ #category : #meta }
{ #category : 'meta' }
FamixUTAct class >> annotation [

<FMClass: #Act super: #FamixUTEntity>
Expand All @@ -37,13 +39,13 @@ FamixUTAct class >> annotation [
^ self
]

{ #category : #adding }
{ #category : 'adding' }
FamixUTAct >> addArgument: anObject [
<generated>
^ self arguments add: anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
FamixUTAct >> arguments [
"Relation named: #arguments type: #FamixUTActArgument opposite: #act"

Expand All @@ -52,14 +54,14 @@ FamixUTAct >> arguments [
^ arguments
]

{ #category : #accessing }
{ #category : 'accessing' }
FamixUTAct >> arguments: anObject [

<generated>
arguments value: anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
FamixUTAct >> method [
"Relation named: #method type: #FamixUTMethod opposite: #act"

Expand All @@ -69,21 +71,21 @@ FamixUTAct >> method [
^ method
]

{ #category : #accessing }
{ #category : 'accessing' }
FamixUTAct >> method: anObject [

<generated>
method := anObject
]

{ #category : #navigation }
{ #category : 'navigation' }
FamixUTAct >> methodGroup [
<generated>
<navigation: 'Method'>
^ MooseSpecializedGroup with: self method
]

{ #category : #accessing }
{ #category : 'accessing' }
FamixUTAct >> receiver [
"Relation named: #receiver type: #FamixValueOfType opposite: #receiverInAct"

Expand All @@ -92,7 +94,7 @@ FamixUTAct >> receiver [
^ self attributeAt: #receiver ifAbsent: [ nil ]
]

{ #category : #accessing }
{ #category : 'accessing' }
FamixUTAct >> receiver: anObject [

<generated>
Expand Down
18 changes: 10 additions & 8 deletions src/Famix-UnitTest-Entities/FamixUTActArgument.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ An association between an `Act` and a `Value` argument.
"
Class {
#name : #FamixUTActArgument,
#superclass : #FamixUTEntity,
#name : 'FamixUTActArgument',
#superclass : 'FamixUTEntity',
#instVars : [
'#act => FMOne type: #FamixUTAct opposite: #arguments'
],
#category : #'Famix-UnitTest-Entities-Entities'
#category : 'Famix-UnitTest-Entities-Entities',
#package : 'Famix-UnitTest-Entities',
#tag : 'Entities'
}

{ #category : #meta }
{ #category : 'meta' }
FamixUTActArgument class >> annotation [

<FMClass: #ActArgument super: #FamixUTEntity>
Expand All @@ -31,22 +33,22 @@ FamixUTActArgument class >> annotation [
^ self
]

{ #category : #accessing }
{ #category : 'accessing' }
FamixUTActArgument >> act [
"Relation named: #act type: #FamixUTAct opposite: #arguments"

<generated>
^ act
]

{ #category : #accessing }
{ #category : 'accessing' }
FamixUTActArgument >> act: anObject [

<generated>
act := anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
FamixUTActArgument >> value [
"Relation named: #value type: #FamixValueOfType opposite: #argumentInActs"

Expand All @@ -55,7 +57,7 @@ FamixUTActArgument >> value [
^ self attributeAt: #value ifAbsent: [ nil ]
]

{ #category : #accessing }
{ #category : 'accessing' }
FamixUTActArgument >> value: anObject [

<generated>
Expand Down
Loading

0 comments on commit 0294066

Please sign in to comment.