1 50 package org.apache.avalon.meta.info.test; 51 52 import org.apache.avalon.meta.info.*; 53 import org.apache.avalon.framework.Version; 54 55 61 public class ServiceDescriptorTestCase extends AbstractDescriptorTestCase 62 { 63 private ReferenceDescriptor m_designator; 64 65 public ServiceDescriptorTestCase( String name ) 66 { 67 super( name ); 68 } 69 70 protected Descriptor getDescriptor() 71 { 72 return new ServiceDescriptor(m_designator, getProperties()); 73 } 74 75 public void setUp() 76 { 77 m_designator = new ReferenceDescriptor( ServiceTestCase.class.getName(), Version.getVersion( "1.2.3" ) ); 78 } 79 80 81 public void testConstructor() 82 { 83 try 84 { 85 new ServiceDescriptor( null, getProperties() ); 86 fail( "Did not throw the expected NullPointerException" ); 87 } 88 catch ( NullPointerException npe ) 89 { 90 } 92 } 93 94 protected void checkDescriptor( Descriptor desc ) 95 { 96 super.checkDescriptor( desc ); 97 ServiceDescriptor service = (ServiceDescriptor) desc; 98 99 assertEquals( m_designator, service.getReference() ); 100 } 101 } | Popular Tags |