use of org.jboss.weld.environment.se.test.beans.MainTestBean in project core by weld.
the class StartMainEmptyArgsTest method testMainEmptyArgs.
/**
* Test of main method, of class StartMain when no command-line args are
* provided.
*/
@Test
public void testMainEmptyArgs() {
WeldContainer container = startMain.go();
MainTestBean mainTestBean = container.instance().select(MainTestBean.class).get();
assertNotNull(mainTestBean);
ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
assertNotNull(paramsBean);
assertNotNull(paramsBean.getParameters());
}
use of org.jboss.weld.environment.se.test.beans.MainTestBean in project core by weld.
the class WeldMainTest method testInitialize.
/**
* Test the alternate API for booting WeldContainer from an SE app.
*/
@Test
public void testInitialize() {
Weld weld = new Weld();
WeldContainer container = weld.initialize();
MainTestBean mainTestBean = container.instance().select(MainTestBean.class).get();
assertNotNull(mainTestBean);
ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
assertNotNull(paramsBean);
assertNotNull(paramsBean.getParameters());
weld.shutdown();
}
use of org.jboss.weld.environment.se.test.beans.MainTestBean in project core by weld.
the class StartMainTest method testMain.
/**
* Test of main method, of class StartMain. Checks that the beans found in
* the org.jboss.weld.environment.se.beans package are initialised as
* expected.
*/
@Test
public void testMain() {
WeldContainer container = startMain.go();
assertEquals(container.getId(), RegistrySingletonProvider.STATIC_INSTANCE);
MainTestBean mainTestBean = container.instance().select(MainTestBean.class).get();
assertNotNull(mainTestBean);
ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
assertNotNull(paramsBean);
assertNotNull(paramsBean.getParameters());
assertNotNull(paramsBean.getParameters().get(0));
assertEquals(ARGS[0], paramsBean.getParameters().get(0));
assertNotNull(paramsBean.getParameters().get(1));
assertEquals(ARGS[1], paramsBean.getParameters().get(1));
assertNotNull(paramsBean.getParameters().get(2));
assertEquals(ARGS[2], paramsBean.getParameters().get(2));
}
Aggregations