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 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 builderName) { 18 super(); 19 20 mySourceVerifier = verifier; 21 myBuilderName = builderName; 22 mySaveCounter = new ExpectationCounter(builderName + ".save()"); 23 mySaveCounter.setExpected(1); 24 } 25 26 29 public void addMethodBuilder(MethodBuilder arg1) { 30 } 31 32 35 public boolean checkMethodExists(MethodBuilder arg1) throws IvjException { 36 return false; 37 } 38 39 42 public String getBuilderName() { 43 return myBuilderName; 44 } 45 46 49 public com.ibm.ivj.util.builders.MethodBuilder[] getExistingMethods() 50 throws IvjException { 51 return null; 52 } 53 54 public String getExistingMethodSource(MethodBuilder builder) 55 throws IvjException { 56 return ((MockMethodBuilder) builder).myExistingSource; 57 } 58 59 public String getExistingSource() throws IvjException { 60 return myType.getupSource(); 61 } 62 63 66 public java.util.Enumeration getMethodBuilders() { 67 return null; 68 } 69 70 73 public String getSource() { 74 return null; 75 } 76 77 80 public boolean isMarkedForDeletion() { 81 return false; 82 } 83 84 87 public void markForDeletion(boolean arg1) { 88 } 89 90 93 public void removeAllMethodBuilders() { 94 } 95 96 99 public void removeMethodBuilder(MethodBuilder arg1) { 100 } 101 102 105 public void save() throws IvjException { 106 mySaveCounter.inc(); 107 } 108 109 112 public void saveMerge() throws IvjException { 113 } 114 115 118 public void setSource(String source) { 119 mySourceVerifier.setSource(myBuilderName, source); 120 } 121 122 public void setupExistingSource(String source) { 123 myType.setupSource(source); 124 } 125 126 public void verify() { 127 mySaveCounter.verify(); 128 } 129 } | Popular Tags |