@Test public void testGetClasses() throws Exception { List<String> classpathElements = getClasspathElements(); ApplicationEhCache applicationEhCache = new ApplicationEhCache(); Set<Class<?>> applicationClasses = applicationEhCache.getClasses(); Set<Class<?>> allClassesFound = new HashSet<Class<?>>(); for (String cpElement : classpathElements) { if (cpElement.endsWith(".jar")) { if (pathOfJarNotFiltered(cpElement)) { System.out.println("last scanned path : " + cpElement); allClassesFound.addAll(getAllClassesFromJar(cpElement)); } } else { System.out.println("last scanned path : " + cpElement); allClassesFound.addAll(getAllClassesFromDirectory(cpElement)); } } Set<Class<?>> annotatedClasses = new HashSet<Class<?>>(); for (Class<?> aClass : allClassesFound) { if (aClass.isAnnotationPresent(javax.ws.rs.ext.Provider.class) || aClass.isAnnotationPresent(javax.ws.rs.Path.class)) { annotatedClasses.add(aClass); } } Assert.assertThat(annotatedClasses, equalTo(applicationClasses)); }
public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(super.getClasses()); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CachesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagersResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagerConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.AgentsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.QueryResourceServiceImpl.class); return s; }
ApplicationEhCache extends DefaultApplication { public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(super.getClasses()); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CachesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagersResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagerConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.AgentsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.QueryResourceServiceImpl.class); return s; } }
ApplicationEhCache extends DefaultApplication { public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(super.getClasses()); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CachesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagersResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagerConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.AgentsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.QueryResourceServiceImpl.class); return s; }  }
ApplicationEhCache extends DefaultApplication { public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(super.getClasses()); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CachesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagersResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagerConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.AgentsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.QueryResourceServiceImpl.class); return s; }  Set<Class<?>> getClasses(); }
ApplicationEhCache extends DefaultApplication { public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(super.getClasses()); s.add(net.sf.ehcache.management.resource.services.ElementsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheStatisticSamplesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CachesResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagersResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheManagerConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.CacheConfigsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.AgentsResourceServiceImpl.class); s.add(net.sf.ehcache.management.resource.services.QueryResourceServiceImpl.class); return s; }  Set<Class<?>> getClasses();  }