1 16 17 package org.springframework.jmx.export.naming; 18 19 import org.springframework.jmx.JmxTestBean; 20 import org.springframework.util.ClassUtils; 21 import org.springframework.util.ObjectUtils; 22 23 26 public class IdentityNamingStrategyTests extends AbstractNamingStrategyTests { 27 28 private JmxTestBean bean = new JmxTestBean(); 29 30 protected ObjectNamingStrategy getStrategy() throws Exception { 31 return new IdentityNamingStrategy(); 32 } 33 34 protected Object getManagedResource() throws Exception { 35 return bean; 36 } 37 38 protected String getKey() { 39 return "identity"; 40 } 41 42 protected String getCorrectObjectName() { 43 StringBuffer sb = new StringBuffer (256); 44 45 sb.append(bean.getClass().getPackage().getName()); 46 sb.append(":"); 47 sb.append("class="); 48 sb.append(ClassUtils.getShortName(bean.getClass())); 49 sb.append(",hashCode="); 50 sb.append(ObjectUtils.getIdentityHexString(bean)); 51 52 return sb.toString(); 53 } 54 55 } 56 | Popular Tags |