Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
jester
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
72d32bca
authored
Apr 06, 2020
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New tests
parent
a9eacf10
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
8 deletions
+107
-8
src/test/java/mvd/jester/priority/TestRateMonotonic.java
+0
-2
src/test/java/mvd/jester/tests/TestChwaLee.java
+56
-0
src/test/java/mvd/jester/tests/TestSchmidMottok.java
+6
-6
src/test/java/mvd/jester/utils/TestLogger.java
+45
-0
No files found.
src/test/java/mvd/jester/priority/TestRateMonotonic.java
View file @
72d32bca
...
...
@@ -4,10 +4,8 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
java.util.HashSet
;
import
org.junit.jupiter.api.DisplayName
;
import
org.junit.jupiter.api.Test
;
import
mvd.jester.model.Segment
;
import
mvd.jester.model.SystemSetup
;
import
mvd.jester.model.Task
;
import
mvd.jester.simulator.DynamicForkJoin
;
...
...
src/test/java/mvd/jester/tests/TestChwaLee.java
0 → 100644
View file @
72d32bca
package
mvd
.
jester
.
tests
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
import
org.junit.jupiter.api.DisplayName
;
import
org.junit.jupiter.api.Test
;
import
mvd.jester.info.SchedulingInfo
;
import
mvd.jester.info.TerminationInfo.Level
;
import
mvd.jester.model.SystemSetup
;
import
mvd.jester.priority.EarliestDeadlineFirst
;
/**
* TestChwaLee
*/
public
class
TestChwaLee
{
@Test
@DisplayName
(
"Check if the schedulability check returns the correct values."
)
public
void
testRunSchedulabilityCheck
()
{
{
SystemSetup
systemSetup
=
SystemSetup
.
readFromFile
(
"src/test/resources/Taskset1.txt"
,
4
);
ChwaLee
cl
=
new
ChwaLee
(
systemSetup
);
SchedulingInfo
schedulingInfo
=
cl
.
runSchedulabilityCheck
(
new
EarliestDeadlineFirst
());
assertTrue
(
schedulingInfo
.
getTerminationInfos
().
size
()
==
4
);
assertTrue
(
schedulingInfo
.
checkLevelFail
(
Level
.
HIGH
)
==
true
);
assertTrue
(
schedulingInfo
.
checkTasksetFeasible
()
==
false
);
assertTrue
(
schedulingInfo
.
getFailedTerminationInfo
().
isPresent
());
}
{
SystemSetup
systemSetup
=
SystemSetup
.
readFromFile
(
"src/test/resources/Taskset1.txt"
,
8
);
ChwaLee
cl
=
new
ChwaLee
(
systemSetup
);
SchedulingInfo
schedulingInfo
=
cl
.
runSchedulabilityCheck
(
new
EarliestDeadlineFirst
());
assertTrue
(
schedulingInfo
.
getTerminationInfos
().
size
()
==
4
);
assertTrue
(
schedulingInfo
.
checkLevelFail
(
Level
.
HIGH
)
==
true
);
assertTrue
(
schedulingInfo
.
checkTasksetFeasible
()
==
false
);
assertTrue
(
schedulingInfo
.
getFailedTerminationInfo
().
isPresent
());
}
{
SystemSetup
systemSetup
=
SystemSetup
.
readFromFile
(
"src/test/resources/Taskset1.txt"
,
16
);
ChwaLee
cl
=
new
ChwaLee
(
systemSetup
);
SchedulingInfo
schedulingInfo
=
cl
.
runSchedulabilityCheck
(
new
EarliestDeadlineFirst
());
assertTrue
(
schedulingInfo
.
getTerminationInfos
().
size
()
==
4
);
assertTrue
(
schedulingInfo
.
checkLevelFail
(
Level
.
HIGH
)
==
true
);
assertTrue
(
schedulingInfo
.
checkTasksetFeasible
()
==
false
);
assertTrue
(
schedulingInfo
.
getFailedTerminationInfo
().
isPresent
());
}
}
}
src/test/java/mvd/jester/tests/TestSchmidMottok.java
View file @
72d32bca
...
...
@@ -20,9 +20,9 @@ public class TestSchmidMottok {
{
SystemSetup
systemSetup
=
SystemSetup
.
readFromFile
(
"src/test/resources/Taskset1.txt"
,
4
);
MaiaBertogna
mb
=
new
MaiaBertogna
(
systemSetup
);
SchmidMottok
sm
=
new
SchmidMottok
(
systemSetup
);
SchedulingInfo
schedulingInfo
=
mb
.
runSchedulabilityCheck
(
new
RateMonotonic
());
SchedulingInfo
schedulingInfo
=
sm
.
runSchedulabilityCheck
(
new
RateMonotonic
());
assertTrue
(
schedulingInfo
.
getTerminationInfos
().
size
()
==
4
);
assertTrue
(
schedulingInfo
.
checkLevelFail
(
Level
.
HIGH
)
==
true
);
...
...
@@ -32,9 +32,9 @@ public class TestSchmidMottok {
{
SystemSetup
systemSetup
=
SystemSetup
.
readFromFile
(
"src/test/resources/Taskset1.txt"
,
8
);
MaiaBertogna
mb
=
new
MaiaBertogna
(
systemSetup
);
SchmidMottok
sm
=
new
SchmidMottok
(
systemSetup
);
SchedulingInfo
schedulingInfo
=
mb
.
runSchedulabilityCheck
(
new
RateMonotonic
());
SchedulingInfo
schedulingInfo
=
sm
.
runSchedulabilityCheck
(
new
RateMonotonic
());
assertTrue
(
schedulingInfo
.
getTerminationInfos
().
size
()
==
4
);
assertTrue
(
schedulingInfo
.
checkLevelFail
(
Level
.
HIGH
)
==
true
);
...
...
@@ -44,9 +44,9 @@ public class TestSchmidMottok {
{
SystemSetup
systemSetup
=
SystemSetup
.
readFromFile
(
"src/test/resources/Taskset1.txt"
,
16
);
MaiaBertogna
mb
=
new
MaiaBertogna
(
systemSetup
);
SchmidMottok
sm
=
new
SchmidMottok
(
systemSetup
);
SchedulingInfo
schedulingInfo
=
mb
.
runSchedulabilityCheck
(
new
RateMonotonic
());
SchedulingInfo
schedulingInfo
=
sm
.
runSchedulabilityCheck
(
new
RateMonotonic
());
assertTrue
(
schedulingInfo
.
getTerminationInfos
().
size
()
==
4
);
assertTrue
(
schedulingInfo
.
checkLevelFail
(
Level
.
HIGH
)
==
false
);
...
...
src/test/java/mvd/jester/utils/TestLogger.java
0 → 100644
View file @
72d32bca
package
mvd
.
jester
.
utils
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertFalse
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
com.google.common.io.Files
;
import
org.junit.Rule
;
import
org.junit.jupiter.api.DisplayName
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.io.TempDir
;
import
org.junit.rules.TemporaryFolder
;
/**
* TestLogger
*/
public
class
TestLogger
{
@TempDir
File
tempDir
;
@Test
@DisplayName
(
"CHeck Logger"
)
void
testLogger
()
throws
IOException
{
String
fileName
=
tempDir
.
getAbsolutePath
()
+
"/test.txt"
;
Logger
logger
=
new
Logger
(
fileName
);
Logger
failedLogger
=
new
Logger
(
fileName
);
Appendable
out
=
new
StringBuilder
();
out
.
append
(
"abc"
);
out
.
append
(
"efg"
);
logger
.
log
(
out
);
logger
.
finalize
();
failedLogger
.
finalize
();
}
}
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