org.springframework.core.annotation.subpackage.NonPublicAnnotatedClass Java Examples
The following examples show how to use
org.springframework.core.annotation.subpackage.NonPublicAnnotatedClass.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AnnotationUtilsTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void getValueFromNonPublicAnnotation() throws Exception { Annotation[] declaredAnnotations = NonPublicAnnotatedClass.class.getDeclaredAnnotations(); assertEquals(1, declaredAnnotations.length); Annotation annotation = declaredAnnotations[0]; assertNotNull(annotation); assertEquals("NonPublicAnnotation", annotation.annotationType().getSimpleName()); assertEquals(42, getValue(annotation, VALUE)); assertEquals(42, getValue(annotation)); }
Example #2
Source File: AnnotationUtilsTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void getDefaultValueFromNonPublicAnnotation() { Annotation[] declaredAnnotations = NonPublicAnnotatedClass.class.getDeclaredAnnotations(); assertEquals(1, declaredAnnotations.length); Annotation annotation = declaredAnnotations[0]; assertNotNull(annotation); assertEquals("NonPublicAnnotation", annotation.annotationType().getSimpleName()); assertEquals(-1, getDefaultValue(annotation, VALUE)); assertEquals(-1, getDefaultValue(annotation)); }
Example #3
Source File: MergedAnnotationsTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void getValueFromNonPublicAnnotation() throws Exception { Annotation[] declaredAnnotations = NonPublicAnnotatedClass.class.getDeclaredAnnotations(); assertThat(declaredAnnotations).hasSize(1); Annotation annotation = declaredAnnotations[0]; MergedAnnotation<Annotation> mergedAnnotation = MergedAnnotation.from(annotation); assertThat(mergedAnnotation.getType().getSimpleName()).isEqualTo("NonPublicAnnotation"); assertThat(mergedAnnotation.synthesize().annotationType().getSimpleName()).isEqualTo("NonPublicAnnotation"); assertThat(mergedAnnotation.getInt("value")).isEqualTo(42); }
Example #4
Source File: MergedAnnotationsTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void getDefaultValueFromNonPublicAnnotation() { Annotation[] declaredAnnotations = NonPublicAnnotatedClass.class.getDeclaredAnnotations(); assertThat(declaredAnnotations).hasSize(1); Annotation declaredAnnotation = declaredAnnotations[0]; MergedAnnotation<?> annotation = MergedAnnotation.from(declaredAnnotation); assertThat(annotation.getType().getName()).isEqualTo( "org.springframework.core.annotation.subpackage.NonPublicAnnotation"); assertThat(annotation.getDefaultValue("value")).contains(-1); }
Example #5
Source File: AnnotationUtilsTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void getValueFromNonPublicAnnotation() throws Exception { Annotation[] declaredAnnotations = NonPublicAnnotatedClass.class.getDeclaredAnnotations(); assertEquals(1, declaredAnnotations.length); Annotation annotation = declaredAnnotations[0]; assertNotNull(annotation); assertEquals("NonPublicAnnotation", annotation.annotationType().getSimpleName()); assertEquals(42, getValue(annotation, VALUE)); assertEquals(42, getValue(annotation)); }
Example #6
Source File: AnnotationUtilsTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void getDefaultValueFromNonPublicAnnotation() { Annotation[] declaredAnnotations = NonPublicAnnotatedClass.class.getDeclaredAnnotations(); assertEquals(1, declaredAnnotations.length); Annotation annotation = declaredAnnotations[0]; assertNotNull(annotation); assertEquals("NonPublicAnnotation", annotation.annotationType().getSimpleName()); assertEquals(-1, getDefaultValue(annotation, VALUE)); assertEquals(-1, getDefaultValue(annotation)); }
Example #7
Source File: AnnotationUtilsTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void getValueFromNonPublicAnnotation() throws Exception { Annotation[] declaredAnnotations = NonPublicAnnotatedClass.class.getDeclaredAnnotations(); assertEquals(1, declaredAnnotations.length); Annotation annotation = declaredAnnotations[0]; assertNotNull(annotation); assertEquals("NonPublicAnnotation", annotation.annotationType().getSimpleName()); assertEquals(42, getValue(annotation, VALUE)); assertEquals(42, getValue(annotation)); }
Example #8
Source File: AnnotationUtilsTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void getDefaultValueFromNonPublicAnnotation() throws Exception { Annotation[] declaredAnnotations = NonPublicAnnotatedClass.class.getDeclaredAnnotations(); assertEquals(1, declaredAnnotations.length); Annotation annotation = declaredAnnotations[0]; assertNotNull(annotation); assertEquals("NonPublicAnnotation", annotation.annotationType().getSimpleName()); assertEquals(-1, getDefaultValue(annotation, VALUE)); assertEquals(-1, getDefaultValue(annotation)); }