Class HotSwapper


  • public class HotSwapper
    extends Object
    Created by bubnik on 22.5.2014.
    • Constructor Detail

      • HotSwapper

        public HotSwapper()
    • Method Detail

      • swapClasses

        public static void swapClasses​(Class original,
                                       String swap)
                                throws Exception
        Swap class definition from another class file.

        This is mainly useful for unit testing - declare multiple version of a class and then hotswap definition and do the tests.

        Parameters:
        original - original class currently in use
        swap - fully qualified class name of class to swap
        Throws:
        Exception - swap exception