Java Code Examples for jdk.test.lib.Asserts#assertGreaterThan()

The following examples show how to use jdk.test.lib.Asserts#assertGreaterThan() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestStateDuration.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Throwable {
    Duration duration = Duration.ofSeconds(2);
    Recording r = new Recording();
    r.setDuration(duration);
    CommonHelper.verifyRecordingState(r, RecordingState.NEW);
    Instant start = Instant.now();
    System.out.println("Recording with duration " + duration + " started at " + start);
    r.start();

    // Wait for recording to stop automatically
    System.out.println("Waiting for recording to reach STOPPED state");
    CommonHelper.waitForRecordingState(r, RecordingState.STOPPED);
    Instant stop = Instant.now();
    Duration measuredDuration = Duration.between(start, stop);
    System.out.println("Recording stopped at " + stop + ". Measured duration " + measuredDuration);
    // Timer task uses System.currentMillis, and java.time uses other source.
    Duration deltaDueToClockNotInSync = Duration.ofMillis(100);
    Asserts.assertGreaterThan(measuredDuration.plus(deltaDueToClockNotInSync), duration);
    verifyIllegalState(() -> r.start(), "start() after stop()");
    r.close();
    CommonHelper.verifyRecordingState(r, RecordingState.CLOSED);
}
 
Example 2
Source File: TestDumpState.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private static void checkEvents(Recording r, List<Integer> expectedIds) throws Exception {
    Path path = Paths.get(".", String.format("%d.jfr", recordingCounter++));
    r.dump(path);
    Asserts.assertTrue(Files.exists(path), "Recording file does not exist: " + path);

    int index = 0;

    for (RecordedEvent event : RecordingFile.readAllEvents(path)) {
        Events.isEventType(event, SimpleEvent.class.getName());
        Integer id = Events.assertField(event, "id").getValue();
        System.out.println("Got event with id " + id);
        Asserts.assertGreaterThan(expectedIds.size(), index, "Too many Events found");
        Asserts.assertEquals(id, expectedIds.get(index), "Wrong id at index " + index);
        ++index;
    }
    Asserts.assertEquals(index, expectedIds.size(), "Too few Events found");
}
 
Example 3
Source File: BmiIntrinsicBase.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static int countCpuInstructions(byte[] nativeCode, byte[] instrMask, byte[] instrPattern) {
    int count = 0;
    int patternSize = Math.min(instrMask.length, instrPattern.length);
    boolean found;
    Asserts.assertGreaterThan(patternSize, 0);
    for (int i = 0, n = nativeCode.length - patternSize; i < n; i++) {
        found = true;
        for (int j = 0; j < patternSize; j++) {
            if ((nativeCode[i + j] & instrMask[j]) != instrPattern[j]) {
                found = false;
                break;
            }
        }
        if (found) {
            ++count;
            i += patternSize - 1;
        }
    }
    return count;
}
 
Example 4
Source File: TestThreadCpuTimeEvent.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static void testCompareWithMXBean() throws Throwable {
    Duration testRunTime = Duration.ofMillis(eventPeriodMillis * cpuConsumerRunFactor);
    CyclicBarrier barrier = new CyclicBarrier(2);
    CpuConsumingThread thread = new CpuConsumingThread(testRunTime, barrier);
    thread.start();

    List<RecordedEvent> beforeEvents = generateEvents(2, barrier);
    verifyPerThreadInvariant(beforeEvents, cpuConsumerThreadName);

    // Run a second single pass
    barrier.await();
    barrier.await();

    ThreadMXBean bean = (ThreadMXBean) ManagementFactory.getThreadMXBean();
    Duration cpuTime = Duration.ofNanos(bean.getThreadCpuTime(thread.getId()));
    Duration userTime = Duration.ofNanos(bean.getThreadUserTime(thread.getId()));

    // Check something that should hold even in the presence of unfortunate scheduling
    Asserts.assertGreaterThanOrEqual(cpuTime.toMillis(), eventPeriodMillis);
    Asserts.assertGreaterThanOrEqual(userTime.toMillis(), eventPeriodMillis);

    Duration systemTimeBefore = getAccumulatedTime(beforeEvents, cpuConsumerThreadName, "system");
    Duration userTimeBefore = getAccumulatedTime(beforeEvents, cpuConsumerThreadName, "user");
    Duration cpuTimeBefore = userTimeBefore.plus(systemTimeBefore);

    Asserts.assertLessThan(cpuTimeBefore, cpuTime);
    Asserts.assertLessThan(userTimeBefore, userTime);
    Asserts.assertGreaterThan(cpuTimeBefore, Duration.ZERO);

    thread.interrupt();
    thread.join();
}
 
