Simple test....
@Name("myComponent")
@Scope(ScopeType.EVENT)
class MyComponent{
}
class MyComponentTest extends SeamTest
@Test
public void initialTest(){
new ComponentTest() {
@Override
protected void testComponents()
throws Exception
{
MyComponent instance = (MyComponent) Component.getInstance(MyComponent.class, true);
assertNotNull(instance);
}
}.run();
}
The test pass without any problem!
Now, if i change the component scope to PAGE, the test fails. Seam cannot create this component anymore.
Does anybody know why this is happening?
@Name("myComponent")
@Scope(ScopeType.PAGE)
class MyComponent{
}
//Test fails =/ Component.getInstance(MyComponent.class, true) returns null