AnnotationDeployer implements DynamicDeployer { public static List<Annotated<Method>> sortMethods(List<Annotated<Method>> list) { Collections.sort(list, new Comparator<Annotated<Method>>() { @Override public int compare(Annotated<Method> o1, Annotated<Method> o2) { return compareClasses(o1.get().getDeclaringClass(), o2.get().getDeclaringClass()); } }); 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 testSortMethods() throws Exception { AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(Emerald.class)).link(); List<Annotated<Method>> classes = finder.findMetaAnnotatedMethods(Resource.class); assertTrue(classes.size() >= 3); List<Annotated<Method>> sorted = AnnotationDeployer.sortMethods(classes); assertTrue(sorted.size() >= 3); assertEquals(Emerald.class, sorted.get(0).get().getDeclaringClass()); assertEquals(Green.class, sorted.get(1).get().getDeclaringClass()); assertEquals(Color.class, sorted.get(2).get().getDeclaringClass()); }