1 50 package org.apache.avalon.meta.info.test; 51 52 import org.apache.avalon.meta.info.Descriptor; 53 import org.apache.avalon.meta.info.DependencyDescriptor; 54 import org.apache.avalon.meta.info.ReferenceDescriptor; 55 import org.apache.avalon.framework.Version; 56 57 63 public class DependencyDescriptorTestCase extends AbstractDescriptorTestCase 64 { 65 private String m_role; 66 private ReferenceDescriptor m_reference; 67 private boolean m_optional = true; 68 69 public DependencyDescriptorTestCase( String name ) 70 { 71 super( name ); 72 } 73 74 protected Descriptor getDescriptor() 75 { 76 return new DependencyDescriptor( m_role, m_reference, m_optional, getProperties() ); 77 } 78 79 protected void checkDescriptor( Descriptor desc ) 80 { 81 super.checkDescriptor( desc ); 82 83 DependencyDescriptor dep = (DependencyDescriptor) desc; 84 assertEquals( m_role, dep.getKey() ); 85 assertEquals( m_reference, dep.getReference() ); 86 assertEquals( m_optional, dep.isOptional() ); 87 assertEquals( !m_optional, dep.isRequired() ); 88 } 89 90 public void setUp() 91 { 92 m_role = "Test"; 93 m_reference = new ReferenceDescriptor( DependencyDescriptorTestCase.class.getName(), Version.getVersion( "1.2.1" ) ); 94 } 95 96 } | Popular Tags |