@@ -41,7 +41,7 @@ class ArtifactQualifiedNameTest {
41
41
42
42
ArtifactQualifiedName (
43
43
identifier = " C:/test/main.js:executeDemos()" ,
44
- type = METHOD
44
+ type = FUNCTION
45
45
).let {
46
46
val fileParent = it.asParent()
47
47
assertNotNull(fileParent)
@@ -58,15 +58,15 @@ class ArtifactQualifiedNameTest {
58
58
identifier = " C:/test/main.js:executeDemos()#SlNDYWxsRXhwcmVzc2lvbg==" ,
59
59
type = EXPRESSION
60
60
).let {
61
- val methodParent = it.asParent()
62
- assertNotNull(methodParent )
61
+ val functionParent = it.asParent()
62
+ assertNotNull(functionParent )
63
63
assertEquals(
64
64
" C:/test/main.js:executeDemos()" ,
65
- methodParent !! .identifier
65
+ functionParent !! .identifier
66
66
)
67
- assertEquals(methodParent .type, METHOD )
67
+ assertEquals(functionParent .type, FUNCTION )
68
68
69
- val fileParent = methodParent .asParent()
69
+ val fileParent = functionParent .asParent()
70
70
assertNotNull(fileParent)
71
71
assertEquals(
72
72
" C:/test/main.js" ,
@@ -79,17 +79,17 @@ class ArtifactQualifiedNameTest {
79
79
80
80
ArtifactQualifiedName (
81
81
identifier = " C:/test/main.js:TestClass.executeDemos()" ,
82
- type = METHOD
82
+ type = FUNCTION
83
83
).let {
84
- val methodParent = it.asParent()
85
- assertNotNull(methodParent )
84
+ val functionParent = it.asParent()
85
+ assertNotNull(functionParent )
86
86
assertEquals(
87
87
" C:/test/main.js:TestClass" ,
88
- methodParent !! .identifier
88
+ functionParent !! .identifier
89
89
)
90
- assertEquals(methodParent .type, CLASS )
90
+ assertEquals(functionParent .type, CLASS )
91
91
92
- val classParent = methodParent .asParent()
92
+ val classParent = functionParent .asParent()
93
93
assertNotNull(classParent)
94
94
assertEquals(
95
95
" C:/test/main.js" ,
@@ -110,17 +110,17 @@ class ArtifactQualifiedNameTest {
110
110
" C:/test/main.js:TestClass.executeDemos()" ,
111
111
expressionParent!! .identifier
112
112
)
113
- assertEquals(expressionParent.type, METHOD )
113
+ assertEquals(expressionParent.type, FUNCTION )
114
114
115
- val methodParent = expressionParent.asParent()
116
- assertNotNull(methodParent )
115
+ val functionParent = expressionParent.asParent()
116
+ assertNotNull(functionParent )
117
117
assertEquals(
118
118
" C:/test/main.js:TestClass" ,
119
- methodParent !! .identifier
119
+ functionParent !! .identifier
120
120
)
121
- assertEquals(methodParent .type, CLASS )
121
+ assertEquals(functionParent .type, CLASS )
122
122
123
- val classParent = methodParent .asParent()
123
+ val classParent = functionParent .asParent()
124
124
assertNotNull(classParent)
125
125
assertEquals(
126
126
" C:/test/main.js" ,
@@ -134,13 +134,13 @@ class ArtifactQualifiedNameTest {
134
134
135
135
@Test
136
136
fun `test parent qualified name` () {
137
- val methodExpression = ArtifactQualifiedName (" com.example.TestClass.fun()#22" , type = EXPRESSION )
138
- val method = methodExpression .asParent()
139
- assertNotNull(method )
140
- assertEquals(" com.example.TestClass.fun()" , method !! .identifier)
141
- assertEquals(METHOD , method .type)
137
+ val functionExpression = ArtifactQualifiedName (" com.example.TestClass.fun()#22" , type = EXPRESSION )
138
+ val function = functionExpression .asParent()
139
+ assertNotNull(function )
140
+ assertEquals(" com.example.TestClass.fun()" , function !! .identifier)
141
+ assertEquals(FUNCTION , function .type)
142
142
143
- val clazz = method .asParent()
143
+ val clazz = function .asParent()
144
144
assertNotNull(clazz)
145
145
assertEquals(" com.example.TestClass" , clazz!! .identifier)
146
146
assertEquals(CLASS , clazz.type)
@@ -154,16 +154,16 @@ class ArtifactQualifiedNameTest {
154
154
155
155
@Test
156
156
fun `test parent qualified name with args` () {
157
- val methodExpression = ArtifactQualifiedName (
157
+ val functionExpression = ArtifactQualifiedName (
158
158
" com.example.TestClass.fun(java.lang.String)#22" ,
159
159
type = EXPRESSION
160
160
)
161
- val method = methodExpression .asParent()
162
- assertNotNull(method )
163
- assertEquals(" com.example.TestClass.fun(java.lang.String)" , method !! .identifier)
164
- assertEquals(METHOD , method .type)
161
+ val function = functionExpression .asParent()
162
+ assertNotNull(function )
163
+ assertEquals(" com.example.TestClass.fun(java.lang.String)" , function !! .identifier)
164
+ assertEquals(FUNCTION , function .type)
165
165
166
- val clazz = method .asParent()
166
+ val clazz = function .asParent()
167
167
assertNotNull(clazz)
168
168
assertEquals(" com.example.TestClass" , clazz!! .identifier)
169
169
assertEquals(CLASS , clazz.type)
@@ -172,37 +172,37 @@ class ArtifactQualifiedNameTest {
172
172
@Test
173
173
fun `test is child of` () {
174
174
val clazz = ArtifactQualifiedName (" com.example.TestClass" , type = CLASS )
175
- val method = ArtifactQualifiedName (" com.example.TestClass.fun()" , type = METHOD )
176
- val methodExpression = ArtifactQualifiedName (" com.example.TestClass.fun()#22" , type = EXPRESSION )
175
+ val function = ArtifactQualifiedName (" com.example.TestClass.fun()" , type = FUNCTION )
176
+ val functionExpression = ArtifactQualifiedName (" com.example.TestClass.fun()#22" , type = EXPRESSION )
177
177
178
- assertTrue(methodExpression .isChildOf(clazz))
179
- assertTrue(methodExpression .isChildOf(method ))
180
- assertFalse(methodExpression .isChildOf(methodExpression ))
178
+ assertTrue(functionExpression .isChildOf(clazz))
179
+ assertTrue(functionExpression .isChildOf(function ))
180
+ assertFalse(functionExpression .isChildOf(functionExpression ))
181
181
182
- assertTrue(method .isChildOf(clazz))
183
- assertFalse(method .isChildOf(method ))
182
+ assertTrue(function .isChildOf(clazz))
183
+ assertFalse(function .isChildOf(function ))
184
184
185
185
assertFalse(clazz.isChildOf(clazz))
186
- assertFalse(clazz.isChildOf(method ))
187
- assertFalse(method .isChildOf(methodExpression ))
186
+ assertFalse(clazz.isChildOf(function ))
187
+ assertFalse(function .isChildOf(functionExpression ))
188
188
}
189
189
190
190
@Test
191
191
fun `test is parent of` () {
192
192
val clazz = ArtifactQualifiedName (" com.example.TestClass" , type = CLASS )
193
- val method = ArtifactQualifiedName (" com.example.TestClass.fun()" , type = METHOD )
194
- val methodExpression = ArtifactQualifiedName (" com.example.TestClass.fun()#22" , type = EXPRESSION )
193
+ val function = ArtifactQualifiedName (" com.example.TestClass.fun()" , type = FUNCTION )
194
+ val functionExpression = ArtifactQualifiedName (" com.example.TestClass.fun()#22" , type = EXPRESSION )
195
195
196
- assertTrue(clazz.isParentOf(methodExpression ))
197
- assertTrue(method .isParentOf(methodExpression ))
198
- assertFalse(methodExpression .isParentOf(methodExpression ))
196
+ assertTrue(clazz.isParentOf(functionExpression ))
197
+ assertTrue(function .isParentOf(functionExpression ))
198
+ assertFalse(functionExpression .isParentOf(functionExpression ))
199
199
200
- assertTrue(clazz.isParentOf(method ))
201
- assertFalse(method .isParentOf(method ))
200
+ assertTrue(clazz.isParentOf(function ))
201
+ assertFalse(function .isParentOf(function ))
202
202
203
203
assertFalse(clazz.isParentOf(clazz))
204
- assertFalse(method .isParentOf(clazz))
205
- assertFalse(methodExpression .isParentOf(method ))
204
+ assertFalse(function .isParentOf(clazz))
205
+ assertFalse(functionExpression .isParentOf(function ))
206
206
}
207
207
208
208
@Test
@@ -212,8 +212,8 @@ class ArtifactQualifiedNameTest {
212
212
assertNotNull(clazz)
213
213
assertEquals(" com.example.TestClass" , clazz!! .identifier)
214
214
215
- val method = ArtifactQualifiedName (" com.example.TestClass.fun()" , type = METHOD )
216
- val clazz2 = method .toClass()
215
+ val function = ArtifactQualifiedName (" com.example.TestClass.fun()" , type = FUNCTION )
216
+ val clazz2 = function .toClass()
217
217
assertNotNull(clazz2)
218
218
assertEquals(" com.example.TestClass" , clazz2!! .identifier)
219
219
}
@@ -225,8 +225,8 @@ class ArtifactQualifiedNameTest {
225
225
assertNotNull(clazz)
226
226
assertEquals(" com.example.TestClass\$ InnerClass" , clazz!! .identifier)
227
227
228
- val method = ArtifactQualifiedName (" com.example.TestClass\$ InnerClass.fun()" , type = METHOD )
229
- val clazz2 = method .toClass()
228
+ val function = ArtifactQualifiedName (" com.example.TestClass\$ InnerClass.fun()" , type = FUNCTION )
229
+ val clazz2 = function .toClass()
230
230
assertNotNull(clazz2)
231
231
assertEquals(" com.example.TestClass\$ InnerClass" , clazz2!! .identifier)
232
232
}
0 commit comments