Example 5
Source File: TestGetTypeId.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    EventType type = EventType.getEventType(CustomEvent.class);

    SettingDescriptor plain = Events.getSetting(type, "plain");
    long plainId = plain.getTypeId();
    Asserts.assertGreaterThan(plainId, 0L);

    SettingDescriptor annotatedType = Events.getSetting(type, "annotatedType");
    long annotatedId = annotatedType.getTypeId();
    Asserts.assertGreaterThan(annotatedId, 0L);

    Asserts.assertNotEquals(annotatedId, plainId);

    SettingDescriptor newName = Events.getSetting(type, "newName");
    Asserts.assertEquals(newName.getTypeId(), annotatedId);

    SettingDescriptor overridden = Events.getSetting(type, "overridden");
    Asserts.assertEquals(overridden.getTypeId(), plainId);

    SettingDescriptor protectedBase = Events.getSetting(type, "protectedBase");
    Asserts.assertEquals(protectedBase.getTypeId(), plainId);

    SettingDescriptor publicBase = Events.getSetting(type, "publicBase");
    Asserts.assertEquals(publicBase.getTypeId(), annotatedId);

    SettingDescriptor packageProtectedBase = Events.getSetting(type, "packageProtectedBase");
    Asserts.assertEquals(packageProtectedBase.getTypeId(), plainId);

    CustomEvent.assertOnDisk((x, y) -> Long.compare(x.getTypeId(), y.getTypeId()));
}
 
Example 6
Source File: TestGetTypeId.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    EventType type = EventType.getEventType(CustomEvent.class);

    SettingDescriptor plain = Events.getSetting(type, "plain");
    long plainId = plain.getTypeId();
    Asserts.assertGreaterThan(plainId, 0L);

    SettingDescriptor annotatedType = Events.getSetting(type, "annotatedType");
    long annotatedId = annotatedType.getTypeId();
    Asserts.assertGreaterThan(annotatedId, 0L);

    Asserts.assertNotEquals(annotatedId, plainId);

    SettingDescriptor newName = Events.getSetting(type, "newName");
    Asserts.assertEquals(newName.getTypeId(), annotatedId);

    SettingDescriptor overridden = Events.getSetting(type, "overridden");
    Asserts.assertEquals(overridden.getTypeId(), plainId);

    SettingDescriptor protectedBase = Events.getSetting(type, "protectedBase");
    Asserts.assertEquals(protectedBase.getTypeId(), plainId);

    SettingDescriptor publicBase = Events.getSetting(type, "publicBase");
    Asserts.assertEquals(publicBase.getTypeId(), annotatedId);

    SettingDescriptor packageProtectedBase = Events.getSetting(type, "packageProtectedBase");
    Asserts.assertEquals(packageProtectedBase.getTypeId(), plainId);

    CustomEvent.assertOnDisk((x, y) -> Long.compare(x.getTypeId(), y.getTypeId()));
}
 
Example 7
Source File: TestSnapshot.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void testEmpty() throws IOException {
    FlightRecorder recorder = FlightRecorder.getFlightRecorder();
    Instant before = Instant.now().minusNanos(1);
    try (Recording snapshot = recorder.takeSnapshot()) {
        Instant after = Instant.now().plusNanos(1);
        Asserts.assertEquals(snapshot.getSize(), 0L);
        Asserts.assertLessThan(before, snapshot.getStartTime());
        Asserts.assertGreaterThan(after, snapshot.getStopTime());
        Asserts.assertEquals(snapshot.getStartTime(), snapshot.getStopTime());
        Asserts.assertEquals(snapshot.getDuration(), Duration.ZERO);
        assertStaticOptions(snapshot);
        Asserts.assertEquals(snapshot.getStream(null, null), null);
    }
}
 
Example 8
Source File: HeapSummaryEventAllGcs.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static int checkGcId(RecordedEvent event, int currGcId) {
    int gcId = Events.assertField(event, "gcId").getValue();
    String when = Events.assertField(event, "when").notEmpty().getValue();
    if ("Before GC".equals(when)) {
        Asserts.assertGreaterThan(gcId, currGcId, "gcId should be increasing");
    } else {
        Asserts.assertEquals(gcId, currGcId, "After should have same gcId as last Before event");
    }
    return gcId;
}
 
Example 9
Source File: TestBadOptionValues.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void testJlong(String prepend, String... options) throws Exception {
    String[] splitOption;

    Asserts.assertGreaterThan(options.length, 0);

    for (String option : options) {
        splitOption = option.split("=", 2);
        test(prepend, String.format("Integer parsing error in command argument '%s'. Could not parse: %s.",
            splitOption[0], splitOption.length > 1 ? splitOption[1]: ""), option);
    }
}
 
Example 10
Source File: TestBadOptionValues.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void testBoolean(String prepend, String... options) throws Exception {
    String[] splitOption;

    Asserts.assertGreaterThan(options.length, 0);

    for (String option : options) {
        splitOption = option.split("=", 2);
        test(prepend, String.format("Boolean parsing error in command argument '%s'. Could not parse: %s.", splitOption[0], splitOption[1]), option);
    }
}
 
Example 11
Source File: HeapSummaryEventAllGcs.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static int checkGcId(RecordedEvent event, int currGcId) {
    int gcId = Events.assertField(event, "gcId").getValue();
    String when = Events.assertField(event, "when").notEmpty().getValue();
    if ("Before GC".equals(when)) {
        Asserts.assertGreaterThan(gcId, currGcId, "gcId should be increasing");
    } else {
        Asserts.assertEquals(gcId, currGcId, "After should have same gcId as last Before event");
    }
    return gcId;
}
 
Example 12
Source File: TestThreadCpuTimeEvent.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static void testCompareWithMXBean() throws Throwable {
    Duration testRunTime = Duration.ofMillis(eventPeriodMillis * cpuConsumerRunFactor);
    CyclicBarrier barrier = new CyclicBarrier(2);
    CpuConsumingThread thread = new CpuConsumingThread(testRunTime, barrier);
    thread.start();

    List<RecordedEvent> beforeEvents = generateEvents(2, barrier);
    verifyPerThreadInvariant(beforeEvents, cpuConsumerThreadName);

    // Run a second single pass
    barrier.await();
    barrier.await();

    ThreadMXBean bean = (ThreadMXBean) ManagementFactory.getThreadMXBean();
    Duration cpuTime = Duration.ofNanos(bean.getThreadCpuTime(thread.getId()));
    Duration userTime = Duration.ofNanos(bean.getThreadUserTime(thread.getId()));

    // Check something that should hold even in the presence of unfortunate scheduling
    Asserts.assertGreaterThanOrEqual(cpuTime.toMillis(), eventPeriodMillis);
    Asserts.assertGreaterThanOrEqual(userTime.toMillis(), eventPeriodMillis);

    Duration systemTimeBefore = getAccumulatedTime(beforeEvents, cpuConsumerThreadName, "system");
    Duration userTimeBefore = getAccumulatedTime(beforeEvents, cpuConsumerThreadName, "user");
    Duration cpuTimeBefore = userTimeBefore.plus(systemTimeBefore);

    Asserts.assertLessThan(cpuTimeBefore, cpuTime);
    Asserts.assertLessThan(userTimeBefore, userTime);
    Asserts.assertGreaterThan(cpuTimeBefore, Duration.ZERO);

    thread.interrupt();
    thread.join();
}
 
Example 13
Source File: FileHelper.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void verifyRecording(File file) throws Exception {
    Asserts.assertTrue(file.exists(), file.getAbsolutePath() + " does not exist");
    Asserts.assertTrue(file.isFile(), file.getAbsolutePath() + " is not a file");
    Asserts.assertGreaterThan(file.length(), 0L, "Size of recording is 0.");
    List<RecordedEvent> events = RecordingFile.readAllEvents(file.toPath());
    for (RecordedEvent event : events) {
        System.out.printf("First event in recording '%s':%n%s", file.getName(), event);
        return;
    }
    Asserts.fail("No events in file " + file.getName());
}
 
Example 14
Source File: TestSnapshot.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void testOngoing(boolean disk) throws IOException {
    FlightRecorder recorder = FlightRecorder.getFlightRecorder();
    try (Recording r = new Recording()) {
        r.setToDisk(disk);
        r.enable(SimpleEvent.class);
        r.start();
        SimpleEvent se = new SimpleEvent();
        se.commit();

        try (Recording snapshot = recorder.takeSnapshot()) {

            Asserts.assertGreaterThan(snapshot.getSize(), 0L);
            Asserts.assertGreaterThanOrEqual(snapshot.getStartTime(), r.getStartTime());
            Asserts.assertGreaterThanOrEqual(snapshot.getStopTime(), r.getStartTime());
            Asserts.assertGreaterThanOrEqual(snapshot.getDuration(), Duration.ZERO);
            assertStaticOptions(snapshot);
            try (InputStream is = snapshot.getStream(null, null)) {
                Asserts.assertNotNull(is);
            }

            List<RecordedEvent> events = Events.fromRecording(snapshot);
            Events.hasEvents(events);
            Asserts.assertEquals(events.size(), 1);
            Asserts.assertEquals(events.get(0).getEventType().getName(), SimpleEvent.class.getName());
        }

        r.stop();
    }
}
 
Example 15
Source File: TestPeriod.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private static void verifyDelta(long actual, long expected) {
    System.out.printf("verifyDelta: actaul=%d, expected=%d (errorMargin=%d)%n", actual, expected, ERROR_MARGIN);
    Asserts.assertGreaterThan(actual, expected - ERROR_MARGIN, "period delta too short");
}
 
Example 16
Source File: TestGetStackTraceId.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void assertValid(long value) {
    Asserts.assertGreaterThan(value, 0L, "Stack trace id must be greater than 0, was " + value);
}
 
