Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/naming/directory
In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/j2ee/common/com/mockobjects/naming/directory
Modified Files:
MockAttributes.java
Log Message:
Lots of small changes to mocks
Index: MockAttributes.java
===================================================================
RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/com/mockobjects/naming/directory/MockAttributes.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MockAttributes.java 22 Feb 2002 16:25:05 -0000 1.1
+++ MockAttributes.java 19 Jun 2002 15:26:22 -0000 1.2
@@ -7,7 +7,8 @@
import java.util.*;
public class MockAttributes extends MockObject implements Attributes{
- private List myAttributes = new ArrayList();
+ private ReturnObjectList myAttributesToReturn = new ReturnObjectList("attributes");
+ private ExpectationList myAttributes = new ExpectationList("attributes");
public boolean isCaseIgnored(){
notImplemented();
@@ -20,11 +21,16 @@
}
public void setupAddGet(Attribute attribute){
- myAttributes.add(attribute);
+ myAttributesToReturn.addObjectToReturn(attribute);
}
- public Attribute get(String name){
- return (Attribute)myAttributes.remove(0);
+ public void setExpectedName(String aName){
+ myAttributes.addExpected(aName);
+ }
+
+ public Attribute get(String aName){
+ myAttributes.addActual(aName);
+ return (Attribute)myAttributesToReturn.nextReturnObject();
}
public NamingEnumeration getAll(){
@@ -55,9 +61,5 @@
public Object clone(){
notImplemented();
return null;
- }
-
- public String toString(){
- return myAttributes.toString();
}
}
|