use of org.jaffa.beans.factory.config.StaticContext in project jaffa-framework by jaffa-projects.
the class PersistentConfigValidatorTest method setup.
/**
* Common setup
*
* @throws Exception
*/
@Before
public void setup() throws Exception {
// create app context, do not need to include PersistentContext directly
AnnotationConfigApplicationContext appContext = new AnnotationConfigApplicationContext(JaffaRulesConfig.class, TestModelPersistentConfig.class);
assertNotNull(appContext);
new StaticContext().setApplicationContext(appContext);
// get validator factory bean from combined app context
ValidatorFactory target = appContext.getBean(ValidatorFactory.class);
assertNotNull(target);
Realm realm = new Realm("realm");
realm.setSource("Test");
realm.regex(TestModelPersistent.class.getName());
realm.register();
ClassMetaData classMetaData = new ClassMetaData();
classMetaData.setName(TestModelPersistent.class.getName());
classMetaData.setVariation("DEF");
classMetaData.setExecutionRealm(realm.getName());
classMetaData.register();
}
Aggregations