Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
QuasselDroid-ng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
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
Janne Mareike Koschinski
QuasselDroid-ng
Commits
a76061cc
Verified
Commit
a76061cc
authored
6 years ago
by
Janne Mareike Koschinski
Browse files
Options
Downloads
Patches
Plain Diff
Explicitly specify timezones in DateTimeSerializerTest
parent
dd0380c5
No related branches found
No related tags found
No related merge requests found
Pipeline
#361
canceled
6 years ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/src/test/java/de/kuschku/libquassel/protocol/primitive/serializer/DateTimeSerializerTest.kt
+3
-6
3 additions, 6 deletions
...l/protocol/primitive/serializer/DateTimeSerializerTest.kt
with
3 additions
and
6 deletions
lib/src/test/java/de/kuschku/libquassel/protocol/primitive/serializer/DateTimeSerializerTest.kt
+
3
−
6
View file @
a76061cc
...
@@ -23,10 +23,7 @@ import de.kuschku.libquassel.util.deserialize
...
@@ -23,10 +23,7 @@ import de.kuschku.libquassel.util.deserialize
import
de.kuschku.libquassel.util.roundTrip
import
de.kuschku.libquassel.util.roundTrip
import
org.junit.Assert.assertEquals
import
org.junit.Assert.assertEquals
import
org.junit.Test
import
org.junit.Test
import
org.threeten.bp.Instant
import
org.threeten.bp.*
import
org.threeten.bp.LocalDateTime
import
org.threeten.bp.Month
import
org.threeten.bp.ZoneOffset
class
DateTimeSerializerTest
{
class
DateTimeSerializerTest
{
@Test
@Test
...
@@ -46,7 +43,7 @@ class DateTimeSerializerTest {
...
@@ -46,7 +43,7 @@ class DateTimeSerializerTest {
@Test
@Test
fun
testEpochByCalendarAtTimezone
()
{
fun
testEpochByCalendarAtTimezone
()
{
val
value
=
LocalDateTime
.
of
(
1970
,
1
,
1
,
0
,
0
)
val
value
=
LocalDateTime
.
of
(
1970
,
1
,
1
,
0
,
0
)
.
atZone
(
Zone
Offset
.
systemDefault
(
)).
toInstant
()
.
atZone
(
Zone
Id
.
of
(
"Europe/Berlin"
)).
toInstant
()
assertEquals
(
value
,
roundTrip
(
DateTimeSerializer
,
value
))
assertEquals
(
value
,
roundTrip
(
DateTimeSerializer
,
value
))
assertEquals
(
value
,
deserialize
(
DateTimeSerializer
,
byteArrayOf
(
0
,
37
,
61
,
-
117
,
4
,
-
17
,
109
,
-
128
,
2
)))
assertEquals
(
value
,
deserialize
(
DateTimeSerializer
,
byteArrayOf
(
0
,
37
,
61
,
-
117
,
4
,
-
17
,
109
,
-
128
,
2
)))
}
}
...
@@ -54,7 +51,7 @@ class DateTimeSerializerTest {
...
@@ -54,7 +51,7 @@ class DateTimeSerializerTest {
@Test
@Test
fun
testNormalCase
()
{
fun
testNormalCase
()
{
val
value
=
LocalDateTime
.
of
(
2019
,
Month
.
JANUARY
,
15
,
20
,
25
)
val
value
=
LocalDateTime
.
of
(
2019
,
Month
.
JANUARY
,
15
,
20
,
25
)
.
atZone
(
Zone
Offset
.
systemDefault
(
)).
toInstant
()
.
atZone
(
Zone
Id
.
of
(
"Europe/Berlin"
)).
toInstant
()
assertEquals
(
value
,
roundTrip
(
DateTimeSerializer
,
value
))
assertEquals
(
value
,
roundTrip
(
DateTimeSerializer
,
value
))
assertEquals
(
value
,
deserialize
(
DateTimeSerializer
,
byteArrayOf
(
0
,
37
,
-
125
,
-
125
,
4
,
42
,
-
106
,
-
32
,
2
)))
assertEquals
(
value
,
deserialize
(
DateTimeSerializer
,
byteArrayOf
(
0
,
37
,
-
125
,
-
125
,
4
,
42
,
-
106
,
-
32
,
2
)))
}
}
...
...
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