@Test public void testAnnotationResolution() { URL belannoUrl = getClass().getResource( "/org/openbel/framework/core/annotation/test.belanno"); try { AnnotationDefinition anndef = annotationDefService .resolveAnnotationDefinition(belannoUrl.toString()); assertNotNull(anndef); assertNotNull(anndef.getEnums()); assertFalse(anndef.getEnums().isEmpty()); assertEquals("9606", anndef.getEnums().get(0)); assertEquals("10090", anndef.getEnums().get(1)); assertEquals("10116", anndef.getEnums().get(2)); } catch (AnnotationDefinitionResolutionException e) { e.printStackTrace(); fail(e.getUserFacingMessage()); } }
@Override public AnnotationDefinition resolveAnnotationDefinition( String resourceLocation) throws AnnotationDefinitionResolutionException { synchronized (resourceLocation) { if (annotations.containsKey(resourceLocation)) { return annotations.get(resourceLocation); } AnnotationDefinition annotationDefinition = cacheableAnnotationDefinitionService .resolveAnnotationDefinition(resourceLocation); annotations.put(resourceLocation, annotationDefinition); return annotationDefinition; } }
DefaultAnnotationDefinitionService implements
        AnnotationDefinitionService { @Override public AnnotationDefinition resolveAnnotationDefinition( String resourceLocation) throws AnnotationDefinitionResolutionException { synchronized (resourceLocation) { if (annotations.containsKey(resourceLocation)) { return annotations.get(resourceLocation); } AnnotationDefinition annotationDefinition = cacheableAnnotationDefinitionService .resolveAnnotationDefinition(resourceLocation); annotations.put(resourceLocation, annotationDefinition); return annotationDefinition; } } }
DefaultAnnotationDefinitionService implements
        AnnotationDefinitionService { @Override public AnnotationDefinition resolveAnnotationDefinition( String resourceLocation) throws AnnotationDefinitionResolutionException { synchronized (resourceLocation) { if (annotations.containsKey(resourceLocation)) { return annotations.get(resourceLocation); } AnnotationDefinition annotationDefinition = cacheableAnnotationDefinitionService .resolveAnnotationDefinition(resourceLocation); annotations.put(resourceLocation, annotationDefinition); return annotationDefinition; } } DefaultAnnotationDefinitionService(
            CacheableResourceService resourceCache,
            CacheLookupService cacheLookupService); }
DefaultAnnotationDefinitionService implements
        AnnotationDefinitionService { @Override public AnnotationDefinition resolveAnnotationDefinition( String resourceLocation) throws AnnotationDefinitionResolutionException { synchronized (resourceLocation) { if (annotations.containsKey(resourceLocation)) { return annotations.get(resourceLocation); } AnnotationDefinition annotationDefinition = cacheableAnnotationDefinitionService .resolveAnnotationDefinition(resourceLocation); annotations.put(resourceLocation, annotationDefinition); return annotationDefinition; } } DefaultAnnotationDefinitionService(
            CacheableResourceService resourceCache,
            CacheLookupService cacheLookupService); @Override AnnotationDefinition resolveAnnotationDefinition(
            String resourceLocation); }
DefaultAnnotationDefinitionService implements
        AnnotationDefinitionService { @Override public AnnotationDefinition resolveAnnotationDefinition( String resourceLocation) throws AnnotationDefinitionResolutionException { synchronized (resourceLocation) { if (annotations.containsKey(resourceLocation)) { return annotations.get(resourceLocation); } AnnotationDefinition annotationDefinition = cacheableAnnotationDefinitionService .resolveAnnotationDefinition(resourceLocation); annotations.put(resourceLocation, annotationDefinition); return annotationDefinition; } } DefaultAnnotationDefinitionService(
            CacheableResourceService resourceCache,
            CacheLookupService cacheLookupService); @Override AnnotationDefinition resolveAnnotationDefinition(
            String resourceLocation);  }