org.openmrs.util
Class TestTypeFilter

java.lang.Object
  extended by org.openmrs.util.TestTypeFilter
All Implemented Interfaces:
org.springframework.core.type.filter.TypeFilter

public class TestTypeFilter
extends java.lang.Object
implements org.springframework.core.type.filter.TypeFilter

This class exists so that Spring component-scans can exclude any unit test classes that were accidentally included on the classpath (like in an omod).
This filter returns true for any class that has a super class that is a Test like BaseContextSensitiveTest or TestCase.
Example usage:

  <context:component-scan base-package="org.openmrs">
    <context:exclude-filter type="custom" expression="org.openmrs.util.TestTypeFilter"/>
  </context:component-scan>
 
(Look at the applicationContext-service.xml file to see this in action)


Constructor Summary
TestTypeFilter()
           
 
Method Summary
 boolean match(org.springframework.core.type.classreading.MetadataReader metadataReader, org.springframework.core.type.classreading.MetadataReaderFactory metadataReaderFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestTypeFilter

public TestTypeFilter()
Method Detail

match

public boolean match(org.springframework.core.type.classreading.MetadataReader metadataReader,
                     org.springframework.core.type.classreading.MetadataReaderFactory metadataReaderFactory)
              throws java.io.IOException
Specified by:
match in interface org.springframework.core.type.filter.TypeFilter
Throws:
java.io.IOException
See Also:
TypeFilter.match(org.springframework.core.type.classreading.MetadataReader, org.springframework.core.type.classreading.MetadataReaderFactory)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change