Class BytemanTestHelper


  • public class BytemanTestHelper
    extends Helper
    Helper class containing functions used by Byteman rules created by the dtest framework.
    • Field Detail

      • RMIREGISTRY_PORT_PROPERTY_NAME

        public static final java.lang.String RMIREGISTRY_PORT_PROPERTY_NAME
        See Also:
        Constant Field Values
      • targetInstances

        private static java.util.Map<java.lang.String,​java.util.Map<java.lang.Object,​java.lang.Integer>> targetInstances
      • registry

        private static java.rmi.registry.Registry registry
    • Constructor Detail

      • BytemanTestHelper

        public BytemanTestHelper​(Rule rule)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • debug

        public boolean debug​(java.lang.String text,
                             java.lang.Object object0)
        Print a message during rule execution. n.b. this always returns true which means it can be invoked during condition execution
        Parameters:
        text - the message to be printed as trace output
        object0 - an object, typically the rule target, whose String representation will be added to the output.
        Returns:
        true
      • remoteTrace

        public void remoteTrace​(java.lang.String className,
                                java.lang.String methodName,
                                java.lang.Object[] dollarStar)
                         throws java.lang.Exception
        Send trace information to a remote listener. A Rule will normally be installed to invoke this on entry to each method of interest.
        Parameters:
        className - the name of the instrumented, i.e. traced, class
        methodName - the name of the traced method.
        dollarStar - the method args starting with this
        Throws:
        java.lang.Exception - if the info cannot be sent
        See Also:
        InstrumentedClass#trace
      • convertForRemoting

        private java.lang.Object[] convertForRemoting​(java.lang.Object[] input)
        Convert Objects to their String representation for transmission over RMI.
        Parameters:
        input - An Array of Objects, possibly including nulls.
        Returns:
        An Array of length equivalent to the input, containing corresponding nulls or the String representation of the input.