Class ClassLoaders


  • public final class ClassLoaders
    extends Object
    • Constructor Detail

      • ClassLoaders

        public ClassLoaders()
    • Method Detail

      • assertRunIsUnloadableWithSupplier

        public static <T> void assertRunIsUnloadableWithSupplier​(Class<? extends ClassLoaders.ConsumerRunnable<T>> assertion,
                                                                 Class<? extends Supplier<? extends T>> supplier)
        Runs the assertion in a new classloader. Needed when you are creating parameterized tests
      • newInstance

        public static <T> T newInstance​(Class<T> type,
                                        ClassLoader loader)
        Validating instance creator that ensures the supplier type is static or top-level
      • assertRunIsUnloadable

        public static void assertRunIsUnloadable​(Class<? extends Runnable> runnable,
                                                 ClassLoader parent)
        Runs the type in a new classloader that recreates brave classes