Skip to content

Commit

Permalink
Merge pull request #235 from wongoo/release-v1.7.0
Browse files Browse the repository at this point in the history
Release v1.7.0 RC2
  • Loading branch information
AlexStocks authored Sep 9, 2020
2 parents 27e5ea6 + faccffd commit ae9da95
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 34 deletions.
1 change: 1 addition & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- fix eunm encode error in request. [#203](https://github.com/apache/dubbo-go-hessian2/pull/203)
- fix []byte field decoding issue. [#216](https://github.com/apache/dubbo-go-hessian2/pull/216)
- fix decoding error for map in map. [#229](https://github.com/apache/dubbo-go-hessian2/pull/229)
- fix fields name mismatch in Duration class. [#234](https://github.com/apache/dubbo-go-hessian2/pull/234)

## v1.6.0

Expand Down
22 changes: 11 additions & 11 deletions java8_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ import (
func init() {
RegisterPOJO(&java8_time.Year{Year: 2020})
RegisterPOJO(&java8_time.YearMonth{Month: 2020, Year: 6})
RegisterPOJO(&java8_time.Period{Years: 2020, Months: 6, Days: 6})
RegisterPOJO(&java8_time.LocalDate{Year: 2020, Month: 6, Day: 6})
RegisterPOJO(&java8_time.LocalTime{Hour: 6, Minute: 6, Second: 0, Nano: 0})
RegisterPOJO(&java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 6}, Time: java8_time.LocalTime{Hour: 6, Minute: 6, Second: 6, Nano: 6}})
RegisterPOJO(&java8_time.MonthDay{Month: 6, Day: 6})
RegisterPOJO(&java8_time.Duration{Second: 0, Nano: 0})
RegisterPOJO(&java8_time.Instant{Seconds: 100, Nanos: 0})
RegisterPOJO(&java8_time.ZoneOffSet{Seconds: 0})
RegisterPOJO(&java8_time.OffsetDateTime{DateTime: java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 6}, Time: java8_time.LocalTime{Hour: 6, Minute: 6, Second: 6, Nano: 6}}, Offset: java8_time.ZoneOffSet{Seconds: -64800}})
RegisterPOJO(&java8_time.OffsetTime{LocalTime: java8_time.LocalTime{Hour: 6, Minute: 6, Second: 6, Nano: 6}, ZoneOffset: java8_time.ZoneOffSet{Seconds: -64800}})
RegisterPOJO(&java8_time.ZonedDateTime{DateTime: java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 6}, Time: java8_time.LocalTime{Hour: 6, Minute: 6, Second: 6, Nano: 6}}, Offset: java8_time.ZoneOffSet{Seconds: 0}, ZoneId: "Z"})
RegisterPOJO(&java8_time.Period{Years: 2020, Months: 6, Days: 16})
RegisterPOJO(&java8_time.LocalDate{Year: 2020, Month: 6, Day: 16})
RegisterPOJO(&java8_time.LocalTime{Hour: 6, Minute: 5, Second: 4, Nano: 3})
RegisterPOJO(&java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 16}, Time: java8_time.LocalTime{Hour: 6, Minute: 5, Second: 4, Nano: 3}})
RegisterPOJO(&java8_time.MonthDay{Month: 6, Day: 16})
RegisterPOJO(&java8_time.Duration{Seconds: 30, Nanos: 10})
RegisterPOJO(&java8_time.Instant{Seconds: 100, Nanos: 10})
RegisterPOJO(&java8_time.ZoneOffSet{Seconds: 7200})
RegisterPOJO(&java8_time.OffsetDateTime{DateTime: java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 16}, Time: java8_time.LocalTime{Hour: 6, Minute: 5, Second: 4, Nano: 3}}, Offset: java8_time.ZoneOffSet{Seconds: 7200}})
RegisterPOJO(&java8_time.OffsetTime{LocalTime: java8_time.LocalTime{Hour: 6, Minute: 5, Second: 4, Nano: 3}, ZoneOffset: java8_time.ZoneOffSet{Seconds: 7200}})
RegisterPOJO(&java8_time.ZonedDateTime{DateTime: java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 16}, Time: java8_time.LocalTime{Hour: 6, Minute: 5, Second: 4, Nano: 3}}, Offset: java8_time.ZoneOffSet{Seconds: 7200}, ZoneId: "Z"})

}
4 changes: 2 additions & 2 deletions java8_time/duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package java8_time

type Duration struct {
Second int64 `hessian:"second"`
Nano int32 `hessian:"nano"`
Seconds int64 `hessian:"seconds"`
Nanos int32 `hessian:"nanos"`
}

func (Duration) JavaClassName() string {
Expand Down
22 changes: 11 additions & 11 deletions java8_time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ import (

func TestJava8Time(t *testing.T) {
doTestTime(t, "java8_Year", &java8_time.Year{Year: 2020})
doTestTime(t, "java8_LocalDate", &java8_time.LocalDate{Year: 2020, Month: 6, Day: 6})
doTestTime(t, "java8_LocalTime", &java8_time.LocalTime{Hour: 6, Minute: 6})
doTestTime(t, "java8_LocalDateTime", &java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 6}, Time: java8_time.LocalTime{Hour: 6, Minute: 6, Second: 6, Nano: 6}})
doTestTime(t, "java8_MonthDay", &java8_time.MonthDay{Month: 6, Day: 6})
doTestTime(t, "java8_Duration", &java8_time.Duration{Second: 0, Nano: 0})
doTestTime(t, "java8_Instant", &java8_time.Instant{Seconds: 100, Nanos: 0})
doTestTime(t, "java8_LocalDate", &java8_time.LocalDate{Year: 2020, Month: 6, Day: 16})
doTestTime(t, "java8_LocalTime", &java8_time.LocalTime{Hour: 6, Minute: 16})
doTestTime(t, "java8_LocalDateTime", &java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 16}, Time: java8_time.LocalTime{Hour: 6, Minute: 5, Second: 4, Nano: 3}})
doTestTime(t, "java8_MonthDay", &java8_time.MonthDay{Month: 6, Day: 16})
doTestTime(t, "java8_Duration", &java8_time.Duration{Seconds: 30, Nanos: 10})
doTestTime(t, "java8_Instant", &java8_time.Instant{Seconds: 100, Nanos: 10})
doTestTime(t, "java8_YearMonth", &java8_time.YearMonth{Year: 2020, Month: 6})
doTestTime(t, "java8_Period", &java8_time.Period{Years: 2020, Months: 6, Days: 6})
doTestTime(t, "java8_ZoneOffset", &java8_time.ZoneOffSet{Seconds: 0})
doTestTime(t, "java8_OffsetDateTime", &java8_time.OffsetDateTime{DateTime: java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 6}, Time: java8_time.LocalTime{Hour: 6, Minute: 6, Second: 6, Nano: 6}}, Offset: java8_time.ZoneOffSet{Seconds: -64800}})
doTestTime(t, "java8_OffsetTime", &java8_time.OffsetTime{LocalTime: java8_time.LocalTime{Hour: 6, Minute: 6, Second: 6, Nano: 6}, ZoneOffset: java8_time.ZoneOffSet{Seconds: -64800}})
doTestTime(t, "java8_ZonedDateTime", &java8_time.ZonedDateTime{DateTime: java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 6}, Time: java8_time.LocalTime{Hour: 6, Minute: 6, Second: 6, Nano: 6}}, Offset: java8_time.ZoneOffSet{Seconds: 0}, ZoneId: "Z"})
doTestTime(t, "java8_Period", &java8_time.Period{Years: 2020, Months: 6, Days: 16})
doTestTime(t, "java8_ZoneOffset", &java8_time.ZoneOffSet{Seconds: 7200})
doTestTime(t, "java8_OffsetDateTime", &java8_time.OffsetDateTime{DateTime: java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 16}, Time: java8_time.LocalTime{Hour: 6, Minute: 5, Second: 4, Nano: 3}}, Offset: java8_time.ZoneOffSet{Seconds: 7200}})
doTestTime(t, "java8_OffsetTime", &java8_time.OffsetTime{LocalTime: java8_time.LocalTime{Hour: 6, Minute: 5, Second: 4, Nano: 3}, ZoneOffset: java8_time.ZoneOffSet{Seconds: 7200}})
doTestTime(t, "java8_ZonedDateTime", &java8_time.ZonedDateTime{DateTime: java8_time.LocalDateTime{Date: java8_time.LocalDate{Year: 2020, Month: 6, Day: 16}, Time: java8_time.LocalTime{Hour: 6, Minute: 5, Second: 4, Nano: 3}}, Offset: java8_time.ZoneOffSet{Seconds: 0}, ZoneId: "Z"})
}

func doTestTime(t *testing.T, method string, expected interface{}) {
Expand Down
20 changes: 10 additions & 10 deletions test_hessian/src/main/java/test/TestJava8Time.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,39 @@
public class TestJava8Time {

public static Duration java8_Duration() {
return Duration.ZERO;
return Duration.ofSeconds(30, 10);
}

public static Instant java8_Instant() {
return Instant.ofEpochMilli(100000L);
return Instant.ofEpochSecond(100, 10);
}

public static LocalDate java8_LocalDate() {
return LocalDate.of(2020, 6, 6);
return LocalDate.of(2020, 6, 16);
}

public static LocalDateTime java8_LocalDateTime() {
return LocalDateTime.of(2020, 6, 6, 6, 6, 6, 6);
return LocalDateTime.of(2020, 6, 16, 6, 5, 4, 3);
}

public static LocalTime java8_LocalTime() {
return LocalTime.of(6, 6);
return LocalTime.of(6, 16);
}

public static MonthDay java8_MonthDay() {
return MonthDay.of(6, 6);
return MonthDay.of(6, 16);
}

public static OffsetDateTime java8_OffsetDateTime() {
return OffsetDateTime.of(2020, 6, 6, 6, 6, 6, 6, ZoneOffset.MIN);
return OffsetDateTime.of(2020, 6, 16, 6, 5, 4, 3, java8_ZoneOffset());
}

public static OffsetTime java8_OffsetTime() {
return OffsetTime.of(6, 6, 6, 6, ZoneOffset.MIN);
return OffsetTime.of(6, 5, 4, 3, java8_ZoneOffset());
}

public static Period java8_Period() {
return Period.of(2020, 6, 6);
return Period.of(2020, 6, 16);
}

public static Year java8_Year() {
Expand All @@ -75,7 +75,7 @@ public static ZoneId java8_ZoneId() {
}

public static ZoneOffset java8_ZoneOffset() {
return ZoneOffset.of("Z");
return ZoneOffset.ofHours(2);
}

}

0 comments on commit ae9da95

Please sign in to comment.