@@ -3,6 +3,7 @@ package org.javacs.kt
3
3
import org.hamcrest.Matchers.*
4
4
import org.javacs.kt.classpath.parseMavenArtifact
5
5
import org.javacs.kt.classpath.Artifact
6
+ import org.javacs.kt.classpath.parseMavenSource
6
7
import org.junit.Assert.assertThat
7
8
import org.junit.Test
8
9
@@ -15,34 +16,51 @@ class MavenArtifactParsingTest {
15
16
packaging = " jar" ,
16
17
classifier = " jdk15" ,
17
18
version = " 2.4" ,
18
- scope = " compile"
19
+ scope = " compile" ,
20
+ source = false
19
21
)))
20
-
22
+
21
23
assertThat(parseMavenArtifact(" io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.36.Final:compile" ), equalTo(Artifact (
22
24
group = " io.netty" ,
23
25
artifact = " netty-transport-native-epoll" ,
24
26
packaging = " jar" ,
25
27
classifier = " linux-x86_64" ,
26
28
version = " 4.1.36.Final" ,
27
- scope = " compile"
29
+ scope = " compile" ,
30
+ source = false
28
31
)))
29
-
32
+
30
33
assertThat(parseMavenArtifact(" org.codehaus.mojo:my-project:1.0" ), equalTo(Artifact (
31
34
group = " org.codehaus.mojo" ,
32
35
artifact = " my-project" ,
33
36
packaging = null ,
34
37
classifier = null ,
35
38
version = " 1.0" ,
36
- scope = null
39
+ scope = null ,
40
+ source = false
37
41
)))
38
-
42
+
39
43
assertThat(parseMavenArtifact(" io.vertx:vertx-sql-client:test-jar:tests:3.8.0-SNAPSHOT:compile" ), equalTo(Artifact (
40
44
group = " io.vertx" ,
41
45
artifact = " vertx-sql-client" ,
42
46
packaging = " test-jar" ,
43
47
classifier = " tests" ,
44
48
version = " 3.8.0-SNAPSHOT" ,
45
- scope = " compile"
49
+ scope = " compile" ,
50
+ source = false
51
+ )))
52
+ }
53
+
54
+ @Test
55
+ fun `parse maven sources` () {
56
+ assertThat(parseMavenSource(" org.springframework.boot:spring-boot-starter:jar:sources:2.4.5" ), equalTo(Artifact (
57
+ group = " org.springframework.boot" ,
58
+ artifact = " spring-boot-starter" ,
59
+ packaging = " jar" ,
60
+ classifier = null ,
61
+ version = " 2.4.5" ,
62
+ scope = null ,
63
+ source = true
46
64
)))
47
65
}
48
66
}
0 commit comments