Hi
I've created SEAM component which checks that at least one user with global admin rights exists and creates one if no.
@Name("installer")
@Stateless
public class InstallerBean implements Installer, Serializable{
@Observer("org.jboss.seam.postInitialization")
public void install() {
...
}
public boolean isInstalled() {
...
}
}
Now I need to test that installer works correctly. I need to check that isInstalled() returns true and check that correct users and roles are exists in the database. However SeamTest.ComponentTest.testComponents() is running before my installation compleate. I can see in the log that last messages from my installer appears in the middle of second test execution so my tests randomly fails.
I'm trying to test my installer in the following way:
public class InstallerTests extends SeamTest {
@Test
public void isInstalledTest() {
new ComponentTest() {
@Override
protected void testComponents() {
...
}
}
}
...
}
How can I make my test starting after my installation compleated?
I'm new to SEAM so maybe I'm doing all compleately wrong. Please tell me if there is a better way.