KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mockobjects > visualage > MockTypeBuilder


1 package com.mockobjects.visualage;
2 import java.util.*;
3 import com.ibm.ivj.util.base.*;
4 import com.ibm.ivj.util.builders.*;
5 import junit.framework.*;
6 import com.mockobjects.ExpectationCounter;
7 import com.mockobjects.Verifiable;public class MockTypeBuilder implements TypeBuilder, Verifiable {
8     private String JavaDoc myBuilderName;
9     private SourceVerifier mySourceVerifier;
10     private ExpectationCounter mySaveCounter;
11     private MockType myType;
12
13     public MockTypeBuilder(MockType aType) {
14         myType = aType;
15     }
16
17     public MockTypeBuilder(SourceVerifier verifier, String JavaDoc builderName) {
18         super();
19
20         mySourceVerifier = verifier;
21         myBuilderName = builderName;
22         mySaveCounter = new ExpectationCounter(builderName + ".save()");
23         mySaveCounter.setExpected(1);
24     }
25
26     /**
27      * addMethodBuilder method comment.
28      */

29     public void addMethodBuilder(MethodBuilder arg1) {
30     }
31
32     /**
33      * checkMethodExists method comment.
34      */

35     public boolean checkMethodExists(MethodBuilder arg1) throws IvjException {
36         return false;
37     }
38
39     /**
40      * getBuilderName method comment.
41      */

42     public String JavaDoc getBuilderName() {
43         return myBuilderName;
44     }
45
46     /**
47      * getExistingMethods method comment.
48      */

49     public com.ibm.ivj.util.builders.MethodBuilder[] getExistingMethods()
50         throws IvjException {
51         return null;
52     }
53
54     public String JavaDoc getExistingMethodSource(MethodBuilder builder)
55         throws IvjException {
56         return ((MockMethodBuilder) builder).myExistingSource;
57     }
58
59     public String JavaDoc getExistingSource() throws IvjException {
60         return myType.getupSource();
61     }
62
63     /**
64      * getMethodBuilders method comment.
65      */

66     public java.util.Enumeration JavaDoc getMethodBuilders() {
67         return null;
68     }
69
70     /**
71      * getSource method comment.
72      */

73     public String JavaDoc getSource() {
74         return null;
75     }
76
77     /**
78      * isMarkedForDeletion method comment.
79      */

80     public boolean isMarkedForDeletion() {
81         return false;
82     }
83
84     /**
85      * markForDeletion method comment.
86      */

87     public void markForDeletion(boolean arg1) {
88     }
89
90     /**
91      * removeAllMethodBuilders method comment.
92      */

93     public void removeAllMethodBuilders() {
94     }
95
96     /**
97      * removeMethodBuilder method comment.
98      */

99     public void removeMethodBuilder(MethodBuilder arg1) {
100     }
101
102     /**
103      * save method comment.
104      */

105     public void save() throws IvjException {
106         mySaveCounter.inc();
107     }
108
109     /**
110      * saveMerge method comment.
111      */

112     public void saveMerge() throws IvjException {
113     }
114
115     /**
116      * setSource method comment.
117      */

118     public void setSource(String JavaDoc source) {
119         mySourceVerifier.setSource(myBuilderName, source);
120     }
121
122     public void setupExistingSource(String JavaDoc source) {
123         myType.setupSource(source);
124     }
125
126     public void verify() {
127         mySaveCounter.verify();
128     }
129 }
Popular Tags