javax.faces.bean.ManagedBean Java Examples

The following examples show how to use javax.faces.bean.ManagedBean. 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: JoinfacesApplicationAnalyzerTest.java    From joinfaces with Apache License 2.0 5 votes vote down vote up
@Test
public void testJsfManagedBeans() {
	this.applicationContextRunner
			.withUserConfiguration(DummyConfiguration.class)
			.run(context -> {
				assertThat(context.getBeanNamesForAnnotation(ManagedBean.class)).isNotEmpty();

				ApplicationStartedEvent applicationStartedEvent = mock(ApplicationStartedEvent.class);
				when(applicationStartedEvent.getApplicationContext()).thenReturn(context.getSourceApplicationContext());

				this.joinfacesApplicationAnalyzer.onApplicationEvent(applicationStartedEvent);
			});
}
 
Example #2
Source File: MappedJsf2ScopeExtension.java    From deltaspike with Apache License 2.0 4 votes vote down vote up
private boolean isBeanWithManagedBeanAnnotation(ProcessAnnotatedType processAnnotatedType)
{
    Class<?> beanClass = processAnnotatedType.getAnnotatedType().getJavaClass();

    return beanClass.isAnnotationPresent(ManagedBean.class);
}