ExtensionLoader { public static List<LoadingStrategy> getLoadingStrategies() { return asList(strategies); } private  ExtensionLoader(Class<?> type); static void setLoadingStrategies(LoadingStrategy... strategies); static List<LoadingStrategy> getLoadingStrategies(); @SuppressWarnings("unchecked") static ExtensionLoader<T> getExtensionLoader(Class<T> type); static void resetExtensionLoader(Class type); static void destroyAll(); String getExtensionName(T extensionInstance); String getExtensionName(Class<?> extensionClass); List<T> getActivateExtension(URL url, String key); List<T> getActivateExtension(URL url, String[] values); List<T> getActivateExtension(URL url, String key, String group); List<T> getActivateExtension(URL url, String[] values, String group); @SuppressWarnings("unchecked") T getLoadedExtension(String name); Set<String> getLoadedExtensions(); List<T> getLoadedExtensionInstances(); Object getLoadedAdaptiveExtensionInstances(); @SuppressWarnings("unchecked") T getExtension(String name); T getExtension(String name, boolean wrap); T getOrDefaultExtension(String name); T getDefaultExtension(); boolean hasExtension(String name); Set<String> getSupportedExtensions(); Set<T> getSupportedExtensionInstances(); String getDefaultExtensionName(); void addExtension(String name, Class<?> clazz); @Deprecated void replaceExtension(String name, Class<?> clazz); @SuppressWarnings("unchecked") T getAdaptiveExtension(); @Override String toString();  }
@Test public void testGetLoadingStrategies() { List<LoadingStrategy> strategies = getLoadingStrategies(); assertEquals(4, strategies.size()); int i = 0; LoadingStrategy loadingStrategy = strategies.get(i++); assertEquals(DubboInternalLoadingStrategy.class, loadingStrategy.getClass()); assertEquals(Prioritized.MAX_PRIORITY, loadingStrategy.getPriority()); loadingStrategy = strategies.get(i++); assertEquals(DubboExternalLoadingStrategy.class, loadingStrategy.getClass()); assertEquals(Prioritized.MAX_PRIORITY + 1, loadingStrategy.getPriority()); loadingStrategy = strategies.get(i++); assertEquals(DubboLoadingStrategy.class, loadingStrategy.getClass()); assertEquals(Prioritized.NORMAL_PRIORITY, loadingStrategy.getPriority()); loadingStrategy = strategies.get(i++); assertEquals(ServicesLoadingStrategy.class, loadingStrategy.getClass()); assertEquals(Prioritized.MIN_PRIORITY, loadingStrategy.getPriority()); }