Skip to content
GitLab
Menu
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
695f4e40
Verified
Commit
695f4e40
authored
Dec 29, 2020
by
Lukas Wiest
🚂
Browse files
fix(app): buildClasspath: build classpath differently for compile and runtime
parent
a6f72b00
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/hftstuttgart/modocot/Testrunner.java
View file @
695f4e40
...
...
@@ -72,7 +72,6 @@ public class Testrunner
libraryFolders
=
args
[
1
].
split
(
":"
);
resultFolder
=
args
[
2
];
classFolder
=
Files
.
createTempDirectory
(
"modocot-testrunner"
).
toAbsolutePath
().
toString
();
classPathItems
=
buildClassPathItems
();
// finding all source files
Set
<
File
>
sourceFiles
=
new
HashSet
<>();
...
...
@@ -94,10 +93,14 @@ public class Testrunner
writeResult
(
resultSummary
);
}
public
static
String
[]
buildClassPathItems
()
public
static
String
[]
buildClassPathItems
(
boolean
runtime
)
{
Set
<
String
>
classPathItemsBuild
=
new
HashSet
<>(
Arrays
.
asList
(
libraryFolders
));
classPathItemsBuild
.
add
(
classFolder
);
if
(
runtime
)
{
classPathItemsBuild
.
addAll
(
Arrays
.
stream
(
sourceFolders
).
collect
(
Collectors
.
toSet
()));
}
return
classPathItemsBuild
.
toArray
(
new
String
[
0
]);
}
...
...
@@ -140,6 +143,7 @@ public class Testrunner
public
static
List
<
Diagnostic
>
compile
(
Set
<
File
>
files
,
File
outputDir
)
{
classPathItems
=
buildClassPathItems
(
false
);
LOG
.
info
(
"compilation started"
);
List
<
Diagnostic
>
compilationErrors
=
new
LinkedList
<>();
...
...
@@ -311,6 +315,7 @@ public class Testrunner
public
static
ModocotResultSummary
runTests
()
throws
MalformedURLException
{
classPathItems
=
buildClassPathItems
(
true
);
LOG
.
info
(
"saving original class loader"
);
ClassLoader
originalClassLoader
=
Thread
.
currentThread
().
getContextClassLoader
();
// get custom one
...
...
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