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
4f742512
Commit
4f742512
authored
May 01, 2019
by
Greg Messner
Browse files
Renamed to remove Test from the class name.
parent
75a24c23
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/gitlab4j/api/
Test
Utils.java
→
src/test/java/org/gitlab4j/api/
Helper
Utils.java
View file @
4f742512
...
@@ -4,29 +4,9 @@ import java.io.File;
...
@@ -4,29 +4,9 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.Reader
;
import
java.util.Properties
;
import
java.util.Properties
;
public
class
TestUtils
{
public
class
HelperUtils
{
/**
* Reads the content of a Reader instance and returns it as a String.
*
* @param reader
* @return the content of a Reader instance as a String
* @throws IOException
*/
public
static
String
getReaderContentAsString
(
Reader
reader
)
throws
IOException
{
int
count
;
final
char
[]
buffer
=
new
char
[
2048
];
final
StringBuilder
out
=
new
StringBuilder
();
while
((
count
=
reader
.
read
(
buffer
,
0
,
buffer
.
length
))
>=
0
)
{
out
.
append
(
buffer
,
0
,
count
);
}
return
(
out
.
toString
());
}
private
static
Properties
testProperties
;
private
static
Properties
testProperties
;
static
{
static
{
...
@@ -39,17 +19,23 @@ public class TestUtils {
...
@@ -39,17 +19,23 @@ public class TestUtils {
basedir
=
basedir
.
substring
(
0
,
basedir
.
length
()
-
15
);
basedir
=
basedir
.
substring
(
0
,
basedir
.
length
()
-
15
);
}
}
File
propertiesFile
=
new
File
(
basedir
,
"test-gitlab4j.properties"
);
File
propertiesFile
=
new
File
(
(
String
)
System
.
getProperties
().
get
(
"user.home"
)
,
"test-gitlab4j.properties"
);
if
(!
propertiesFile
.
exists
())
{
if
(!
propertiesFile
.
exists
())
{
propertiesFile
=
new
File
(
(
String
)
System
.
getProperties
().
get
(
"user.home"
),
"
test-gitlab4j.properties"
);
propertiesFile
=
new
File
(
basedir
,
"src/test/gitlab/
test-gitlab4j.properties"
);
}
}
System
.
out
.
println
(
"test-gitlab4j.properties location: "
+
propertiesFile
.
getAbsolutePath
());
if
(
propertiesFile
.
exists
())
{
System
.
out
.
println
(
"test-gitlab4j.properties location: "
+
propertiesFile
.
getAbsolutePath
());
testProperties
=
new
Properties
();
testProperties
=
new
Properties
();
try
(
InputStream
input
=
new
FileInputStream
(
propertiesFile
))
{
try
(
InputStream
input
=
new
FileInputStream
(
propertiesFile
))
{
testProperties
.
load
(
input
);
testProperties
.
load
(
input
);
}
catch
(
IOException
ioe
)
{
}
catch
(
IOException
ioe
)
{
}
}
else
{
System
.
out
.
println
(
"No test-gitlab4j.properties file found"
);
}
}
}
}
...
...
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