@Test void collectorClassIsResetted() throws Exception { ClassLoadingInformationData collector = (ClassLoadingInformationData) this.cut.getSystemSensorData(); this.cut.reset(); ClassLoadingInformationData classLoadingInformationData = (ClassLoadingInformationData) this.cut.get();
@Test void getNewClassLoadingInformationData() throws Exception { ClassLoadingInformationData collector = (ClassLoadingInformationData) this.cut.getSystemSensorData(); ClassLoadingInformationData classLoadingInformationData = (ClassLoadingInformationData) this.cut.get();
int loadedClassCount = this.getRuntimeBean().getLoadedClassCount(); long totalLoadedClassCount = this.getRuntimeBean().getTotalLoadedClassCount(); long unloadedClassCount = this.getRuntimeBean().getUnloadedClassCount();
@Test void unloadedClassCountIsCalculated() { when(this.runtimeBean.getUnloadedClassCount()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L); this.cut.gather(); this.cut.gather(); this.cut.gather(); this.cut.gather(); ClassLoadingInformationData collector = (ClassLoadingInformationData) this.cut.get(); assertThat(collector.getMinUnloadedClassCount(), is(9L)); assertThat(collector.getMaxUnloadedClassCount(), is(11L)); assertThat(collector.getTotalUnloadedClassCount(), is(40L)); }
@Test void loadedClassCountIsCalculated() { when(this.runtimeBean.getLoadedClassCount()).thenReturn(10).thenReturn(9).thenReturn(11).thenReturn(10); this.cut.gather(); this.cut.gather(); this.cut.gather(); this.cut.gather(); ClassLoadingInformationData collector = (ClassLoadingInformationData) this.cut.get(); assertThat(collector.getMinLoadedClassCount(), is(9)); assertThat(collector.getMaxLoadedClassCount(), is(11)); assertThat(collector.getTotalLoadedClassCount(), is(40)); }
@Test void totalLoadedClassCountIsCalculated() { when(this.runtimeBean.getTotalLoadedClassCount()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L); this.cut.gather(); this.cut.gather(); this.cut.gather(); this.cut.gather(); ClassLoadingInformationData collector = (ClassLoadingInformationData) this.cut.get(); assertThat(collector.getMinTotalLoadedClassCount(), is(9L)); assertThat(collector.getMaxTotalLoadedClassCount(), is(11L)); assertThat(collector.getTotalTotalLoadedClassCount(), is(40L)); }