Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ public void canRunSimpleSelectFromThreadSleep() throws Exception {
assertThat(rs.getLong(2)).isEqualTo(1_000_000_000L);
assertThat(rs.getString(3)).isEqualTo("main");

assertThat(rs.getString(4)).isEqualTo("""
assertThat(rs.getString(4)).isEqualTo(fixNewlines("""
java.lang.Thread.sleep(long)
org.moditect.jfrunit.demos.todo.HelloJfrUnitTest.basicTest():24
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Method, Object, Object[])
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Object, Object[]):77
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Object, Object[]):43
java.lang.reflect.Method.invoke(Object, Object[]):568
org.junit.platform.commons.util.ReflectionUtils.invokeMethod(Method, Object, Object[]):688
""");
"""));
assertThat(rs.next()).isFalse();
}
}
Expand Down Expand Up @@ -175,7 +175,7 @@ public void canRunSimpleSelectFromClassLoad() throws Exception {
assertThat(rs.next()).isTrue();

assertThat(rs.getTimestamp(1)).isEqualTo(Timestamp.from(ZonedDateTime.parse("2021-12-26T17:32:45.428000000+01:00").toInstant()));
assertThat(rs.getString(2)).isEqualTo("""
assertThat(rs.getString(2)).isEqualTo(fixNewlines("""
{
classLoader = null
name = "java/lang/Throwable"
Expand All @@ -192,14 +192,18 @@ public void canRunSimpleSelectFromClassLoad() throws Exception {
modifiers = 33
hidden = false
}
""");
"""));
assertThat(rs.getString(3)).isEqualTo("platform");
assertThat(rs.getString(4)).isEqualTo("bootstrap");
assertThat(rs.next()).isFalse();
}
}
}

static String fixNewlines(String s) {
return s.replace("\n", String.format("%n"));
}

@Test
public void canUseGetClassNameFunction() throws Exception {
try (Connection connection = getConnection("class-loading.jfr")) {
Expand Down