Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vollt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sonia Zorba
vollt
Commits
db9b63aa
Commit
db9b63aa
authored
8 years ago
by
gmantele
Browse files
Options
Downloads
Patches
Plain Diff
[TAP] Adapt the JUnit test case for the last commit about executionDuration:
2463d5fe
parent
81f433db
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/tap/parameters/TestTAPExecutionDurationController.java
+11
-11
11 additions, 11 deletions
test/tap/parameters/TestTAPExecutionDurationController.java
with
11 additions
and
11 deletions
test/tap/parameters/TestTAPExecutionDurationController.java
+
11
−
11
View file @
db9b63aa
...
@@ -42,22 +42,22 @@ public class TestTAPExecutionDurationController {
...
@@ -42,22 +42,22 @@ public class TestTAPExecutionDurationController {
// By default, the controller has no limit on the execution duration, so let's try with a duration of 1e6 seconds:
// By default, the controller has no limit on the execution duration, so let's try with a duration of 1e6 seconds:
assertEquals
(
1000000L
,
controller
.
check
(
1000000
));
assertEquals
(
1000000L
,
controller
.
check
(
1000000
));
// With just a default execution duration (of 10 minutes):
// With just a default execution duration (of 10 minutes
= 600000 milliseconds
):
service
.
setExecutionDuration
(
600
,
-
1
);
service
.
setExecutionDuration
(
600
000
,
-
1
);
assertEquals
(
600L
,
controller
.
check
(
null
));
assertEquals
(
600L
,
controller
.
check
(
null
));
assertEquals
(
TAPJob
.
UNLIMITED_DURATION
,
controller
.
check
(-
1
));
assertEquals
(
TAPJob
.
UNLIMITED_DURATION
,
controller
.
check
(-
1
));
assertEquals
(
TAPJob
.
UNLIMITED_DURATION
,
controller
.
check
(
TAPJob
.
UNLIMITED_DURATION
));
assertEquals
(
TAPJob
.
UNLIMITED_DURATION
,
controller
.
check
(
TAPJob
.
UNLIMITED_DURATION
));
// With just a maximum execution duration (of 1 hour):
// With just a maximum execution duration (of 1 hour
= 3600000
):
service
.
setExecutionDuration
(-
1
,
3600
);
service
.
setExecutionDuration
(-
1
,
3600
000
);
assertEquals
(
3600L
,
controller
.
check
(
null
));
assertEquals
(
3600L
,
controller
.
check
(
null
));
assertEquals
(
60L
,
controller
.
check
(
60
));
assertEquals
(
60L
,
controller
.
check
(
60
));
assertEquals
(
3600L
,
controller
.
check
(-
1
));
assertEquals
(
3600L
,
controller
.
check
(-
1
));
assertEquals
(
3600L
,
controller
.
check
(
TAPJob
.
UNLIMITED_DURATION
));
assertEquals
(
3600L
,
controller
.
check
(
TAPJob
.
UNLIMITED_DURATION
));
assertEquals
(
3600L
,
controller
.
check
(
3601
));
assertEquals
(
3600L
,
controller
.
check
(
3601
));
// With a default (10 minutes) AND a maximum (1 hour) execution duration:
// With a default (10 minutes
= 600000 ms
) AND a maximum (1 hour
= 3600000 ms
) execution duration:
service
.
setExecutionDuration
(
600
,
3600
);
service
.
setExecutionDuration
(
600
000
,
3600
000
);
assertEquals
(
600L
,
controller
.
check
(
null
));
assertEquals
(
600L
,
controller
.
check
(
null
));
assertEquals
(
10L
,
controller
.
check
(
10
));
assertEquals
(
10L
,
controller
.
check
(
10
));
assertEquals
(
600L
,
controller
.
check
(
600
));
assertEquals
(
600L
,
controller
.
check
(
600
));
...
@@ -88,12 +88,12 @@ public class TestTAPExecutionDurationController {
...
@@ -88,12 +88,12 @@ public class TestTAPExecutionDurationController {
service
.
setExecutionDuration
(-
1
,
-
1
);
service
.
setExecutionDuration
(-
1
,
-
1
);
assertEquals
(
TAPJob
.
UNLIMITED_DURATION
,
controller
.
getDefault
());
assertEquals
(
TAPJob
.
UNLIMITED_DURATION
,
controller
.
getDefault
());
// With an execution duration of 10 minutes:
// With an execution duration of 10 minutes
(= 600000 ms)
:
service
.
setExecutionDuration
(
600
,
-
1
);
service
.
setExecutionDuration
(
600
000
,
-
1
);
assertEquals
(
600L
,
controller
.
getDefault
());
assertEquals
(
600L
,
controller
.
getDefault
());
// The default value must always be less than the maximum value:
// The default value must always be less than the maximum value:
service
.
setExecutionDuration
(
600
,
3
00
);
service
.
setExecutionDuration
(
600
000
,
3000
00
);
assertEquals
(
300L
,
controller
.
getDefault
());
assertEquals
(
300L
,
controller
.
getDefault
());
}
}
...
@@ -113,8 +113,8 @@ public class TestTAPExecutionDurationController {
...
@@ -113,8 +113,8 @@ public class TestTAPExecutionDurationController {
service
.
setExecutionDuration
(-
1
,
-
1
);
service
.
setExecutionDuration
(-
1
,
-
1
);
assertEquals
(
TAPJob
.
UNLIMITED_DURATION
,
controller
.
getMaxDuration
());
assertEquals
(
TAPJob
.
UNLIMITED_DURATION
,
controller
.
getMaxDuration
());
// With an execution duration of 10 minutes:
// With an execution duration of 10 minutes
(= 600000 ms)
:
service
.
setExecutionDuration
(-
1
,
600
);
service
.
setExecutionDuration
(-
1
,
600
000
);
assertEquals
(
600L
,
controller
.
getMaxDuration
());
assertEquals
(
600L
,
controller
.
getMaxDuration
());
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment