Skip to content

Commit

Permalink
fix: Fix the data loss
Browse files Browse the repository at this point in the history
  • Loading branch information
Romuald Rousseau committed Dec 9, 2024
1 parent dca9350 commit f107667
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 211 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;
import java.util.Locale;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Tag;
Expand All @@ -15,8 +16,18 @@ public class Test_Python {
@Test
@Tag("unit")
public void testPythonSimpleDateformat() throws ParseException {
final PythonSimpleDateFormat formatter = new PythonSimpleDateFormat("%a,%d/%m/%y");
final var formatter = new PythonSimpleDateFormat("%a,%d/%m/%y");
assertEquals("Sun,24/09/23", formatter.format(Date.from(LocalDate.of(2023, 9, 24).atStartOfDay(ZoneId.systemDefault()).toInstant())));
assertEquals("Sun,05/12/99", formatter.format(formatter.parse("Sun,05/12/99")));
}

@Test
@Tag("unit")
public void testPythonSimpleDateformatWithLocale() throws ParseException {
final var formatterGB = new PythonSimpleDateFormat("%b, %Y", Locale.forLanguageTag("en-GB"));
assertEquals("Sept, 2023", formatterGB.format(formatterGB.parse("Sept, 2023")));

final var formatterUS = new PythonSimpleDateFormat("%b, %Y", Locale.forLanguageTag("en-US"));
assertEquals("Sep, 2023", formatterUS.format(formatterUS.parse("Sep, 2023")));
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ public Set<String> getEntryTypeValues() {
}

public void setEntryTypeValues(final Set<String> entryTypeValues) {
final var newEntries = entryTypeValues.stream()
.flatMap(x -> this.entries.stream()
.map(y -> new PivotEntry(y.getCell(), this.pivotEntityName).setTypeValue(x)))
.toList();
this.entries.clear();
this.entries.addAll(entryTypeValues.stream()
.map(x -> new PivotEntry(this.getCell(), this.pivotEntityName).setTypeValue(x)).toList());
this.entries.addAll(newEntries);
}

public Set<String> getEntryPivotValues() {
Expand Down

0 comments on commit f107667

Please sign in to comment.