Permalink
Browse files

more group by middle tier tests

  • Loading branch information...
1 parent 21e2113 commit cb2a82cb930499f00baa771abebcbf7a4d89128e @sonalgoyal committed Oct 3, 2012
View
@@ -3,4 +3,4 @@ port=3306
name=crux
testDbName=testCrux
user=root
-password=newpwd
+password=root
@@ -139,8 +139,7 @@
<one-to-many class="ReportDesign" />
</bag>
<one-to-one name="groupBys" class="GroupBys" property-ref="report"
- cascade="save-update,delete,all-delete-orphan"/>
-
+ cascade="save-update,delete,all-delete-orphan"/>
</class>
<class name="ReportDesign" table="reportDesign" lazy="false">
@@ -231,7 +230,7 @@
<id name="id" >
<generator class="increment" />
</id>
- <many-to-one name="rowAlias" column="rowAliasId" class="RowAlias" lazy="false"/>
+ <many-to-one name="rowAlias" column="rowAliasId" class="RowAlias" lazy="false"/>
<property name="position" column="position" type="int" lazy="false" />
</class>
<class name="GroupBys" table="groupBys" lazy="false">
@@ -240,9 +240,16 @@ public void testDeleteReport() throws Exception, CruxException {
stmt.executeUpdate("insert into connection values(99999,1,1,'connectionTest')");
stmt.executeUpdate("insert into mapping values(99999,99999,'mappingTest','tableTest')");
+ stmt.executeUpdate("insert into rowAlias values(99999,99999,'aliasTest',1,3)");
+ stmt.executeUpdate("insert into rowAlias values(19999,99999,'aliasTest1',1,3)");
stmt.executeUpdate("insert into columnAlias values(99999,99999,1,'columnFamilyTest','qualifierTest','aliasTest')");
stmt.executeUpdate("insert into report values(99999,1,1,'reportTest',null,25)");
stmt.executeUpdate("insert into reportDesign values(99999,99999,99999,null,'x')");
+ stmt.executeUpdate("insert into groupBys(id, reportId) values(1, 99999)");
+ stmt.executeUpdate("insert into groupBy(id, groupBysId, rowAliasId, position) values(1,1,99999,1)");
+ stmt.executeUpdate("insert into groupBy(id, groupBysId, rowAliasId, position) values(2,1,19999,2)");
+
+
ReportDAO reportDAO = new ReportDAO();
@@ -260,18 +267,32 @@ public void testDeleteReport() throws Exception, CruxException {
ResultSet rs = stmt
.executeQuery("select * from report where id = 99999");
- while (rs.next()) {
- assertTrue(false);
- }
+ if (rs!= null && rs.first()) {
+ System.out.println(rs.getLong(0));
+ fail("Report should have been deleted");
+ }
rs.close();
ResultSet rs1 = stmt
.executeQuery("select * from reportDesign where id = 99999");
- while (rs1.next()) {
- assertTrue(false);
+ if (rs1!= null && rs1.first()) {
+ System.out.println(rs1.getLong(0));
+ fail("ReportDesign should have been deleted");
}
rs1.close();
-
+
+ rs = stmt.executeQuery("select id from groupBys");
+ if (rs!= null && rs.first()) {
+ System.out.println(rs.getLong(0));
+ fail("GroupBys should have been deleted");
+ }
+ rs1 = stmt.executeQuery("select id from groupBy");
+ if (rs1 != null && rs1.first()) {
+ fail("Deleting groupbys should have deleted groupby");
+ }
+ stmt.executeUpdate("delete from groupBy");
+ stmt.executeUpdate("delete from groupBys");
+ stmt.executeUpdate("delete from rowAlias");
stmt.executeUpdate("delete from columnAlias where id=" + 99999);
stmt.executeUpdate("delete from mapping where id=" + 99999);
stmt.executeUpdate("delete from connection where id=" + 99999);
@@ -0,0 +1,155 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Copyright 2007 The Apache Software Foundation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+ <property>
+ <name>hbase.master.wait.on.regionservers.interval</name>
+ <value>100</value>
+ <description>How long we wait on regionservers to check in
+ </description>
+ </property>
+ <property>
+ <name>hbase.regionserver.msginterval</name>
+ <value>1000</value>
+ <description>Interval between messages from the RegionServer to HMaster
+ in milliseconds. Default is 15. Set this value low if you want unit
+ tests to be responsive.
+ </description>
+ </property>
+ <property>
+ <name>hbase.client.pause</name>
+ <value>1000</value>
+ <description>General client pause value. Used mostly as value to wait
+ before running a retry of a failed get, region lookup, etc.</description>
+ </property>
+ <property>
+ <name>hbase.client.retries.number</name>
+ <value>10</value>
+ <description>Maximum retries. Used as maximum for all retryable
+ operations such as fetching of the root region from root region
+ server, getting a cell's value, starting a row update, etc.
+ Default: 10.
+ </description>
+ </property>
+ <property>
+ <name>hbase.server.thread.wakefrequency</name>
+ <value>1000</value>
+ <description>Time to sleep in between searches for work (in milliseconds).
+ Used as sleep interval by service threads such as META scanner and log roller.
+ </description>
+ </property>
+ <property>
+ <name>hbase.master.event.waiting.time</name>
+ <value>50</value>
+ <description>Time to sleep between checks to see if a table event took place.
+ </description>
+ </property>
+ <property>
+ <name>hbase.regionserver.handler.count</name>
+ <value>5</value>
+ <description>Count of RPC Server instances spun up on RegionServers
+ Same property is used by the HMaster for count of master handlers.
+ Default is 10.
+ </description>
+ </property>
+ <property>
+ <name>hbase.master.info.port</name>
+ <value>-1</value>
+ <description>The port for the hbase master web UI
+ Set to -1 if you do not want the info server to run.
+ </description>
+ </property>
+ <property>
+ <name>hbase.regionserver.info.port</name>
+ <value>-1</value>
+ <description>The port for the hbase regionserver web UI
+ Set to -1 if you do not want the info server to run.
+ </description>
+ </property>
+ <property>
+ <name>hbase.regionserver.info.port.auto</name>
+ <value>true</value>
+ <description>Info server auto port bind. Enables automatic port
+ search if hbase.regionserver.info.port is already in use.
+ Enabled for testing to run multiple tests on one machine.
+ </description>
+ </property>
+ <property>
+ <name>hbase.master.lease.thread.wakefrequency</name>
+ <value>3000</value>
+ <description>The interval between checks for expired region server leases.
+ This value has been reduced due to the other reduced values above so that
+ the master will notice a dead region server sooner. The default is 15 seconds.
+ </description>
+ </property>
+ <property>
+ <name>hbase.regionserver.optionalcacheflushinterval</name>
+ <value>1000</value>
+ <description>
+ Amount of time to wait since the last time a region was flushed before
+ invoking an optional cache flush. Default 60,000.
+ </description>
+ </property>
+ <property>
+ <name>hbase.regionserver.safemode</name>
+ <value>false</value>
+ <description>
+ Turn on/off safe mode in region server. Always on for production, always off
+ for tests.
+ </description>
+ </property>
+ <property>
+ <name>hbase.hregion.max.filesize</name>
+ <value>67108864</value>
+ <description>
+ Maximum desired file size for an HRegion. If filesize exceeds
+ value + (value / 2), the HRegion is split in two. Default: 256M.
+
+ Keep the maximum filesize small so we split more often in tests.
+ </description>
+ </property>
+ <property>
+ <name>hadoop.log.dir</name>
+ <value>${user.dir}/../logs</value>
+ </property>
+ <property>
+ <name>hbase.zookeeper.property.clientPort</name>
+ <value>21818</value>
+ <description>Property from ZooKeeper's config zoo.cfg.
+ The port at which the clients will connect.
+ </description>
+ </property>
+ <property>
+ <name>hbase.defaults.for.version.skip</name>
+ <value>true</value>
+ <description>
+ Set to true to skip the 'hbase.defaults.for.version'.
+ Setting this to true can be useful in contexts other than
+ the other side of a maven generation; i.e. running in an
+ ide. You'll want to set this boolean to true to avoid
+ seeing the RuntimException complaint: "hbase-default.xml file
+ seems to be for and old version of HBase (@@@VERSION@@@), this
+ version is X.X.X-SNAPSHOT"
+ </description>
+ </property>
+</configuration>

0 comments on commit cb2a82c

Please sign in to comment.