Skip to content

Commit 8d974c4

Browse files
Merge pull request #254 from moosetechnology/atribute-getFAST
FamixAttribute >> getFAST
2 parents 6cbc7da + 66e334b commit 8d974c4

File tree

130 files changed

+409
-265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+409
-265
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Class {
2+
#name : 'FamixJavaAttributeGetFASTTest',
3+
#superclass : 'TestCase',
4+
#instVars : [
5+
'fast'
6+
],
7+
#category : 'FAST-Java-SmaCC-Importer-Tests',
8+
#package : 'FAST-Java-SmaCC-Importer-Tests'
9+
}
10+
11+
{ #category : 'running' }
12+
FamixJavaAttributeGetFASTTest >> setUp [
13+
14+
| attribute |
15+
attribute := FamixJavaAttribute new.
16+
attribute sourceAnchor: (FamixJavaSourceTextAnchor new source: 'THIS_ATTRIBUTE = "a value"').
17+
18+
fast := attribute getFAST.
19+
20+
]
21+
22+
{ #category : 'tests' }
23+
FamixJavaAttributeGetFASTTest >> testASTLHSIsAVariable [
24+
25+
self assert: fast variable class equals: FASTJavaVariableExpression
26+
]
27+
28+
{ #category : 'tests' }
29+
FamixJavaAttributeGetFASTTest >> testASTLHSNameIsAVariable [
30+
31+
self assert: fast variable name equals: 'THIS_ATTRIBUTE'
32+
]
33+
34+
{ #category : 'tests' }
35+
FamixJavaAttributeGetFASTTest >> testASTRHSIsString [
36+
37+
self assert: fast expression class equals: FASTJavaStringLiteral
38+
]
39+
40+
{ #category : 'tests' }
41+
FamixJavaAttributeGetFASTTest >> testASTRHSValueIsA_value [
42+
43+
self assert: fast expression primitiveValue equals: 'a value'
44+
]
45+
46+
{ #category : 'tests' }
47+
FamixJavaAttributeGetFASTTest >> testFASTRootIsExpression [
48+
49+
self assert: fast class equals: FASTJavaAssignmentExpression
50+
]

src/FAST-Java-SmaCC-Importer-Tests/JavaSmaCC2BlockCommentsTest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Class {
22
#name : 'JavaSmaCC2BlockCommentsTest',
3-
#superclass : 'JavaSmaCCCommentsTest',
3+
#superclass : 'JavaSmaCCCommentsAbstractTest',
44
#category : 'FAST-Java-SmaCC-Importer-Tests',
55
#package : 'FAST-Java-SmaCC-Importer-Tests'
66
}

src/FAST-Java-SmaCC-Importer-Tests/JavaSmaCCCAbstractMethodTest.class.st renamed to src/FAST-Java-SmaCC-Importer-Tests/JavaSmaCCAbstractMethodTest.class.st

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
Class {
2-
#name : 'JavaSmaCCCAbstractMethodTest',
3-
#superclass : 'JavaSmaCCImporterTest',
2+
#name : 'JavaSmaCCAbstractMethodTest',
3+
#superclass : 'JavaSmaCCImporterAbstractTest',
44
#category : 'FAST-Java-SmaCC-Importer-Tests',
55
#package : 'FAST-Java-SmaCC-Importer-Tests'
66
}
77

88
{ #category : 'resources' }
9-
JavaSmaCCCAbstractMethodTest >> abstractMethod [
9+
JavaSmaCCAbstractMethodTest >> abstractMethod [
1010
^ 'public interface AnInterface {
1111
void anAbstractMethod(Map<String, Serializable> mapObjects, Map<String, Serializable> mapIds);
1212
}'
1313
]
1414

1515
{ #category : 'accessing' }
16-
JavaSmaCCCAbstractMethodTest >> javaMethod [
16+
JavaSmaCCAbstractMethodTest >> javaMethod [
1717
^ self shouldBeImplemented
1818
]
1919

2020
{ #category : 'running' }
21-
JavaSmaCCCAbstractMethodTest >> setUp [
21+
JavaSmaCCAbstractMethodTest >> parseExpressionString: aString [
22+
23+
^ JavaSmaCCProgramNodeImporterVisitor new getExpressionAST: aString
24+
]
25+
26+
{ #category : 'running' }
27+
JavaSmaCCAbstractMethodTest >> setUp [
2228

2329
fastModel := (self parseClassString: self abstractMethod)
2430
allFASTJavaMethodEntity first
2531
]
2632

2733
{ #category : 'resources' }
28-
JavaSmaCCCAbstractMethodTest >> testAbstractMethodName [
34+
JavaSmaCCAbstractMethodTest >> testAbstractMethodName [
2935

3036
self assert: fastModel name equals: #anAbstractMethod
3137
]

src/FAST-Java-SmaCC-Importer-Tests/JavaSmaCCAnnotation.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Class {
22
#name : 'JavaSmaCCAnnotation',
3-
#superclass : 'JavaSmaCCImporterTest',
3+
#superclass : 'JavaSmaCCMethodImporterAbstractTest',
44
#category : 'FAST-Java-SmaCC-Importer-Tests',
55
#package : 'FAST-Java-SmaCC-Importer-Tests'
66
}

src/FAST-Java-SmaCC-Importer-Tests/JavaSmaCCAnnotationWithArrayElementTest.class.st

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
Class {
22
#name : 'JavaSmaCCAnnotationWithArrayElementTest',
3-
#superclass : 'JavaSmaCCImporterTest',
4-
#instVars : [
5-
'methodNewArray'
6-
],
3+
#superclass : 'JavaSmaCCMethodImporterAbstractTest',
74
#category : 'FAST-Java-SmaCC-Importer-Tests',
85
#package : 'FAST-Java-SmaCC-Importer-Tests'
96
}

src/FAST-Java-SmaCC-Importer-Tests/JavaSmaCCAnnotationWithInfixElementTest.class.st

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
Class {
22
#name : 'JavaSmaCCAnnotationWithInfixElementTest',
3-
#superclass : 'JavaSmaCCImporterTest',
4-
#instVars : [
5-
'methodNewArray'
6-
],
3+
#superclass : 'JavaSmaCCMethodImporterAbstractTest',
74
#category : 'FAST-Java-SmaCC-Importer-Tests',
85
#package : 'FAST-Java-SmaCC-Importer-Tests'
96
}

src/FAST-Java-SmaCC-Importer-Tests/JavaSmaCCAnnotationWithNamedElements.class.st

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Class {
22
#name : 'JavaSmaCCAnnotationWithNamedElements',
3-
#superclass : 'JavaSmaCCImporterTest',
3+
#superclass : 'JavaSmaCCClassImporterAbstractTest',
44
#category : 'FAST-Java-SmaCC-Importer-Tests',
55
#package : 'FAST-Java-SmaCC-Importer-Tests'
66
}
@@ -19,12 +19,6 @@ JavaSmaCCAnnotationWithNamedElements >> javaMethod [
1919
^self shouldNotImplement
2020
]
2121

22-
{ #category : 'running' }
23-
JavaSmaCCAnnotationWithNamedElements >> setUp [
24-
25-
fastModel := self parseClassString: self javaClass
26-
]
27-
2822
{ #category : 'tests' }
2923
JavaSmaCCAnnotationWithNamedElements >> testAnnotatedEntity [
3024
self

src/FAST-Java-SmaCC-Importer-Tests/JavaSmaCCAnnotationWithSpecialElementsTest.class.st

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
Class {
22
#name : 'JavaSmaCCAnnotationWithSpecialElementsTest',
3-
#superclass : 'JavaSmaCCImporterTest',
4-
#instVars : [
5-
'methodNewArray'
6-
],
3+
#superclass : 'JavaSmaCCMethodImporterAbstractTest',
74
#category : 'FAST-Java-SmaCC-Importer-Tests',
85
#package : 'FAST-Java-SmaCC-Importer-Tests'
96
}

src/FAST-Java-SmaCC-Importer-Tests/JavaSmaCCAnnotationWithUnnamedElement.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Class {
22
#name : 'JavaSmaCCAnnotationWithUnnamedElement',
3-
#superclass : 'JavaSmaCCImporterTest',
3+
#superclass : 'JavaSmaCCMethodImporterAbstractTest',
44
#category : 'FAST-Java-SmaCC-Importer-Tests',
55
#package : 'FAST-Java-SmaCC-Importer-Tests'
66
}

src/FAST-Java-SmaCC-Importer-Tests/JavaSmaCCArgumentNewClassInMethodTest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Class {
22
#name : 'JavaSmaCCArgumentNewClassInMethodTest',
3-
#superclass : 'JavaSmaCCImporterTest',
3+
#superclass : 'JavaSmaCCMethodImporterAbstractTest',
44
#category : 'FAST-Java-SmaCC-Importer-Tests',
55
#package : 'FAST-Java-SmaCC-Importer-Tests'
66
}

0 commit comments

Comments
 (0)