-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Java 19 build #2478
Merged
Merged
Fix Java 19 build #2478
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f3dda21
Fix Java 19 build
geofjamg a92bf81
Wip
geofjamg dd5485c
Adapt timeseries tests to avoid mockito on ByteBuffer failing on java19
jonenst 0b5efdd
Fix
geofjamg 894cfef
Merge branch 'main' into fix_java19_build
geofjamg 5b0cf6f
Fix
geofjamg e63d9e6
timeseries, implement BigDoubleBuffer and BigStringBuffer with testab…
jonenst 1c7eecd
Merge branch 'main' into fix_java19_build
geofjamg 1207a2c
Use parent 10
geofjamg 4c8929b
Revert CI
geofjamg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
time-series/time-series-api/src/test/java/com/powsybl/timeseries/AbstractBigBufferTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Copyright (c) 2023, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package com.powsybl.timeseries; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.AfterEach; | ||
|
||
import java.nio.file.StandardOpenOption; | ||
import java.nio.channels.FileChannel; | ||
import java.nio.ByteBuffer; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
import java.util.List; | ||
import java.util.ArrayList; | ||
|
||
/** | ||
* @author Jon Harper <jon.harper at rte-france.com> | ||
*/ | ||
abstract class AbstractBigBufferTest { | ||
|
||
private Path tempdir; | ||
protected List<FileChannel> channels; | ||
|
||
protected ByteBuffer testAllocator(int capacity) { | ||
try { | ||
FileChannel channel = FileChannel.open( | ||
tempdir.resolve(Integer.toString(channels.size())), | ||
StandardOpenOption.READ, StandardOpenOption.WRITE, | ||
StandardOpenOption.CREATE_NEW, StandardOpenOption.SPARSE, | ||
StandardOpenOption.DELETE_ON_CLOSE); | ||
channels.add(channel); | ||
ByteBuffer bytebuffer = channel.map(FileChannel.MapMode.PRIVATE, 0, capacity); | ||
return bytebuffer; | ||
} catch (Exception e) { | ||
throw new RuntimeException("error in allocator test", e); | ||
} | ||
} | ||
|
||
@BeforeEach | ||
void before() throws Exception { | ||
tempdir = Files.createTempDirectory("powsybltimeseriestest"); | ||
channels = new ArrayList<>(); | ||
} | ||
|
||
@AfterEach | ||
void after() throws Exception { | ||
for (FileChannel channel : channels) { | ||
channel.close(); | ||
} | ||
Files.delete(tempdir); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonenst On Windows test failed because directory is not empty. So a real file has been created on the file system even in private map mode.