1 22 package org.objectweb.petals.component.common.util; 23 24 import java.util.Enumeration ; 25 import java.util.ResourceBundle ; 26 27 import org.easymock.classextension.EasyMock; 28 29 34 public class MockResourceBundle extends ResourceBundle { 35 36 @SuppressWarnings ("unchecked") 37 public Enumeration <String > getKeys() { 38 Enumeration keys = EasyMock.createMock(Enumeration .class); 39 EasyMock.expect(keys.nextElement()).andReturn("test"); 40 EasyMock.expect(keys.hasMoreElements()).andReturn(true); 41 EasyMock.replay(keys); 42 return keys; 43 } 44 45 protected boolean handleGetObject; 46 47 protected Object handleGetObject(String key) { 48 handleGetObject = true; 49 return "test msg"; 50 } 51 52 } 53 | Popular Tags |