- Common ways to obtain MemoryInformationData
private void myMethod () {}
@Test void freeMemoryIsCalculated() { this.mockCollectorWithDefaults(); when(this.osBean.getFreePhysicalMemorySize()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L); this.cut.gather(); this.cut.gather(); this.cut.gather(); this.cut.gather(); MemoryInformationData collector = (MemoryInformationData) this.cut.get(); assertThat(collector.getMinFreePhysMemory(), is(9L)); assertThat(collector.getMaxFreePhysMemory(), is(11L)); assertThat(collector.getTotalFreePhysMemory(), is(40L)); }
assertThat(memoryInformationData.getMaxFreePhysMemory(), is(0L));
assertThat(memoryInformationData.getMaxFreePhysMemory(), is(6L));
} else if (freePhysMemory > this.memoryInformationData.getMaxFreePhysMemory()) { this.memoryInformationData.setMaxFreePhysMemory(freePhysMemory);
newMemoryInformationData.setMaxFreePhysMemory(this.memoryInformationData.getMaxFreePhysMemory());