AnnotationDeployer implements DynamicDeployer { public static List<Annotated<Class<?>>> sortClasses(List<Annotated<Class<?>>> list) { Collections.sort(list, new Comparator<Annotated<Class<?>>>() { @Override public int compare(Annotated<Class<?>> o1, Annotated<Class<?>> o2) { return compareClasses(o1.get(), o2.get()); } }); return list; } AnnotationDeployer(); AppModule deploy(AppModule appModule); void deploy(CdiBeanInfo beanInfo); WebModule deploy(WebModule webModule); static DeploymentModule getModule(); static boolean isKnownEnvironmentEntryType(Class type); static boolean isShareableJNDINamespace(String jndiName); static List<Annotated<Class<?>>> sortClasses(List<Annotated<Class<?>>> list); static List<Class<?>> sortClassesParentFirst(List<Class<?>> list); static List<Annotated<Method>> sortMethods(List<Annotated<Method>> list); static URL classLocation(Class clazz); EnvEntriesPropertiesDeployer getEnvEntriesPropertiesDeployer(); static final Logger logger; static final Logger startupLogger; static final String OPENEJB_JPA_AUTO_SCAN; static final String OPENEJB_JPA_AUTO_SCAN_PACKAGE; static final Set<String> knownResourceEnvTypes; static final Set<String> knownEnvironmentEntries; }
@Test public void testSortClasses() throws Exception { AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(Emerald.class)).link(); List<Annotated<Class<?>>> classes = finder.findMetaAnnotatedClasses(Resource.class); assertTrue(classes.size() >= 3); List<Annotated<Class<?>>> sorted = AnnotationDeployer.sortClasses(classes); assertTrue(sorted.size() >= 3); assertEquals(Emerald.class, sorted.get(0).get()); assertEquals(Green.class, sorted.get(1).get()); assertEquals(Color.class, sorted.get(2).get()); }