Example 17
Source File: TestRecordedClassLoader.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    Recording recording = new Recording();
    recording.enable(EVENT_NAME).withoutStackTrace();
    TestClassLoader cl = new TestClassLoader();
    recording.start();
    cl.loadClass(TEST_CLASS_NAME);
    recording.stop();

    List<RecordedEvent> events = Events.fromRecording(recording);
    boolean isDefined = false;
    for (RecordedEvent event : events) {
        RecordedClass definedClass = event.getValue("definedClass");
        if (TEST_CLASS_NAME.equals(definedClass.getName())) {
            System.out.println(event);

            // get the RecordedClassLoader from the RecordedClass, the "definedClass"
            RecordedClassLoader definingClassLoader = definedClass.getClassLoader();
            Asserts.assertNotNull(definingClassLoader, "Defining Class Loader should not be null");

            // invoke RecordedClassLoader.getType() in order to validate the type of the RecordedClassLoader
            RecordedClass definingClassLoaderType = definingClassLoader.getType();
            Asserts.assertNotNull(definingClassLoaderType, "The defining Class Loader type should not be null");

            // verify matching types
            Asserts.assertEquals(cl.getClass().getName(), definingClassLoaderType.getName(),
                "Expected type " + cl.getClass().getName() + ", got type " + definingClassLoaderType.getName());

            // get a RecordedClassLoader directly from the "definingClassLoader" field as well
            RecordedClassLoader definingClassLoaderFromField = event.getValue("definingClassLoader");
            Asserts.assertNotNull(definingClassLoaderFromField,
                "Defining Class Loader instantatiated from field should not be null");

            // ensure that the class loader instance used in the test actually has a name
            //Asserts.assertNotNull(cl.getName(),
              //  "Expected a valid name for the TestClassLoader");

            // invoke RecordedClassLoader.getName() to get the name of the class loader instance
            //Asserts.assertEquals(cl.getName(), definingClassLoader.getName(),
              //  "Defining Class Loader should have the same name as the original class loader");
            Asserts.assertEquals(definingClassLoaderFromField.getName(), definingClassLoader.getName(),
                "Defining Class Loader representations should have the same class loader name");

            // invoke uniqueID()
            Asserts.assertGreaterThan(definingClassLoader.getId(), 0L, "Invalid id assignment");

            // second order class loader information ("check class loader of the class loader")
            RecordedClassLoader classLoaderOfDefClassLoader = definingClassLoaderType.getClassLoader();
            Asserts.assertNotNull(classLoaderOfDefClassLoader,
                "The class loader for the definining class loader should not be null");
           // Asserts.assertEquals(cl.getClass().getClassLoader().getName(), classLoaderOfDefClassLoader.getName(),
             //   "Expected class loader name " + cl.getClass().getClassLoader().getName() + ", got name " + classLoaderOfDefClassLoader.getName());

            RecordedClass classLoaderOfDefClassLoaderType = classLoaderOfDefClassLoader.getType();
            Asserts.assertNotNull(classLoaderOfDefClassLoaderType,
                "The class loader type for the defining class loader should not be null");
            Asserts.assertEquals(cl.getClass().getClassLoader().getClass().getName(), classLoaderOfDefClassLoaderType.getName(),
                "Expected type " + cl.getClass().getClassLoader().getClass().getName() + ", got type " + classLoaderOfDefClassLoaderType.getName());

            Asserts.assertGreaterThan(definingClassLoader.getId(), classLoaderOfDefClassLoader.getId(),
                "expected id assignment invariant broken for Class Loaders");

            isDefined = true;
        }
    }
    Asserts.assertTrue(isDefined, "No class define event found to verify RecordedClassLoader");
}
 
Example 18
Source File: TestHumongousMovement.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {

        int g1RegionSize = WB.g1RegionSize();
        int byteArrayMemoryOverhead = Helpers.detectByteArrayAllocationOverhead();

        System.out.println("Total " + WB.g1NumMaxRegions() + " regions");
        System.out.println("Total " + WB.g1NumFreeRegions() + " free regions");

        int regionsToAllocate = (int) (WB.g1NumFreeRegions() * ALLOCATED_HUMONGOUS_REGIONS_FACTOR);

        // Sanity check
        Asserts.assertGreaterThan(regionsToAllocate, 0, "Test Bug: no regions to allocate");

        System.out.println("Allocating " + regionsToAllocate + " humongous objects, each 90% of g1 region size");

        List<AllocationData> allocations = new ArrayList<>();

        // 90 % of maximum byte[] that takes one region
        int hSize = (int) ((g1RegionSize - byteArrayMemoryOverhead) * 0.9);

        // Sanity check
        Asserts.assertGreaterThan(hSize, g1RegionSize / 2, "Test Bug: allocation size is not humongous");

        for (int i = 0; i < regionsToAllocate; ++i) {
            allocations.add(new AllocationData(new byte[hSize]));
        }

        Random rnd = Utils.getRandomInstance();

        int toDelete = (int) (allocations.size() * HUMONGOUS_OBJECTS_DELETED_FACTOR);

        for (int i = 0; i < toDelete; ++i) {
            allocations.remove(rnd.nextInt(allocations.size()));
        }

        WB.fullGC();

        List<AllocationData> movedObjects = allocations.stream()
                .filter(AllocationData::isAddressChanged)
                .collect(Collectors.toList());

        if (movedObjects.size() > 0) {
            System.out.println("Test failed - some humongous objects moved after Full GC");
            movedObjects.stream().forEach(a -> a.printDetails(System.out));
            throw new Error("Test failed - some humongous objects moved after Full GC");
        } else {
            System.out.println("Passed");
        }
    }
 
