Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dockerized Testing Toolkit
Testrunner OpenJDK11 JUnit5-Jupiter
Commits
8edb730a
Commit
8edb730a
authored
1 year ago
by
Lückemeyer
Browse files
Options
Download
Email Patches
Plain Diff
fixed pattern matching for path removal in not compilable result
parent
5bb8c5af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/hftstuttgart/dtt/Testrunner.java
+9
-5
src/main/java/de/hftstuttgart/dtt/Testrunner.java
with
9 additions
and
5 deletions
+9
-5
src/main/java/de/hftstuttgart/dtt/Testrunner.java
+
9
-
5
View file @
8edb730a
...
@@ -163,9 +163,11 @@ public class Testrunner
...
@@ -163,9 +163,11 @@ public class Testrunner
options
.
add
(
"-d"
);
// output dir
options
.
add
(
"-d"
);
// output dir
options
.
add
(
outputDir
.
getAbsolutePath
());
options
.
add
(
outputDir
.
getAbsolutePath
());
options
.
add
(
"-cp"
);
// custom classpath
options
.
add
(
"-cp"
);
// custom classpath
String
os
=
System
.
getProperty
(
"os.name"
);
final
String
osSpecificCpDelim
=(
os
.
indexOf
(
"Windows"
)>-
1
?
";"
:
":"
);
String
cp
=
buildClassPath
(
classPathItems
).
stream
()
String
cp
=
buildClassPath
(
classPathItems
).
stream
()
.
map
(
f
->
f
.
getPath
())
.
map
(
f
->
f
.
getPath
())
.
reduce
((
s1
,
s2
)
->
s1
+
":"
+
s2
).
orElse
(
""
);
.
reduce
((
s1
,
s2
)
->
s1
+
osSpecificCpDelim
+
s2
).
orElse
(
""
);
LOG
.
info
(
"classpath for compilation: "
+
cp
);
LOG
.
info
(
"classpath for compilation: "
+
cp
);
options
.
add
(
cp
);
options
.
add
(
cp
);
...
@@ -213,10 +215,12 @@ public class Testrunner
...
@@ -213,10 +215,12 @@ public class Testrunner
return
compilationErrors
.
stream
().
map
(
e
->
return
compilationErrors
.
stream
().
map
(
e
->
{
{
Result
result
=
new
Result
();
Result
result
=
new
Result
();
Pattern
pattern
=
Pattern
.
compile
(
String
.
format
(
"^.*%s(.*\\.java).*$"
,
File
.
separator
));
// Pattern pattern = Pattern.compile(String.format("^.*%s(.*\\.java).*$", File.separator));
Matcher
matcher
=
pattern
.
matcher
(
String
.
valueOf
(
e
.
getSource
()));
// Matcher matcher = pattern.matcher(String.valueOf(e.getSource()));
//
result
.
name
=
(
matcher
.
matches
()
&&
matcher
.
group
(
1
)
!=
null
)
?
matcher
.
group
(
1
)
:
String
.
valueOf
(
e
.
getSource
());
// result.name = (matcher.matches() && matcher.group(1) != null) ? matcher.group(1) : String.valueOf(e.getSource());
String
sourcePath
=
String
.
valueOf
(
e
.
getSource
());
result
.
name
=
sourcePath
.
substring
(
sourcePath
.
lastIndexOf
(
File
.
separator
)+
1
,
sourcePath
.
length
()-
1
);
result
.
state
=
Result
.
State
.
COMPILATIONERROR
.
ordinal
();
result
.
state
=
Result
.
State
.
COMPILATIONERROR
.
ordinal
();
result
.
failureReason
=
e
.
getMessage
(
Locale
.
ENGLISH
);
result
.
failureReason
=
e
.
getMessage
(
Locale
.
ENGLISH
);
result
.
failureType
=
"Compilation Failed"
;
result
.
failureType
=
"Compilation Failed"
;
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets