use of com.alibaba.cobar.manager.dao.xml.UserDAOImple in project cobar by alibaba.
the class XmlFile method initUser.
private void initUser() {
String path = this.xmlPath + System.getProperty("file.separator") + "user.xml";
init(path, "users");
UserDAOImple userDAO = new UserDAOImple();
userDAO.setXmlFileLoader(xmlFileLoader);
try {
userDAO.afterPropertiesSet();
} catch (Exception e) {
logger.error(e.getMessage(), e);
Assert.fail();
}
UserDO user = new UserDO();
user.setPassword("utest");
user.setRealname("utest");
user.setStatus("Normal");
user.setUser_role("SystemAdmin");
user.setUsername("utest");
userDAO.addUser(user);
}
use of com.alibaba.cobar.manager.dao.xml.UserDAOImple in project cobar by alibaba.
the class UserDaoTest method initData.
@Before
public void initData() {
Assert.assertNotNull(xmlPath);
userDao = new UserDAOImple();
xmlFileLoader = new XMLFileLoaderPath();
xmlFileLoader.setXmlPath(xmlPath);
userDao.setXmlFileLoader(xmlFileLoader);
userXmlPath = xmlPath + System.getProperty("file.separator") + "user.xml";
XmlFile xmlFile = new XmlFile(userXmlPath, "users");
try {
xmlFile.init();
} catch (IOException e) {
logger.error(e.getMessage(), e);
Assert.fail();
}
read();
}
Aggregations