1 17 package org.apache.geronimo.j2ee.j2eeobjectnames; 18 19 import javax.management.ObjectName ; 20 21 import junit.framework.TestCase; 22 23 26 public class NameFactoryTest extends TestCase { 27 String d = "d"; 28 String s = "s"; 29 String a = "a"; 30 String mt = "mt"; 31 String m = "m"; 32 String t = "t"; 33 String n = "n"; 34 J2eeContext context = new J2eeContextImpl("d1", "s1", "a1", "mt1", "m1", "n1", "t1"); 35 36 37 public void testquery1() throws Exception { 38 ObjectName o1 = NameFactory.getComponentNameQuery(d, s, a, n, t, context); 39 ObjectName o2 = NameFactory.getComponentNameQuery(d, s, a, null, "*", n, t, context); 40 assertEquals(o1, o2); 41 assertEquals(o1, ObjectName.getInstance("d:J2EEServer=s,J2EEApplication=a,j2eeType=t,name=n,*")); 42 } 43 44 public void testquery2() throws Exception { 45 ObjectName o1 = NameFactory.getComponentInModuleQuery(d, s, a, mt, m, t, context); 46 ObjectName o2 = NameFactory.getComponentNameQuery(d, s, a, mt, m, "*", t, context); 47 assertEquals(o1, o2); 48 assertEquals(o1, ObjectName.getInstance("d:j2eeType=t,J2EEServer=s,J2EEApplication=a,mt=m,*")); 50 } 51 } 52 | Popular Tags |