Example 19
Source File: TestPeriod.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void verifyDelta(long actual, long expected) {
    System.out.printf("verifyDelta: actaul=%d, expected=%d (errorMargin=%d)%n", actual, expected, ERROR_MARGIN);
    Asserts.assertGreaterThan(actual, expected - ERROR_MARGIN, "period delta too short");
}
 
Example 20
Source File: TestRecordedClassLoader.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    Recording recording = new Recording();
    recording.enable(EVENT_NAME).withoutStackTrace();
    TestClassLoader cl = new TestClassLoader();
    recording.start();
    cl.loadClass(TEST_CLASS_NAME);
    recording.stop();

    List<RecordedEvent> events = Events.fromRecording(recording);
    boolean isDefined = false;
    for (RecordedEvent event : events) {
        RecordedClass definedClass = event.getValue("definedClass");
        if (TEST_CLASS_NAME.equals(definedClass.getName())) {
            System.out.println(event);

            // get the RecordedClassLoader from the RecordedClass, the "definedClass"
            RecordedClassLoader definingClassLoader = definedClass.getClassLoader();
            Asserts.assertNotNull(definingClassLoader, "Defining Class Loader should not be null");

            // invoke RecordedClassLoader.getType() in order to validate the type of the RecordedClassLoader
            RecordedClass definingClassLoaderType = definingClassLoader.getType();
            Asserts.assertNotNull(definingClassLoaderType, "The defining Class Loader type should not be null");

            // verify matching types
            Asserts.assertEquals(cl.getClass().getName(), definingClassLoaderType.getName(),
                "Expected type " + cl.getClass().getName() + ", got type " + definingClassLoaderType.getName());

            // get a RecordedClassLoader directly from the "definingClassLoader" field as well
            RecordedClassLoader definingClassLoaderFromField = event.getValue("definingClassLoader");
            Asserts.assertNotNull(definingClassLoaderFromField,
                "Defining Class Loader instantatiated from field should not be null");

            // ensure that the class loader instance used in the test actually has a name
            //Asserts.assertNotNull(cl.getName(),
              //  "Expected a valid name for the TestClassLoader");

            // invoke RecordedClassLoader.getName() to get the name of the class loader instance
            //Asserts.assertEquals(cl.getName(), definingClassLoader.getName(),
              //  "Defining Class Loader should have the same name as the original class loader");
            Asserts.assertEquals(definingClassLoaderFromField.getName(), definingClassLoader.getName(),
                "Defining Class Loader representations should have the same class loader name");

            // invoke uniqueID()
            Asserts.assertGreaterThan(definingClassLoader.getId(), 0L, "Invalid id assignment");

            // second order class loader information ("check class loader of the class loader")
            RecordedClassLoader classLoaderOfDefClassLoader = definingClassLoaderType.getClassLoader();
            Asserts.assertNotNull(classLoaderOfDefClassLoader,
                "The class loader for the definining class loader should not be null");
           // Asserts.assertEquals(cl.getClass().getClassLoader().getName(), classLoaderOfDefClassLoader.getName(),
             //   "Expected class loader name " + cl.getClass().getClassLoader().getName() + ", got name " + classLoaderOfDefClassLoader.getName());

            RecordedClass classLoaderOfDefClassLoaderType = classLoaderOfDefClassLoader.getType();
            Asserts.assertNotNull(classLoaderOfDefClassLoaderType,
                "The class loader type for the defining class loader should not be null");
            Asserts.assertEquals(cl.getClass().getClassLoader().getClass().getName(), classLoaderOfDefClassLoaderType.getName(),
                "Expected type " + cl.getClass().getClassLoader().getClass().getName() + ", got type " + classLoaderOfDefClassLoaderType.getName());

            Asserts.assertGreaterThan(definingClassLoader.getId(), classLoaderOfDefClassLoader.getId(),
                "expected id assignment invariant broken for Class Loaders");

            isDefined = true;
        }
    }
    Asserts.assertTrue(isDefined, "No class define event found to verify RecordedClassLoader");
}