If files exist in WEB-INF/ontologies/auth, read them into the User Accounts model - useful for selenium tests.
This commit is contained in:
parent
8ee4d7cd8e
commit
49fe3f8e26
1 changed files with 7 additions and 2 deletions
|
@ -23,6 +23,7 @@ import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
|
||||||
*/
|
*/
|
||||||
public class UserModelSetup extends JenaDataSourceSetupBase
|
public class UserModelSetup extends JenaDataSourceSetupBase
|
||||||
implements ServletContextListener {
|
implements ServletContextListener {
|
||||||
|
protected static String AUTHPATH = BASE + "auth/";
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(
|
private static final Log log = LogFactory.getLog(
|
||||||
UserModelSetup.class.getName());
|
UserModelSetup.class.getName());
|
||||||
|
@ -55,6 +56,11 @@ public class UserModelSetup extends JenaDataSourceSetupBase
|
||||||
OntModel userAccountsModel =
|
OntModel userAccountsModel =
|
||||||
ModelFactory.createOntologyModel( MEM_ONT_MODEL_SPEC);
|
ModelFactory.createOntologyModel( MEM_ONT_MODEL_SPEC);
|
||||||
|
|
||||||
|
// This is used in Selenium testing, when we load user accounts from a file.
|
||||||
|
if (userAccountsDbModel.isEmpty()) {
|
||||||
|
readOntologyFilesInPathSet(AUTHPATH, ctx, userAccountsDbModel);
|
||||||
|
}
|
||||||
|
|
||||||
userAccountsModel.add(userAccountsDbModel);
|
userAccountsModel.add(userAccountsDbModel);
|
||||||
userAccountsModel.getBaseModel().register(
|
userAccountsModel.getBaseModel().register(
|
||||||
new ModelSynchronizer(userAccountsDbModel));
|
new ModelSynchronizer(userAccountsDbModel));
|
||||||
|
@ -65,5 +71,4 @@ public class UserModelSetup extends JenaDataSourceSetupBase
|
||||||
ss.fatal(this, "Unable to load user accounts model from DB", t);
|
ss.fatal(this, "Unable to load user accounts model from DB", t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue