You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that there is issue with delete operation for chronicle files, what's complicating tests (problem with creating namy test in one unit for the same chronicle)
it is test example
public class CloseChronicleTest {
@Test
public void simpleChronicleTest1() throws IOException {
final String basePath = "simpleTest";
deleteAndAssert(basePath);
IndexedChronicle chronicle = new IndexedChronicle(basePath);
chronicle.close();
deleteAndAssert(basePath);
}
@Test
public void simpleChronicleTest2() throws IOException {
final String basePath = "simpleTest";
deleteAndAssert(basePath);
IndexedChronicle chronicle = new IndexedChronicle(basePath);
ExcerptAppender appender = chronicle.createAppender();
appender.close();
chronicle.close();
// it must be called because of JDK-6558368
System.gc();
deleteAndAssert(basePath);
}
private void deleteAndAssert(String basePath) throws IOException {
for (String name : new String[] { basePath + ".data", basePath + ".index" }) {
File file = new File(name);
if (file.exists()) {
Assert.assertTrue(file.getCanonicalPath(), file.delete());
}
}
}
}
Resource related issues have already been solved however I've added your test case to our tests.
If you easilly want to define a per-test path you can do something like:
I noticed that there is issue with delete operation for chronicle files, what's complicating tests (problem with creating namy test in one unit for the same chronicle)
it is test example
it seems that it could be working, but we need to nullified mappedbuffer in two classes.
What do you think about it? IMHO it would make testing easier.
Check out:
https://github.com/pwielgolaski/Java-Chronicle/commit/2735c21d277c55252e9cde6a4e26fafc98997227
The text was updated successfully, but these errors were encountered: