1 22 package org.jboss.test.system.metadata.value; 23 24 import java.util.List ; 25 26 import org.jboss.system.metadata.ServiceAttributeMetaData; 27 import org.jboss.system.metadata.ServiceMetaData; 28 import org.jboss.system.metadata.ServiceValueMetaData; 29 import org.jboss.test.system.metadata.test.AbstractMetaDataTest; 30 31 37 public abstract class AbstractValueTest extends AbstractMetaDataTest 38 { 39 public AbstractValueTest(String name) 40 { 41 super(name); 42 } 43 44 protected ServiceAttributeMetaData unmarshallSingleAttribute() throws Exception 45 { 46 ServiceMetaData metaData = unmarshalSingleMBean(); 47 assertOthers(metaData); 48 List <ServiceAttributeMetaData> attributes = metaData.getAttributes(); 49 assertNotNull(attributes); 50 assertEquals(1, attributes.size()); 51 return attributes.get(0); 52 } 53 54 protected ServiceValueMetaData unmarshallSingleValue() throws Exception 55 { 56 ServiceMetaData metaData = unmarshalSingleMBean(); 57 assertOthers(metaData); 58 List <ServiceAttributeMetaData> attributes = metaData.getAttributes(); 59 assertNotNull(attributes); 60 assertEquals(1, attributes.size()); 61 ServiceAttributeMetaData attribute = attributes.get(0); 62 assertAttributeName(attribute, "Attribute"); 63 ServiceValueMetaData result = attribute.getValue(); 64 assertNotNull(result); 65 return result; 66 } 67 68 protected void assertOthers(ServiceMetaData metaData) throws Exception 69 { 70 assertEquals(testBasicMBeanName, metaData.getObjectName()); 71 assertEquals(testBasicMBeanCode, metaData.getCode()); 72 assertNull(metaData.getInterfaceName()); 73 assertDefaultConstructor(metaData); 74 assertNoXMBean(metaData); 75 } 76 } 77 | Popular Tags |