Skip to content

Commit

Permalink
fix: addressing reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhatha committed May 29, 2024
1 parent 3b982a4 commit af836b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.Calendar;
import java.util.HashMap;
import java.util.Locale;
import java.util.Objects;
import java.util.TimeZone;

import org.apache.arrow.memory.BufferAllocator;
Expand Down Expand Up @@ -90,17 +89,17 @@ public void testConfig() {
JdbcToArrowConfigBuilder builder = new JdbcToArrowConfigBuilder(allocator, calendar);
JdbcToArrowConfig config = builder.build();

assertTrue(Objects.equals(allocator, config.getAllocator()));
assertTrue(Objects.equals(calendar, config.getCalendar()));
assertEquals(allocator, config.getAllocator());
assertEquals(calendar, config.getCalendar());

Calendar newCalendar = Calendar.getInstance();
BufferAllocator newAllocator = new RootAllocator(Integer.SIZE);

builder.setAllocator(newAllocator).setCalendar(newCalendar);
config = builder.build();

assertTrue(Objects.equals(newAllocator, config.getAllocator()));
assertTrue(Objects.equals(newCalendar, config.getCalendar()));
assertEquals(newAllocator, config.getAllocator());
assertEquals(newCalendar, config.getCalendar());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,8 @@ public void testMemoryLeakWithReservation() throws Exception {
"child2", 1024, MAX_ALLOCATION);
rootAllocator.verify();

childAllocator2.buffer(256);

Exception exception = assertThrows(IllegalStateException.class, () -> {
childAllocator2.close();
});
Expand Down

0 comments on commit af836b1

Please sign in to comment.