Skip to content

Commit

Permalink
Minor cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhaeubl committed Mar 27, 2024
1 parent f0a6a9c commit 83b936a
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@

package com.oracle.svm.test.jfr;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.util.List;

import jdk.jfr.consumer.RecordedObject;
import org.junit.Test;

import com.oracle.svm.core.jfr.JfrEvent;

import jdk.jfr.Recording;
import jdk.jfr.consumer.RecordedEvent;
import jdk.jfr.consumer.RecordedObject;

public class TestGCHeapSummaryEvent extends JfrRecordingTest {
@Test
Expand All @@ -52,11 +53,13 @@ private static void validateEvents(List<RecordedEvent> events) {
assertTrue(events.size() > 0);
for (RecordedEvent event : events) {
RecordedObject heapSpace = event.getValue("heapSpace");
assertTrue(heapSpace.getLong("start") == -1);
assertTrue(heapSpace.getLong("committedEnd") == -1);
assertTrue(heapSpace.getLong("reservedEnd") == -1);
assertTrue(heapSpace.getLong("committedSize") > 0);
assertTrue(heapSpace.getLong("reservedSize") >= heapSpace.getLong("committedSize"));
assertEquals(-1, heapSpace.getLong("start"));
assertEquals(-1, heapSpace.getLong("committedEnd"));
assertEquals(-1, heapSpace.getLong("reservedEnd"));

long committedSize = heapSpace.getLong("committedSize");
assertTrue(committedSize > 0);
assertTrue(heapSpace.getLong("reservedSize") >= committedSize);
assertTrue(event.getLong("gcId") >= 0);
assertTrue(event.getString("when").equals("Before GC") || event.getString("when").equals("After GC"));
assertTrue(event.getLong("heapUsed") > 0);
Expand Down

0 comments on commit 83b936a

Please sign in to comment.