Skip to content

Commit

Permalink
Update HBase version and start to setup mini cluster for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Helmling committed Dec 18, 2009
1 parent 154321d commit 61b35a2
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 16 deletions.
38 changes: 34 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<property name="lib.dir" value="${basedir}/lib" />
<property name="src.dir" value="${basedir}/src/java" />
<property name="test.src.dir" value="${basedir}/test/java" />
<property name="test.jysrc.dir" value="${basedir}/test/jython" />

<path id="project.class.path">
<fileset dir="${lib.dir}" includes="**/*.jar" />
Expand All @@ -20,7 +21,7 @@
<mkdir dir="${dist.dir}"/>
</target>

<target name="clean">
<target name="clean" description="Cleans up any previous build products" >
<delete dir="${dist.dir}" failonerror="false"/>
<delete dir="${build.dir}" failonerror="false"/>
</target>
Expand All @@ -29,7 +30,8 @@
<!-- ====================== Compilation Targets ================================= -->

<!-- build the source -->
<target name="compile" depends="init">
<target name="compile" depends="init"
description="Compile java classes">
<javac debug="yes" srcdir="${src.dir}" destdir="${build.dir}" deprecation="true" source="1.6" nowarn="true" >
<classpath refid="project.class.path"/>
<compilerarg line="-Xmaxerrs 10000"/>
Expand All @@ -41,7 +43,8 @@
</target>

<!-- really build all source -->
<target name="compile_clean" depends="clean, compile"/>
<target name="compile_clean" depends="clean, compile"
description="Compile java classes from scratch" />

<!-- package up classes into a jar file -->
<target name="jar" depends="compile_clean"
Expand All @@ -51,6 +54,33 @@
</jar>
</target>

<!-- ====================== Run Tests ============================== -->
<target name="test" depends="-jyunit_prepare"
description="Run all unit tests">
<exec executable="${basedir}/bin/run_tests.sh" failonerror="yes" inputstring="${tests.files}">
<arg value="--javasrc=${test.src.dir}" />
<arg value="--directory=${test.jysrc.dir}" />
<arg value="--product=Meetup.Beeno" />
<!-- read test files list from stdin -->
<arg value="--file=-" />
</exec>
</target>

<!-- prepare the standard test run (skips API/flow tests) -->
<target name="-jyunit_prepare" depends="compile_clean">
<pathconvert property="tests.files" pathsep="${line.separator}">
<fileset dir="${test.src.dir}" id="tests.java">
<include name="**/*.java" />
<exclude name="**/*$py.java" />
</fileset>
<fileset dir="${test.jysrc.dir}" id="tests.jython">
<include name="**/test_*.py" />
<!-- BUSTED: environment -->
<exclude name="**/test_query.py" />
</fileset>
</pathconvert>
</target>

<!-- ====================== JavaDoc Generation ================================ -->

<target name="javadoc" description="Generate JavaDoc API docs">
Expand All @@ -74,7 +104,7 @@
</javadoc>
</target>

<!-- HBase: regenerate Protocol Buffer classes for data types -->
<!-- Regenerate Protocol Buffer classes for data types -->
<target name="hbaseprotobuf" description="Generate Java classes and protocol buffer descriptors for HBase data types" depends="init">

<exec executable="protoc">
Expand Down
Binary file not shown.
Binary file not shown.
Binary file added lib/hbase-0.20.1-test.jar
Binary file not shown.
Binary file added lib/zookeeper-3.2.1.jar
Binary file not shown.
Binary file removed lib/zookeeper-r785019-hbase-1329.jar
Binary file not shown.
35 changes: 23 additions & 12 deletions test/jython/dbtest/hbase/test_entity_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@

import java.lang
from java.util import ArrayList, HashSet, HashMap
from org.apache.hadoop.hbase import HBaseClusterTestCase
from meetup.beeno import EntityMetadata, EntityService, HBaseException, MappingException
from com.meetup.db.hbase import TestEntities
from meetup.beeno import TestEntities

class HBaseContext(HBaseClusterTestCase):
def __init__(self):
super(HBaseContext, self).__init__()

hc = HBaseContext()

def setup():
hc.setUp()

# create a dummy HBase table for testing
import db.hbase
admin = db.hbase.Admin()
Expand All @@ -21,17 +29,20 @@ def setup():
admin.create("test_complex", {"props:": {db.hbase.VERSIONS: 10}, "extended:": {db.hbase.VERSIONS: 10}})

def teardown():
# clean up the dummy table
import db.hbase
admin = db.hbase.Admin()

#if admin.exists("test_simple"):
# admin.disable("test_simple")
# admin.drop("test_simple")

#if admin.exists("test_complex"):
# admin.disable("test_complex")
# admin.drop("test_complex")
try:
# clean up the dummy table
import db.hbase
admin = db.hbase.Admin()

#if admin.exists("test_simple"):
# admin.disable("test_simple")
# admin.drop("test_simple")

#if admin.exists("test_complex"):
# admin.disable("test_complex")
# admin.drop("test_complex")
finally:
hc.tearDown()


def save_and_get():
Expand Down

0 comments on commit 61b35a2

Please sign in to comment.