import org.apache.camel.util.CollectionHelper;
public class PackageScanFiltersTest extends TestCase {
public void testAssignableToPackageScanFilter() {
AssignableToPackageScanFilter filter = new AssignableToPackageScanFilter();
assertFalse(filter.matches(ScanTargetOne.class));
filter = new AssignableToPackageScanFilter(ScanTargetOne.class);
validateFilter(filter, ScanTargetOne.class);
filter = new AssignableToPackageScanFilter(ScanTargetOne.class);
validateFilter(filter, ScanTargetTwo.class);
Set<Class<?>> classes = new LinkedHashSet<Class<?>>();
classes.add(ScanTargetOne.class);
classes.add(ScanTargetThree.class);
filter = new AssignableToPackageScanFilter(classes);
validateFilter(filter, ScanTargetOne.class);
validateFilter(filter, ScanTargetTwo.class);
validateFilter(filter, ScanTargetThree.class);
assertTrue(filter.toString().contains("ScanTargetOne"));
assertTrue(filter.toString().contains("ScanTargetThree"));
}