@Test public void testEscapeObjectName2() throws Exception { String objectName = "Catalina:type=Resource,resourcetype=Context,path=/,host=localhost,class=javax.sql.DataSource,name=\"jdbc/my-datasource\""; String actual = strategy.escapeObjectName(new ObjectName(objectName)); assertThat( actual, is( "Catalina.class__javax_sql_DataSource.host__localhost.name__jdbc_my-datasource.path___.resourcetype__Context.type__Resource")); }
@Test public void testEscapeObjectName1() throws Exception { String objectName = "java.lang:type=GarbageCollector,name=PS Scavenge"; String actual = strategy.escapeObjectName(new ObjectName(objectName)); assertThat(actual, is("java_lang.name__PS_Scavenge.type__GarbageCollector")); }