Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
HFTSoftwareProject
DTATestRunner
Commits
03286354
Commit
03286354
authored
Nov 06, 2023
by
Lückemeyer
Browse files
fixed test class and package name extraction
parent
a9887f22
Pipeline
#8859
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/hftstuttgart/dta/Testrunner.java
View file @
03286354
...
...
@@ -255,9 +255,13 @@ public class Testrunner
ResultSummary
resultSummary
=
new
ResultSummary
();
resultSummary
.
results
.
addAll
(
successes
.
stream
().
map
(
s
->
{
String
testParent
=
s
.
getParentId
().
get
();
int
lastDotIndex
=
testParent
.
lastIndexOf
(
'.'
);
String
testPackage
=
testParent
.
substring
(
testParent
.
lastIndexOf
(
':'
)+
1
,
lastDotIndex
-
1
);
String
testClass
=
testParent
.
substring
(
lastDotIndex
+
1
,
testParent
.
length
()-
1
);
Result
result
=
new
Result
();
result
.
packageName
=
s
.
getLegacyReportingName
()
;
result
.
className
=
s
.
getParentId
().
get
()
;
result
.
packageName
=
testPackage
;
result
.
className
=
testClass
;
result
.
name
=
s
.
getDisplayName
();
result
.
state
=
Result
.
State
.
SUCCESS
.
ordinal
();
...
...
@@ -267,9 +271,13 @@ public class Testrunner
resultSummary
.
results
.
addAll
(
summary
.
getFailures
().
stream
().
map
(
f
->
{
Result
result
=
new
Result
();
result
.
packageName
=
f
.
getTestIdentifier
().
getSource
().
get
().
getClass
().
getPackageName
();
result
.
className
=
f
.
getTestIdentifier
().
getSource
().
get
().
getClass
().
getName
();
String
testParent
=
f
.
getTestIdentifier
().
getParentId
().
get
();
int
lastDotIndex
=
testParent
.
lastIndexOf
(
'.'
);
String
testPackage
=
testParent
.
substring
(
testParent
.
lastIndexOf
(
':'
)+
1
,
lastDotIndex
-
1
);
String
testClass
=
testParent
.
substring
(
lastDotIndex
+
1
,
testParent
.
length
()-
1
);
Result
result
=
new
Result
();
result
.
packageName
=
testPackage
;
result
.
className
=
testClass
;
result
.
name
=
f
.
getTestIdentifier
().
getDisplayName
();
result
.
state
=
Result
.
State
.
FAILURE
.
ordinal
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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