Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gla-client-template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Enseignants GLA
gla-client-template
Commits
f20d42c5
Commit
f20d42c5
authored
7 months ago
by
Arnaud LABOUREL
Browse files
Options
Downloads
Patches
Plain Diff
Added ci config
parent
75b5259f
No related branches found
No related tags found
No related merge requests found
Pipeline
#44806
passed
7 months ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+29
-0
29 additions, 0 deletions
.gitlab-ci.yml
build.gradle.kts
+4
-4
4 additions, 4 deletions
build.gradle.kts
src/test/java/fr/univ_amu/m1info/util/TimeIntervalGeneratorTest.java
+94
-0
94 additions, 0 deletions
...va/fr/univ_amu/m1info/util/TimeIntervalGeneratorTest.java
with
127 additions
and
4 deletions
.gitlab-ci.yml
0 → 100644
+
29
−
0
View file @
f20d42c5
image
:
gradle:jdk23-alpine
stages
:
-
build
-
test
variables
:
GRADLE_OPTS
:
"
-Dorg.gradle.daemon=false"
before_script
:
-
export GRADLE_USER_HOME=`pwd`/.gradle
build
:
stage
:
build
script
:
gradle --build-cache build
artifacts
:
paths
:
-
build/libs/*.jar
expire_in
:
1 week
test
:
stage
:
test
script
:
-
gradle test
artifacts
:
when
:
always
reports
:
junit
:
build/test-results/test/**/TEST-*.xml
\ No newline at end of file
This diff is collapsed.
Click to expand it.
build.gradle.kts
+
4
−
4
View file @
f20d42c5
plugins
{
id
(
"java"
)
id
(
"application"
)
id
(
"org.javamodularity.moduleplugin"
)
version
"1.8.15"
id
(
"org.openjfx.javafxplugin"
)
version
"0.1.0"
id
(
"org.beryx.jlink"
)
version
"2.25.0"
}
group
=
"fr.univ_amu.m1info"
...
...
@@ -24,8 +22,10 @@ javafx {
}
dependencies
{
testImplementation
(
platform
(
"org.junit:junit-bom:5.11.3"
))
testRuntimeOnly
(
"org.junit.jupiter:junit-jupiter"
)
testImplementation
(
"org.junit.jupiter:junit-jupiter-api:5.11.4"
)
testRuntimeOnly
(
"org.junit.jupiter:junit-jupiter-engine:5.11.4"
)
testRuntimeOnly
(
"org.junit.platform:junit-platform-launcher"
)
testImplementation
(
"org.assertj:assertj-core:3.27.0"
)
implementation
(
"org.apache.logging.log4j:log4j-api:2.24.3"
)
implementation
(
"org.apache.logging.log4j:log4j-core:2.24.3"
)
implementation
(
"com.fasterxml.jackson.core:jackson-databind:2.18.1"
)
...
...
This diff is collapsed.
Click to expand it.
src/test/java/fr/univ_amu/m1info/util/TimeIntervalGeneratorTest.java
0 → 100644
+
94
−
0
View file @
f20d42c5
package
fr.univ_amu.m1info.util
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.*;
import
java.time.Duration
;
import
java.time.LocalTime
;
import
java.util.Iterator
;
class
TimeIntervalGeneratorTest
{
private
static
final
LocalTime
SIX
=
LocalTime
.
of
(
6
,
0
,
0
);
private
static
final
LocalTime
SEVEN
=
LocalTime
.
of
(
7
,
0
,
0
);
private
static
final
LocalTime
EIGHT
=
LocalTime
.
of
(
8
,
0
,
0
);
private
static
final
LocalTime
NINE
=
LocalTime
.
of
(
9
,
0
,
0
);
private
static
final
LocalTime
TEN
=
LocalTime
.
of
(
10
,
0
,
0
);
private
static
final
LocalTime
NOON
=
LocalTime
.
of
(
12
,
0
,
0
);
private
static
final
Duration
ONE_HOUR
=
Duration
.
ofHours
(
1
);
private
static
final
Duration
ONE_QUARTER
=
Duration
.
ofMinutes
(
15
);
private
TimeIntervalGenerator
sixToTenByHours
;
private
TimeIntervalGenerator
nineToNoonByQuarters
;
@BeforeEach
void
testSetUp
()
{
sixToTenByHours
=
new
TimeIntervalGenerator
(
SIX
,
TEN
,
ONE_HOUR
);
nineToNoonByQuarters
=
new
TimeIntervalGenerator
(
NINE
,
NOON
,
ONE_QUARTER
);
}
@Test
void
testGetIntervalDuration
()
{
assertThat
(
sixToTenByHours
.
getIntervalDuration
()).
isEqualTo
(
ONE_HOUR
);
assertThat
(
nineToNoonByQuarters
.
getIntervalDuration
()).
isEqualTo
(
ONE_QUARTER
);
}
@Test
void
testGetStartTime
()
{
assertThat
(
sixToTenByHours
.
getStartTime
()).
isEqualTo
(
SIX
);
assertThat
(
nineToNoonByQuarters
.
getStartTime
()).
isEqualTo
(
NINE
);
}
@Test
void
testGetEndTime
()
{
assertThat
(
sixToTenByHours
.
getEndTime
()).
isEqualTo
(
TEN
);
assertThat
(
nineToNoonByQuarters
.
getEndTime
()).
isEqualTo
(
NOON
);
}
@Test
void
testGetTimeIntervals
()
{
assertThat
(
nineToNoonByQuarters
.
getTimeIntervals
())
.
hasSize
(
12
)
.
contains
(
new
TimeInterval
(
NINE
,
NINE
.
plus
(
ONE_QUARTER
)),
new
TimeInterval
(
TEN
,
TEN
.
plus
(
ONE_QUARTER
)));
assertThat
(
sixToTenByHours
.
getTimeIntervals
())
.
hasSize
(
4
)
.
containsExactly
(
new
TimeInterval
(
SIX
,
SEVEN
),
new
TimeInterval
(
SEVEN
,
EIGHT
),
new
TimeInterval
(
EIGHT
,
NINE
),
new
TimeInterval
(
NINE
,
TEN
));
}
@Test
void
testGetNumberOfIntervals
()
{
assertThat
(
sixToTenByHours
.
getNumberOfIntervals
()).
isEqualTo
(
4
);
assertThat
(
nineToNoonByQuarters
.
getNumberOfIntervals
()).
isEqualTo
(
12
);
}
@Test
void
testGetTimeIndex
()
{
assertThat
(
sixToTenByHours
.
getTimeIndex
(
EIGHT
)).
isEqualTo
(
2
);
assertThat
(
nineToNoonByQuarters
.
getTimeIndex
(
NINE
)).
isEqualTo
(
0
);
}
@Test
void
testGetStartTimesOfIntervals
()
{
assertThat
(
sixToTenByHours
.
getStartTimesOfIntervals
())
.
hasSize
(
4
)
.
containsExactly
(
SIX
,
SEVEN
,
EIGHT
,
NINE
);
assertThat
(
nineToNoonByQuarters
.
getStartTimesOfIntervals
())
.
hasSize
(
12
)
.
contains
(
NINE
,
TEN
,
TEN
.
plus
(
ONE_QUARTER
),
TEN
.
plus
(
ONE_QUARTER
.
multipliedBy
(
3
)));
}
@Test
void
testIterator
()
{
Iterator
<
TimeInterval
>
iterator
=
nineToNoonByQuarters
.
iterator
();
for
(
int
i
=
0
;
i
<
12
;
i
++)
{
assertThat
(
iterator
.
hasNext
()).
isTrue
();
TimeInterval
timeInterval
=
iterator
.
next
();
LocalTime
expectedStart
=
NINE
.
plus
(
ONE_QUARTER
.
multipliedBy
(
i
));
LocalTime
expectedEnd
=
expectedStart
.
plus
(
ONE_QUARTER
);
assertThat
(
timeInterval
.
start
()).
isEqualTo
(
expectedStart
);
assertThat
(
timeInterval
.
end
()).
isEqualTo
(
expectedEnd
);
}
}
}
\ No newline at end of file
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