jIntegrity - http://jintegrity.com
jIntegrity is a toolbox to help you test with a good integration with DbUnit.
The jIntegrity is licensed under The MIT License
@version 0.1.2
@since 2011.09.30
@author Washington Botelho dos Santos
@documentation jintegrity.com/doc
hibernate.connection.driver_class=
hibernate.connection.url=
hibernate.connection.username=
hibernate.connection.password=
path=
xml=
- You don't need starts with slash on path; Ex.: my/package/dataset
- The XMLs is comma separated. Ex.: User,Product,Payment
JIntegrity helper = new JIntegrity();
helper.insert();
JIntegrity helper = new JIntegrity();
helper.path("my/package/dataset").insert();
JIntegrity helper = new JIntegrity();
helper.xml("User").insert();
JIntegrity helper = new JIntegrity();
helper.path("my/package/dataset").xml("User").insert();
JIntegrity helper = new JIntegrity();
helper.path("my/package/dataset").xml("User").insert("/my/package/dataset/Payment");
- The first slash on action insert actives the fully qualified path and it ignores the path configuration.
JIntegrity helper = new JIntegrity();
helper.insert("User", "Payment");
JIntegrity helper = new JIntegrity();
helper.insert("User", "/my/package/dataset/Payment");
JIntegrity helper = new JIntegrity();
DbUnitManager dbUnitManger = helper.getDbUnitManager();
dbUnitManger.refresh("User");
- If you don't need anything specific from JIntegrity object, you can instantiate the
DbUnitManager
directly.
JPAHelper.entityManagerFactory("default");
EntityManager manager = JPAHelper.currentEntityManager();
Query query = manager.createQuery("from User");
List<User> userList = query.getResultList();
Session session = HibernateHelper.currentSession();
Criteria criteria = session.createCriteria(User.class);
List<User> userList = criteria.list();
HibernateHelper.exportSchema();
- You need especify the mappings on hibernate.cfg.xml. Ex.:
<mapping class="com.jintegrity.model.User" />
String helper.getPath();
String[] helper.getXmls();
DbUnitManager helper.getDbUnitManager();
JIntegrity helper.xml(String xml);
JIntegrity helper.path(String path);
JIntegrity helper.vendor(String vendor); // Vendors
JIntegrity helper.keys(PropertiesKey propertiesKey);
JIntegrity helper.clean(String... xml);
JIntegrity helper.insert(String... xml);
JIntegrity helper.cleanAndInsert(String... xml);
JIntegrity helper.useDB2();
JIntegrity helper.useHSQL();
JIntegrity helper.useMSSQL();
JIntegrity helper.useMySQL();
JIntegrity helper.useOracle10g();
// Vendors
JIntegrity.DB2;
JIntegrity.HSQL;
JIntegrity.MSSQL;
JIntegrity.MYSQL;
JIntegrity.ORACLE10G;
JIntegrity.POSTGRE;
void dbUnitManager.cleanAndInsert(String xml);
void dbUnitManager.delete(String xml);
void dbUnitManager.deleteAll(String xml);
void dbUnitManager.insert(String xml);
void dbUnitManager.refresh(String xml);
void dbUnitManager.truncate(String xml);
void dbUnitManager.update(String xml);
Connection dbUnitManager.getConnection();
void dbUnitManager.execute(DatabaseOperation operation, String xml);
EntityManagerFactory entityManagerFactory(String name);
EntityManager currentEntityManager();
void close();
SessionFactory sessionFactory();
Session currentSession();
void close();
void exportSchema();
- Priority: properties < global methods { path() and xml() } < action methos { clean(), insert() and cleanAndInsert() }.
You can do it by PayPal. Thanks! (: