Package samples.expectnew
Class ExpectNewDemo
java.lang.Object
samples.expectnew.ExpectNewDemo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
fileExists
(String name) void
fileWriter
(String name, String msg) void
fileWriterPrint
(String name, String msg) int
hashCode()
void
makeDate()
byte[][]
newVarArgs
(byte[]... bytes) int[]
newVarArgs
(float myFloat, int... ints) String[]
newVarArgs
(String... strings) Service[]
newVarArgs
(Service... services) byte[][]
newWithArguments
(Service service, int times) newWithWrongArguments
(Service service, int times) void
private void
void
void
The purpose of the method is to demonstrate that a test case can mock the new instance call and throw an exception upon instantiation.void
The purpose of the method is to demonstrate that a test case can mock the new instance call and throw an exception upon instantiation.
-
Field Details
-
dummyField
private int dummyField
-
-
Constructor Details
-
ExpectNewDemo
public ExpectNewDemo()
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getMessage
-
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
-
simpleMultipleNew
public void simpleMultipleNew() -
simpleMultipleNewPrivate
private void simpleMultipleNewPrivate() -
simpleSingleNew
public void simpleSingleNew() -
makeDate
-
fileExists
-
alternativePath
-
newWithArguments
-
newWithWrongArguments
-
newVarArgs
-
newVarArgs
-
newVarArgs
public int[] newVarArgs(float myFloat, int... ints) -
newVarArgs
public byte[][] newVarArgs(byte[]... bytes) -
newVarArgsWithMatchers
public byte[][] newVarArgsWithMatchers() -
fileWriter
- Throws:
IOException
-
fileWriterPrint
- Throws:
IOException
-