1
1
/**
2
2
* This is a helper class to be able to run the tests for this exercise.
3
3
* The tests are located in the {@link GameMasterTest} class.
4
+ *
4
5
* @see GameMasterTest
5
6
*/
6
7
public class GameMasterProxy extends ReflectionProxy {
@@ -11,50 +12,23 @@ public String getTargetClassName() {
11
12
}
12
13
13
14
public String describe (Character character ) {
14
- try {
15
- return invokeMethod ("describe" , new Class []{Character .class }, character );
16
- } catch (Exception e ) {
17
- throw new UnsupportedOperationException ("Please implement the 'describe(Character character)' " +
18
- "method" );
19
- }
15
+ return invokeMethod ("describe" , new Class [] { Character .class }, character );
20
16
}
21
17
22
18
public String describe (Destination character ) {
23
- try {
24
- return invokeMethod ("describe" , new Class []{Destination .class }, character );
25
- } catch (Exception e ) {
26
- throw new UnsupportedOperationException ("Please implement the 'describe(Destination destination)' " +
27
- "method" );
28
- }
19
+ return invokeMethod ("describe" , new Class [] { Destination .class }, character );
29
20
}
30
21
31
22
public String describe (TravelMethod character ) {
32
- try {
33
- return invokeMethod ("describe" , new Class []{TravelMethod .class }, character );
34
- } catch (Exception e ) {
35
- throw new UnsupportedOperationException ("Please implement the 'describe(TravelMethod travelMethod)' " +
36
- "method" );
37
- }
23
+ return invokeMethod ("describe" , new Class [] { TravelMethod .class }, character );
38
24
}
39
25
40
26
public String describe (Character character , Destination destination , TravelMethod travelMethod ) {
41
- try {
42
- return invokeMethod ("describe" , new Class []{Character .class , Destination .class , TravelMethod .class },
43
- character , destination , travelMethod );
44
- } catch (Exception e ) {
45
- throw new UnsupportedOperationException ("Please implement the 'describe(Character character, Destination " +
46
- "destination, TravelMethod travelMethod)' method" );
47
- }
27
+ return invokeMethod ("describe" , new Class [] { Character .class , Destination .class , TravelMethod .class },
28
+ character , destination , travelMethod );
48
29
}
49
30
50
31
public String describe (Character character , Destination destination ) {
51
- try {
52
- return invokeMethod ("describe" , new Class []{Character .class , Destination .class },
53
- character , destination );
54
- } catch (Exception e ) {
55
- throw new UnsupportedOperationException ("Please implement the 'describe(Character character, Destination " +
56
- "destination)' method" );
57
- }
32
+ return invokeMethod ("describe" , new Class [] { Character .class , Destination .class }, character , destination );
58
33
}
59
-
60
34
}
0 commit comments