Class ExpectNewDemo


  • public class ExpectNewDemo
    extends java.lang.Object
    • Field Detail

      • dummyField

        private int dummyField
    • Constructor Detail

      • ExpectNewDemo

        public ExpectNewDemo()
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getMessage

        public java.lang.String getMessage()
      • getMessageWithArgument

        public java.lang.String getMessageWithArgument()
      • invokeVoidMethod

        public void invokeVoidMethod()
      • throwExceptionWhenInvoction

        public void throwExceptionWhenInvoction()
        The purpose of the method is to demonstrate that a test case can mock the new instance call and throw an exception upon instantiation.
      • throwExceptionAndWrapInRunTimeWhenInvoction

        public void throwExceptionAndWrapInRunTimeWhenInvoction()
        The purpose of the method is to demonstrate that a test case can mock the new instance call and throw an exception upon instantiation.
      • multipleNew

        public java.lang.String multipleNew()
      • simpleMultipleNew

        public void simpleMultipleNew()
      • simpleMultipleNewPrivate

        private void simpleMultipleNewPrivate()
      • simpleSingleNew

        public void simpleSingleNew()
      • makeDate

        public java.util.Date makeDate()
      • fileExists

        public boolean fileExists​(java.lang.String name)
      • alternativePath

        public java.io.InputStream alternativePath()
      • newWithArguments

        public java.lang.String newWithArguments​(Service service,
                                                 int times)
      • newWithWrongArguments

        public java.lang.String newWithWrongArguments​(Service service,
                                                      int times)
      • newVarArgs

        public java.lang.String[] newVarArgs​(java.lang.String... strings)
      • newVarArgs

        public int[] newVarArgs​(float myFloat,
                                int... ints)
      • newVarArgs

        public byte[][] newVarArgs​(byte[]... bytes)
      • newVarArgsWithMatchers

        public byte[][] newVarArgsWithMatchers()
      • fileWriter

        public void fileWriter​(java.lang.String name,
                               java.lang.String msg)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • fileWriterPrint

        public void fileWriterPrint​(java.lang.String name,
                                    java.lang.String msg)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • newSimpleVarArgs

        public byte[][] newSimpleVarArgs​(byte[]... bytes)
      • getTargetName

        private java.lang.String getTargetName​(ITarget target)