Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
bd0bf8f4
Commit
bd0bf8f4
authored
May 01, 2019
by
Greg Messner
Browse files
Now looks for properties file in home dir first and then project dir (#311).
parent
a62fa83b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/gitlab4j/api/HelperUtils.java
View file @
bd0bf8f4
...
@@ -11,16 +11,17 @@ public class HelperUtils {
...
@@ -11,16 +11,17 @@ public class HelperUtils {
private
static
Properties
testProperties
;
private
static
Properties
testProperties
;
static
{
static
{
// Get the maven basedir, we use it to locate the properties for the unit tests
String
basedir
=
(
String
)
System
.
getProperties
().
get
(
"basedir"
);
// If we are performing a release in target/checkout, trim off the target/checkout directory from basedir
if
(
basedir
!=
null
&&
(
basedir
.
endsWith
(
"target/checkout"
)
||
basedir
.
endsWith
(
"target\\checkout"
)))
{
basedir
=
basedir
.
substring
(
0
,
basedir
.
length
()
-
15
);
}
File
propertiesFile
=
new
File
((
String
)
System
.
getProperties
().
get
(
"user.home"
),
"test-gitlab4j.properties"
);
File
propertiesFile
=
new
File
((
String
)
System
.
getProperties
().
get
(
"user.home"
),
"test-gitlab4j.properties"
);
if
(!
propertiesFile
.
exists
())
{
if
(!
propertiesFile
.
exists
())
{
// Get the maven basedir, we use it to locate the properties for the unit tests
String
basedir
=
(
String
)
System
.
getProperties
().
get
(
"basedir"
);
// If we are performing a release in target/checkout, trim off the target/checkout directory from basedir
if
(
basedir
!=
null
&&
(
basedir
.
endsWith
(
"target/checkout"
)
||
basedir
.
endsWith
(
"target\\checkout"
)))
{
basedir
=
basedir
.
substring
(
0
,
basedir
.
length
()
-
15
);
}
propertiesFile
=
new
File
(
basedir
,
"src/test/gitlab/test-gitlab4j.properties"
);
propertiesFile
=
new
File
(
basedir
,
"src/test/gitlab/test-gitlab4j.properties"
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment