1 package com.mockobjects.rmi; 2 3 import com.mockobjects.*; 4 import com.mockobjects.util.AssertMo; 5 6 import java.rmi.Remote ; 7 import java.rmi.AlreadyBoundException ; 8 import java.rmi.RemoteException ; 9 import java.rmi.NotBoundException ; 10 import java.net.MalformedURLException ; 11 import java.util.Vector ; 12 13 import alt.java.rmi.Naming; 14 15 public class MockNaming extends MockObject implements Naming { 16 private final ReturnObjectList myRemotes = new ReturnObjectList("remotes"); 17 private final ExpectationValue myName = new ExpectationValue("name"); 18 19 public void bind(String name, Remote obj) throws AlreadyBoundException , 20 MalformedURLException , RemoteException { 21 22 notImplemented(); 23 } 24 25 public void setupAddLookup(Remote aRemote){ 26 myRemotes.addObjectToReturn(aRemote); 27 } 28 29 public void setExpectedLookupName(String aName){ 30 myName.setExpected(aName); 31 } 32 33 public Remote lookup(String name) throws NotBoundException , 34 MalformedURLException , RemoteException { 35 36 myName.setActual(name); 37 return (Remote )myRemotes.nextReturnObject(); 38 } 39 40 public void unbind(String name) throws RemoteException , 41 NotBoundException , MalformedURLException { 42 43 notImplemented(); 44 } 45 46 public void rebind(String name, Remote obj) throws RemoteException , 47 MalformedURLException { 48 notImplemented(); 49 } 50 51 public String [] list(String name) throws RemoteException , 52 MalformedURLException { 53 notImplemented(); 54 return new String [0]; 55 } 56 57 } 58 | Popular Tags |