Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
osb-kubernetes1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
epro
osb-kubernetes1
Commits
013ec375
Commit
013ec375
authored
4 years ago
by
Nico Eckes
Browse files
Options
Downloads
Patches
Plain Diff
Beautify test output
parent
158dee77
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#933
failed
4 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.gradle.kts
+1
-1
1 addition, 1 deletion
build.gradle.kts
src/test/java/de/thbingen/epro/osbkubernetes/OsbCheckerTest.java
+15
-15
15 additions, 15 deletions
...t/java/de/thbingen/epro/osbkubernetes/OsbCheckerTest.java
with
16 additions
and
16 deletions
build.gradle.kts
+
1
−
1
View file @
013ec375
...
...
@@ -3,6 +3,7 @@ plugins {
id
(
"io.spring.dependency-management"
)
version
"1.0.10.RELEASE"
id
(
"java"
)
id
(
"com.google.osdetector"
)
version
"1.6.2"
id
(
"com.adarshr.test-logger"
)
version
"2.1.1"
}
group
=
"de.thbingen.epro"
...
...
@@ -51,6 +52,5 @@ dependencyManagement {
tasks
.
withType
<
Test
>
{
useJUnitPlatform
()
testLogging
.
showStandardStreams
=
true
systemProperty
(
"spring.profiles.active"
,
System
.
getProperty
(
"profiles"
)
?:
"test"
)
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/test/java/de/thbingen/epro/osbkubernetes/OsbCheckerTest.java
+
15
−
15
View file @
013ec375
...
...
@@ -7,12 +7,8 @@ import org.springframework.boot.web.server.LocalServerPort;
import
java.io.*
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Properties
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
java.util.stream.Collectors
;
@SpringBootTest
(
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
public
class
OsbCheckerTest
{
...
...
@@ -63,16 +59,20 @@ public class OsbCheckerTest {
}
Process
p
=
new
ProcessBuilder
().
directory
(
testDir
.
toFile
()).
command
(
"java"
,
"-jar"
,
checker
.
getFileName
().
toString
(),
'-'
+
type
).
start
();
String
output
=
new
BufferedReader
(
new
InputStreamReader
(
p
.
getInputStream
())).
lines
().
filter
(
s
->
!
s
.
startsWith
(
"\tat"
)).
collect
(
Collectors
.
joining
(
"\n"
));
int
i
=
output
.
indexOf
(
"JVM running for"
);
if
(
i
>=
0
)
output
=
output
.
substring
(
output
.
indexOf
(
'\n'
,
i
));
int
ret
=
p
.
waitFor
();
AtomicBoolean
initTrigger
=
new
AtomicBoolean
(
false
);
List
<
String
>
fullOut
=
new
ArrayList
<>();
new
BufferedReader
(
new
InputStreamReader
(
p
.
getInputStream
())).
lines
().
filter
(
s
->
!
s
.
startsWith
(
"\tat"
)).
filter
(
s
->
{
if
(
s
.
contains
(
"JVM running for"
))
initTrigger
.
set
(
true
);
fullOut
.
add
(
s
)
;
return
initTrigger
.
get
();
}).
forEach
(
System
.
out
::
println
)
;
if
(!
initTrigger
.
get
())
fullOut
.
forEach
(
System
.
out
::
println
);
assertThat
(
p
.
waitFor
()).
isEqualTo
(
0
);
if
(
ret
!=
0
)
{
throw
new
AssertionError
(
"Exit code "
+
ret
+
'\n'
+
output
)
{
@Override
public
String
getLocalizedMessage
()
{
return
null
;
}
}
;
}
else
{
System
.
out
.
println
(
output
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment