001: package net.sf.mockcreator.dumby;
002:
003: public class Static extends java.lang.Object {
004: private final static String MOCK_CREATOR_ALERT = "Class net.sf.mockcreator.dumby.Static is a dumby generated by MockCreator. Ensure you dont deploy it onto a real system instead of the actual class";
005: static public final java.lang.String FOO = "FOO";
006: static public long BAR = 123L;
007: static public final java.lang.Character CHAR = new Character('a');
008: static public final java.text.MessageFormat NODEFCTOR = null;
009:
010: public Static() {
011: super ();
012: }
013:
014: private static String getClassObjectMethodSignature(String method) {
015: return "net.sf.mockcreator.dumby.MockStatic" + "#" + method;
016: }
017:
018: public/* static: we cannot use static with generic types :E */class Returnablex1062460907 {
019: private net.sf.mockcreator.IReturnable ir;
020:
021: public Returnablex1062460907(net.sf.mockcreator.IReturnable ir) {
022: this .ir = ir;
023: }
024:
025: public void throwable(java.lang.RuntimeException th) {
026: ir.throwable(th);
027: }
028:
029: public void throwable(java.lang.Error th) {
030: ir.throwable(th);
031: }
032:
033: public void throwable(java.lang.Throwable th) {
034: ir.throwable(th);
035: }
036:
037: }
038:
039: public static void voidMethod() {
040: java.util.List params = new java.util.ArrayList();
041:
042: try {
043:
044: net.sf.mockcreator.MockKernel.getReturnValue(
045: getClassObjectMethodSignature("voidMethod()"),
046: params);
047:
048: } catch (java.lang.RuntimeException e) {
049: throw e;
050: }
051:
052: catch (java.lang.Error e) {
053: throw e;
054: }
055:
056: catch (java.lang.Throwable e) {
057: throw new net.sf.mockcreator.exceptions.MockException(
058: "This class of exception is not declared in method signature. Its not a RuntimeException either. Thus it cannot be configured to throw from the method. Fix the test please.",
059: e);
060: } finally {
061: // do nothing ;)
062: }
063: }
064:
065: public Returnablex1062460907 expectVoidMethod() {
066: java.util.List params = new java.util.ArrayList();
067:
068: return new Returnablex1062460907(net.sf.mockcreator.MockKernel
069: .addExpectedMethodCall(
070: getClassObjectMethodSignature("voidMethod()"),
071: params));
072: }
073:
074: public Returnablex1062460907 expectZeroOrMoreVoidMethod() {
075: return new Returnablex1062460907(net.sf.mockcreator.MockKernel
076: .setDummy(
077: getClassObjectMethodSignature("voidMethod()"),
078: null));
079: }
080:
081: public void voidMethod2() {
082: throw new net.sf.mockcreator.exceptions.MockException(
083: MOCK_CREATOR_ALERT);
084: }
085:
086: public void anotherMethod(int p0) {
087: throw new net.sf.mockcreator.exceptions.MockException(
088: MOCK_CREATOR_ALERT);
089: }
090:
091: public/* static: we cannot use static with generic types :E */class Returnablex906091987 {
092: private net.sf.mockcreator.IReturnable ir;
093:
094: public Returnablex906091987(net.sf.mockcreator.IReturnable ir) {
095: this .ir = ir;
096: }
097:
098: public void throwable(java.lang.RuntimeException th) {
099: ir.throwable(th);
100: }
101:
102: public void throwable(java.lang.Error th) {
103: ir.throwable(th);
104: }
105:
106: public void throwable(java.lang.Throwable th) {
107: ir.throwable(th);
108: }
109:
110: }
111:
112: public static void anotherMethod(boolean p0) {
113: java.util.List params = new java.util.ArrayList();
114: params.add(new Boolean(p0));
115:
116: try {
117:
118: net.sf.mockcreator.MockKernel
119: .getReturnValue(
120: getClassObjectMethodSignature("anotherMethod(boolean)"),
121: params);
122:
123: } catch (java.lang.RuntimeException e) {
124: throw e;
125: }
126:
127: catch (java.lang.Error e) {
128: throw e;
129: }
130:
131: catch (java.lang.Throwable e) {
132: throw new net.sf.mockcreator.exceptions.MockException(
133: "This class of exception is not declared in method signature. Its not a RuntimeException either. Thus it cannot be configured to throw from the method. Fix the test please.",
134: e);
135: } finally {
136: // do nothing ;)
137: }
138: }
139:
140: public Returnablex906091987 expectAnotherMethod(boolean p0) {
141: java.util.List params = new java.util.ArrayList();
142: params.add(new Boolean(p0));
143:
144: return new Returnablex906091987(
145: net.sf.mockcreator.MockKernel
146: .addExpectedMethodCall(
147: getClassObjectMethodSignature("anotherMethod(boolean)"),
148: params));
149: }
150:
151: public Returnablex906091987 acceptAnotherMethod_boolean(
152: java.lang.Object p0) {
153: java.util.List params = new java.util.ArrayList();
154: params.add(p0);
155:
156: return new Returnablex906091987(
157: net.sf.mockcreator.MockKernel
158: .addExpectedMethodCall(
159: getClassObjectMethodSignature("anotherMethod(boolean)"),
160: params));
161: }
162:
163: public Returnablex906091987 expectZeroOrMoreAnotherMethod_boolean() {
164: return new Returnablex906091987(
165: net.sf.mockcreator.MockKernel
166: .setDummy(
167: getClassObjectMethodSignature("anotherMethod(boolean)"),
168: null));
169: }
170:
171: public Returnablex906091987 expectZeroOrMoreAnotherMethod(boolean p0) {
172: java.util.List params = new java.util.ArrayList();
173: params.add(new Boolean(p0));
174:
175: return new Returnablex906091987(
176: net.sf.mockcreator.MockKernel
177: .setDummy(
178: getClassObjectMethodSignature("anotherMethod(boolean)"),
179: params));
180: }
181:
182: public int nonVoidMethod(java.lang.String p0) {
183: throw new net.sf.mockcreator.exceptions.MockException(
184: MOCK_CREATOR_ALERT);
185: }
186: }
|