Class ExpectNewDemo
java.lang.Object
samples.expectnew.ExpectNewDemo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateTarget(ITarget target) booleanbooleanfileExists(String name) voidfileWriter(String name, String msg) voidfileWriterPrint(String name, String msg) private StringgetTargetName(ITarget target) inthashCode()voidmakeDate()byte[][]newSimpleVarArgs(byte[]... bytes) 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) voidprivate voidvoidvoidThe purpose of the method is to demonstrate that a test case can mock the new instance call and throw an exception upon instantiation.voidThe 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
-
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
-
newSimpleVarArgs
public byte[][] newSimpleVarArgs(byte[]... bytes) -
createTarget
-
getTargetName
-