1 16 17 package org.springframework.jmx.export.naming; 18 19 import javax.management.ObjectName ; 20 21 import junit.framework.TestCase; 22 23 26 public abstract class AbstractNamingStrategyTests extends TestCase { 27 28 public void testNaming() throws Exception { 29 ObjectNamingStrategy strat = getStrategy(); 30 ObjectName objectName = strat.getObjectName(getManagedResource(), getKey()); 31 assertEquals(objectName.getCanonicalName(), getCorrectObjectName()); 32 } 33 34 protected abstract ObjectNamingStrategy getStrategy() throws Exception ; 35 36 protected abstract Object getManagedResource() throws Exception ; 37 38 protected abstract String getKey(); 39 40 protected abstract String getCorrectObjectName(); 41 42 } 43 | Popular Tags |