modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/deploy.xml | 6 -- modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java/org/rhq/cassandra/CCMTestNGListener.java | 2 modules/core/domain/src/test/java/org/rhq/core/domain/drift/JPADriftChangeSetTest.java | 22 ++++++++++ 3 files changed, 24 insertions(+), 6 deletions(-)
New commits: commit e4a4d66dd6c8de11cd29b0bd4072fae2984a26f0 Author: John Sanda jsanda@redhat.com Date: Mon Jan 28 16:38:05 2013 -0500
clean up bundle recipe so it no longer creates incorrect directories
In the post-install target the recipe was creating some data and log directories, and due to some prior changes those directories wound up with the wrong paths. The paths are correct in cassandra.yaml though. That part of the bundle recipe has been altgother removed though as cassandra will create the directories.
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/deploy.xml b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/deploy.xml index 2beacae..d6f3d98 100644 --- a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/deploy.xml +++ b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/deploy.xml @@ -180,16 +180,12 @@
<target name="pre-install"> <mkdir dir="${cluster.dir}"/> + </target>
<target name="post-install"> <property name="bin.dir" value="${rhq.deploy.dir}/bin"/>
- <mkdir dir="${rhq.deploy.dir}/${data.dir}"/> - <mkdir dir="${rhq.deploy.dir}/${commitlog.dir}"/> - <mkdir dir="${rhq.deploy.dir}/${saved.caches.dir}"/> - <mkdir dir="${rhq.deploy.dir}/${log.dir}"/> - <chmod file="${bin.dir}/cassandra" perm="+x"/> <chmod file="${bin.dir}/cqlsh" perm="+x"/> <chmod file="${bin.dir}/cassandra-cli" perm="+x"/> diff --git a/modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java/org/rhq/cassandra/CCMTestNGListener.java b/modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java/org/rhq/cassandra/CCMTestNGListener.java index 3146209..a25377a 100644 --- a/modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java/org/rhq/cassandra/CCMTestNGListener.java +++ b/modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java/org/rhq/cassandra/CCMTestNGListener.java @@ -76,7 +76,7 @@ public class CCMTestNGListener implements IInvokedMethodListener {
private void deployCluster(DeployCluster annotation) throws CassandraException { String clusterDir = System.getProperty("rhq.cassandra.cluster.dir"); - if (clusterDir == null) { + if (clusterDir == null || clusterDir.isEmpty()) { File basedir = new File("target"); clusterDir = new File(basedir, "cassandra").getAbsolutePath(); }
commit 8bf73b1d323b60dbc56198119488f049eb02cde2 Author: John Sanda jsanda@redhat.com Date: Mon Jan 28 16:36:54 2013 -0500
add tear down logic to clean up db
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/JPADriftChangeSetTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/JPADriftChangeSetTest.java index 2709158..439324b 100644 --- a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/JPADriftChangeSetTest.java +++ b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/JPADriftChangeSetTest.java @@ -29,6 +29,7 @@ import java.util.List;
import javax.persistence.EntityManager;
+import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test;
@@ -87,9 +88,30 @@ public class JPADriftChangeSetTest extends DriftDataAccessTest { }); }
+ @AfterMethod(alwaysRun = true, groups = {"JPADriftChangeSet", "drift.ejb"}) + public void tearDown() { + if (!inContainer()) { + return; + } + + executeInTransaction(false, new TransactionCallback() { + @Override + public void execute() throws Exception { + purgeDB(); + } + }); + } + private void purgeDB() { EntityManager em = getEntityManager();
+ em.createQuery("delete from JPADrift ").executeUpdate(); + em.createQuery("delete from JPADriftChangeSet").executeUpdate(); + em.createQuery("delete from JPADriftSet").executeUpdate(); + em.createQuery("delete from JPADriftFile").executeUpdate(); + em.createQuery("delete from DriftDefinition").executeUpdate(); + em.createQuery("delete from DriftDefinitionTemplate").executeUpdate(); + List<Availability> avails = (List<Availability>) em.createQuery("SELECT a FROM Availability a").getResultList(); for (Availability a : avails) { em.remove(a);
rhq-commits@lists.fedorahosted.org