|
1 |
| package com.agical.rmock.core.exception; |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| public class NoSuchMethodException extends RMockSystemException { |
|
10 |
| private static final long serialVersionUID = 1L; |
|
11 |
| |
|
12 |
2
| public NoSuchMethodException(Class clazz, String methodName, Object[] arguments) {
|
|
13 |
2
| super( "Could not find method with name " + methodName + " for class " + clazz.getName() +
|
|
14 |
| " for parameters " + getParameters( arguments ) |
|
15 |
| ); |
|
16 |
| } |
|
17 |
| |
|
18 |
2
| private static String getParameters(Object[] arguments) {
|
|
19 |
2
| StringBuffer buffer = new StringBuffer("[");
|
|
20 |
2
| for (int i = 0; i < arguments.length; i++) {
|
|
21 |
0
| Object object = arguments[i];
|
|
22 |
0
| buffer.append("<" ).append( object.toString() ).append( "> " );
|
|
23 |
| } |
|
24 |
2
| buffer.append( "]" );
|
|
25 |
2
| return buffer.toString();
|
|
26 |
| } |
|
27 |
| |
|
28 |
| } |