Skip to content
GitLab
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
a7e9fd90
Verified
Commit
a7e9fd90
authored
4 years ago
by
Lukas Wiest
Browse files
Options
Download
Plain Diff
Merge branch '2-make-swp1-compatible'
closes
#2
parents
73d5a990
da4322fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+7
-5
Dockerfile
src/main/java/de/hftstuttgart/modocot/Testrunner.java
+17
-3
src/main/java/de/hftstuttgart/modocot/Testrunner.java
with
24 additions
and
8 deletions
+24
-8
Dockerfile
+
7
-
5
View file @
a7e9fd90
from
openjdk:11-jdk-slim
env
MODOCOT_BASEDIR /modocot
env
MODOCOT_TESTDIR
/
$MODOCOT_BASEDIR/test
env
MODOCOT_SOURCEDIR
/
$MODOCOT_BASEDIR/src
env
MODOCOT_RESULTDIR
/
$MODOCOT_BASEDIR/result
env
MODOCOT_LIBSDIR
/
$MODOCOT_BASEDIR/libs
env
MODOCOT_TESTDIR $MODOCOT_BASEDIR/test
env
MODOCOT_SOURCEDIR $MODOCOT_BASEDIR/src
env
MODOCOT_RESULTDIR $MODOCOT_BASEDIR/result
env
MODOCOT_LIBSDIR $MODOCOT_BASEDIR/libs
run
mkdir
-p
$MODOCOT_TESTDIR
\
&&
mkdir
$MODOCOT_SOURCEDIR
\
...
...
@@ -14,7 +14,9 @@ run mkdir -p $MODOCOT_TESTDIR \
add
target/modocot-openjdk11-junit5-runner-jar-with-dependencies.jar /$MODOCOT_BASEDIR/app.jar
add
https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar /$MODOCOT_LIBSDIR/
add
https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/5.7.0/junit-jupiter-engine-5.7.0.jar /$MODOCOT_LIBSDIR/
add
https://repo1.maven.org/maven2/org/apiguardian/apiguardian-api/1.1.1/apiguardian-api-1.1.1.jar /$MODOCOT_LIBSDIR/
add
https://repo1.maven.org/maven2/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar /$MODOCOT_LIBSDIR/
workdir
/modocot
entrypoint
java -Djava.security.egd=file:/dev/./urandom -jar /modocot/app.jar "$MODOCOT_SOURCEDIR:$MODOCOT_TESTDIR" "$MODOCOT_LIBSDIR/*" $MODOCOT_RESULTDIR
entrypoint
java -Djava.security.egd=file:/dev/./urandom -jar /modocot/app.jar "$MODOCOT_SOURCEDIR
/src
:$MODOCOT_TESTDIR
/test
" "$MODOCOT_LIBSDIR/*
:$MODOCOT_TESTDIR/libs/*
" $MODOCOT_RESULTDIR
This diff is collapsed.
Click to expand it.
src/main/java/de/hftstuttgart/modocot/Testrunner.java
+
17
-
3
View file @
a7e9fd90
...
...
@@ -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
]);
}
...
...
@@ -111,6 +114,11 @@ public class Testrunner
{
path
=
path
.
substring
(
0
,
path
.
length
()
-
1
);
File
pathFile
=
new
File
(
path
);
if
(!
pathFile
.
exists
()
||
!
pathFile
.
isDirectory
())
{
continue
;
}
for
(
File
file
:
Objects
.
requireNonNull
(
pathFile
.
listFiles
()))
{
if
(
file
.
isFile
()
&&
file
.
getName
().
endsWith
(
".jar"
))
...
...
@@ -123,7 +131,11 @@ public class Testrunner
}
}
else
{
files
.
add
(
new
File
(
path
));
File
file
=
new
File
(
path
);
if
(
file
.
exists
())
{
files
.
add
(
file
);
}
}
}
return
files
;
...
...
@@ -131,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
<>();
...
...
@@ -302,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
...
...
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