Skip to content

Commit 13f48e2

Browse files
authored
Merge pull request #113 from xuwei-k/URL-constructor
2 parents fd4b25d + 03458de commit 13f48e2

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

launcher-implementation/src/test/scala/ConfigurationParserTest.scala

+22-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package xsbt.boot
22

3-
import java.net.URL
3+
import java.net.URI
44

55
object ConfigurationParserTest extends verify.BasicTestSuite {
66
test("Configuration parser should correct parse bootOnly") {
@@ -19,67 +19,69 @@ object ConfigurationParserTest extends verify.BasicTestSuite {
1919
repoFileContains(
2020
"""|[repositories]
2121
| id: https://repo1.maven.org""".stripMargin,
22-
Repository.Maven("id", new URL("https://repo1.maven.org"), false)
22+
Repository.Maven("id", new URI("https://repo1.maven.org").toURL, false)
2323
)
2424

2525
repoFileContains(
2626
"""|[repositories]
2727
| id: https://repo1.maven.org, bootOnly""".stripMargin,
28-
Repository.Maven("id", new URL("https://repo1.maven.org"), true)
28+
Repository.Maven("id", new URI("https://repo1.maven.org").toURL, true)
2929
)
3030

3131
repoFileContains(
3232
"""|[repositories]
3333
| id: http://repo1.maven.org, bootOnly, allowInsecureProtocol""".stripMargin,
34-
Repository.Maven("id", new URL("http://repo1.maven.org"), true, true)
34+
Repository.Maven("id", new URI("http://repo1.maven.org").toURL, true, true)
3535
)
3636

3737
repoFileContains(
3838
"""|[repositories]
3939
| id: https://repo1.maven.org, [orgPath]""".stripMargin,
4040
Repository
41-
.Ivy("id", new URL("https://repo1.maven.org"), "[orgPath]", "[orgPath]", false, false)
41+
.Ivy("id", new URI("https://repo1.maven.org").toURL, "[orgPath]", "[orgPath]", false, false)
4242
)
4343

4444
repoFileContains(
4545
"""|[repositories]
4646
| id: https://repo1.maven.org, [orgPath], mavenCompatible""".stripMargin,
4747
Repository
48-
.Ivy("id", new URL("https://repo1.maven.org"), "[orgPath]", "[orgPath]", true, false)
48+
.Ivy("id", new URI("https://repo1.maven.org").toURL, "[orgPath]", "[orgPath]", true, false)
4949
)
5050

5151
repoFileContains(
5252
"""|[repositories]
5353
| id: https://repo1.maven.org, [orgPath], mavenCompatible, bootOnly""".stripMargin,
54-
Repository.Ivy("id", new URL("https://repo1.maven.org"), "[orgPath]", "[orgPath]", true, true)
54+
Repository
55+
.Ivy("id", new URI("https://repo1.maven.org").toURL, "[orgPath]", "[orgPath]", true, true)
5556
)
5657

5758
repoFileContains(
5859
"""|[repositories]
5960
| id: https://repo1.maven.org, [orgPath], bootOnly, mavenCompatible""".stripMargin,
60-
Repository.Ivy("id", new URL("https://repo1.maven.org"), "[orgPath]", "[orgPath]", true, true)
61+
Repository
62+
.Ivy("id", new URI("https://repo1.maven.org").toURL, "[orgPath]", "[orgPath]", true, true)
6163
)
6264

6365
repoFileContains(
6466
"""|[repositories]
6567
| id: https://repo1.maven.org, [orgPath], bootOnly""".stripMargin,
6668
Repository
67-
.Ivy("id", new URL("https://repo1.maven.org"), "[orgPath]", "[orgPath]", false, true)
69+
.Ivy("id", new URI("https://repo1.maven.org").toURL, "[orgPath]", "[orgPath]", false, true)
6870
)
6971

7072
repoFileContains(
7173
"""|[repositories]
7274
| id: https://repo1.maven.org, [orgPath], [artPath]""".stripMargin,
7375
Repository
74-
.Ivy("id", new URL("https://repo1.maven.org"), "[orgPath]", "[artPath]", false, false)
76+
.Ivy("id", new URI("https://repo1.maven.org").toURL, "[orgPath]", "[artPath]", false, false)
7577
)
7678

7779
repoFileContains(
7880
"""|[repositories]
7981
| id: https://repo1.maven.org, [orgPath], [artPath], descriptorOptional""".stripMargin,
8082
Repository.Ivy(
8183
"id",
82-
new URL("https://repo1.maven.org"),
84+
new URI("https://repo1.maven.org").toURL,
8385
"[orgPath]",
8486
"[artPath]",
8587
false,
@@ -94,7 +96,7 @@ object ConfigurationParserTest extends verify.BasicTestSuite {
9496
| id: https://repo1.maven.org, [orgPath], [artPath], descriptorOptional, skipConsistencyCheck""".stripMargin,
9597
Repository.Ivy(
9698
"id",
97-
new URL("https://repo1.maven.org"),
99+
new URI("https://repo1.maven.org").toURL,
98100
"[orgPath]",
99101
"[artPath]",
100102
false,
@@ -109,7 +111,7 @@ object ConfigurationParserTest extends verify.BasicTestSuite {
109111
| id: https://repo1.maven.org, [orgPath], [artPath], skipConsistencyCheck, descriptorOptional""".stripMargin,
110112
Repository.Ivy(
111113
"id",
112-
new URL("https://repo1.maven.org"),
114+
new URI("https://repo1.maven.org").toURL,
113115
"[orgPath]",
114116
"[artPath]",
115117
false,
@@ -124,7 +126,7 @@ object ConfigurationParserTest extends verify.BasicTestSuite {
124126
| id: https://repo1.maven.org, [orgPath], [artPath], skipConsistencyCheck, descriptorOptional, mavenCompatible, bootOnly""".stripMargin,
125127
Repository.Ivy(
126128
"id",
127-
new URL("https://repo1.maven.org"),
129+
new URI("https://repo1.maven.org").toURL,
128130
"[orgPath]",
129131
"[artPath]",
130132
true,
@@ -138,27 +140,29 @@ object ConfigurationParserTest extends verify.BasicTestSuite {
138140
"""|[repositories]
139141
| id: https://repo1.maven.org, [orgPath], [artPath], bootOnly""".stripMargin,
140142
Repository
141-
.Ivy("id", new URL("https://repo1.maven.org"), "[orgPath]", "[artPath]", false, true)
143+
.Ivy("id", new URI("https://repo1.maven.org").toURL, "[orgPath]", "[artPath]", false, true)
142144
)
143145

144146
repoFileContains(
145147
"""|[repositories]
146148
| id: https://repo1.maven.org, [orgPath], [artPath], bootOnly, mavenCompatible""".stripMargin,
147-
Repository.Ivy("id", new URL("https://repo1.maven.org"), "[orgPath]", "[artPath]", true, true)
149+
Repository
150+
.Ivy("id", new URI("https://repo1.maven.org").toURL, "[orgPath]", "[artPath]", true, true)
148151
)
149152

150153
repoFileContains(
151154
"""|[repositories]
152155
| id: https://repo1.maven.org, [orgPath], [artPath], mavenCompatible, bootOnly""".stripMargin,
153-
Repository.Ivy("id", new URL("https://repo1.maven.org"), "[orgPath]", "[artPath]", true, true)
156+
Repository
157+
.Ivy("id", new URI("https://repo1.maven.org").toURL, "[orgPath]", "[artPath]", true, true)
154158
)
155159

156160
repoFileContains(
157161
"""|[repositories]
158162
| id: http://repo1.maven.org, [orgPath], [artPath], mavenCompatible, bootOnly, allowInsecureProtocol""".stripMargin,
159163
Repository.Ivy(
160164
"id",
161-
new URL("http://repo1.maven.org"),
165+
new URI("http://repo1.maven.org").toURL,
162166
"[orgPath]",
163167
"[artPath]",
164168
mavenCompatible = true,

0 commit comments

Comments
 (0)