diff --git a/akka-persistence/akka-persistence-hbase/src/test/scala/SimpleHbaseTest.scala b/akka-persistence/akka-persistence-hbase/src/test/scala/SimpleHbaseTest.scala index 11e9a41559..3dc1517930 100644 --- a/akka-persistence/akka-persistence-hbase/src/test/scala/SimpleHbaseTest.scala +++ b/akka-persistence/akka-persistence-hbase/src/test/scala/SimpleHbaseTest.scala @@ -6,20 +6,42 @@ import org.scalatest.BeforeAndAfterAll import org.scalatest.junit.JUnitRunner import org.junit.runner.RunWith import org.junit.Test -import org.apache.hadoop.hbase.HBaseClusterTestCase -@Test -class PersistenceTest extends HBaseClusterTestCase with Spec with BeforeAndAfterAll { +import org.apache.hadoop.hbase.HBaseTestingUtility + +@RunWith(classOf[JUnitRunner]) +class PersistenceSpec extends Spec with BeforeAndAfterAll with ShouldMatchers { + + import org.apache.hadoop.hbase.HBaseTestingUtility + + val testUtil = new HBaseTestingUtility override def beforeAll { - super.setUp + testUtil.startMiniCluster } - @Test - def testPersistence {} - override def afterAll { - super.tearDown + testUtil.shutdownMiniCluster + } + + describe("simple hbase persistence test") { + it("should create a table") { + import org.apache.hadoop.hbase.util.Bytes + import org.apache.hadoop.hbase.HTableDescriptor + import org.apache.hadoop.hbase.HColumnDescriptor + import org.apache.hadoop.hbase.client.HBaseAdmin + import org.apache.hadoop.hbase.client.HTable + + val descriptor = new HTableDescriptor(Bytes.toBytes("ATable")) + descriptor.addFamily(new HColumnDescriptor(Bytes.toBytes("Family1"))) + descriptor.addFamily(new HColumnDescriptor(Bytes.toBytes("Family2"))) + val admin = new HBaseAdmin(testUtil.getConfiguration) + admin.createTable(descriptor) + val table = new HTable(testUtil.getConfiguration, Bytes.toBytes("ATable")) + + table should not equal(null) + } + } } diff --git a/embedded-repo/org/apache/hbase/hbase/0.20.6/hbase-0.20.6.jar b/embedded-repo/org/apache/hbase/hbase/0.20.6/hbase-0.20.6.jar deleted file mode 100644 index e74cf9017e..0000000000 Binary files a/embedded-repo/org/apache/hbase/hbase/0.20.6/hbase-0.20.6.jar and /dev/null differ diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 656cf783c9..ffd5842194 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -226,6 +226,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { lazy val scalatest = "org.scalatest" % "scalatest" % SCALATEST_VERSION % "test" lazy val hadoop_test = "org.apache.hadoop" % "hadoop-test" % "0.20.2" % "test" lazy val hbase_test = "org.apache.hbase" % "hbase-test" % "0.20.6" % "test" + lazy val log4j = "log4j" % "log4j" % "1.2.15" % "test" + lazy val jett_mortbay = "org.mortbay.jetty" % "jetty" % "6.1.14" % "test" } // ------------------------------------------------------------------------------------------------------------------- @@ -529,12 +531,13 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { class AkkaHbaseProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { val zookeeper = Dependencies.zookeeper val hadoop_core = Dependencies.hadoop_core - + val hbase_core = Dependencies.hbase_core + // testing val hadoop_test = Dependencies.hadoop_test val hbase_test = Dependencies.hbase_test - - override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil + val jetty = Dependencies.jett_mortbay + val log4j = Dependencies.log4j } // -------------------------------------------------------------------------------------------------------------------