Class ExpectNewDemo

java.lang.Object
samples.expectnew.ExpectNewDemo

public class ExpectNewDemo extends Object
  • Field Details

    • dummyField

      private int dummyField
  • Constructor Details

    • ExpectNewDemo

      public ExpectNewDemo()
  • Method Details

    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getMessage

      public String getMessage()
    • getMessageWithArgument

      public 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 String multipleNew()
    • simpleMultipleNew

      public void simpleMultipleNew()
    • simpleMultipleNewPrivate

      private void simpleMultipleNewPrivate()
    • simpleSingleNew

      public void simpleSingleNew()
    • makeDate

      public Date makeDate()
    • fileExists

      public boolean fileExists(String name)
    • alternativePath

      public InputStream alternativePath()
    • newWithArguments

      public String newWithArguments(Service service, int times)
    • newWithWrongArguments

      public String newWithWrongArguments(Service service, int times)
    • newVarArgs

      public String[] newVarArgs(String... strings)
    • newVarArgs

      public Service[] newVarArgs(Service... services)
    • newVarArgs

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

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

      public byte[][] newVarArgsWithMatchers()
    • fileWriter

      public void fileWriter(String name, String msg) throws IOException
      Throws:
      IOException
    • fileWriterPrint

      public void fileWriterPrint(String name, String msg) throws IOException
      Throws:
      IOException
    • newSimpleVarArgs

      public byte[][] newSimpleVarArgs(byte[]... bytes)
    • createTarget

      public Target createTarget(ITarget target)
    • getTargetName

      private String getTargetName(ITarget target)