Skip to content

Commit

Permalink
Fix HibernateContentDaoConcurrencyTest - was missing cosmo_ prefix
Browse files Browse the repository at this point in the history
This fixes 2 test errors which were caused by the cosmo_ prefix not being
added everywhere that was needed
  • Loading branch information
nealeu committed Jan 11, 2013
1 parent 37f3399 commit 0162111
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void testConcurrentContentDaoUpdateContent() throws Exception {
txThread1.addRunnable("1", new TxRunnable() {
public Object run() {
User user = getUser(userDao, "testuser");
CollectionItem root = (CollectionItem) contentDao.getRootItem(user);
CollectionItem root = contentDao.getRootItem(user);

ContentItem item = generateTestContent();
item.setUid("test");
Expand Down Expand Up @@ -181,7 +181,7 @@ public void testConcurrentContentDaoDeleteContent() throws Exception {
txThread1.addRunnable("1", new TxRunnable() {
public Object run() {
User user = getUser(userDao, "testuser");
CollectionItem root = (CollectionItem) contentDao.getRootItem(user);
CollectionItem root = contentDao.getRootItem(user);

ContentItem item = generateTestContent();
item.setUid("test");
Expand Down Expand Up @@ -308,22 +308,22 @@ protected void cleanupDb () throws Exception {
Connection conn = jdbcDataSource.getConnection();

Statement stmt = conn.createStatement();
stmt.executeUpdate("delete from event_stamp");
stmt.executeUpdate("delete from stamp");
stmt.executeUpdate("delete from attribute");
stmt.executeUpdate("delete from collection_item");
stmt.executeUpdate("delete from tombstones");
stmt.executeUpdate("delete from item");
stmt.executeUpdate("delete from content_data");
stmt.executeUpdate("delete from users");
stmt.executeUpdate("delete from cosmo_event_stamp");
stmt.executeUpdate("delete from cosmo_stamp");
stmt.executeUpdate("delete from cosmo_attribute");
stmt.executeUpdate("delete from cosmo_collection_item");
stmt.executeUpdate("delete from cosmo_tombstones");
stmt.executeUpdate("delete from cosmo_item");
stmt.executeUpdate("delete from cosmo_content_data");
stmt.executeUpdate("delete from cosmo_users");

conn.commit();
}

static class TransactionThread extends Thread {

private List<RunContext> toRun = new ArrayList<RunContext>();
private Map<String, Object> doneSet = Collections.synchronizedMap(new HashMap<String, Object>());
private final List<RunContext> toRun = new ArrayList<RunContext>();
private final Map<String, Object> doneSet = Collections.synchronizedMap(new HashMap<String, Object>());
private boolean commit = false;
HibernateTransactionHelper txHelper = null;

Expand Down

0 comments on commit 0162111

Please sign in to comment.