HBASE-15865 Move TestTableDeleteFamilyHandler and TestTableDescriptorModification handler tests to procedure
This commit is contained in:
parent
233264bc17
commit
6dbc8ebec1
@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.master.handler;
|
||||
package org.apache.hadoop.hbase.master.procedure;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
@ -53,9 +53,9 @@ import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
@Category(LargeTests.class)
|
||||
public class TestTableDeleteFamilyHandler {
|
||||
|
||||
public class TestDeleteColumnFamilyProcedureFromClient {
|
||||
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
|
||||
|
||||
private static final TableName TABLENAME =
|
||||
TableName.valueOf("column_family_handlers");
|
||||
private static final byte[][] FAMILIES = new byte[][] { Bytes.toBytes("cf1"),
|
||||
@ -180,7 +180,6 @@ public class TestTableDeleteFamilyHandler {
|
||||
|
||||
@Test
|
||||
public void deleteColumnFamilyTwice() throws Exception {
|
||||
|
||||
Admin admin = TEST_UTIL.getHBaseAdmin();
|
||||
HTableDescriptor beforehtd = admin.getTableDescriptor(TABLENAME);
|
||||
String cfToDelete = "cf1";
|
||||
@ -193,8 +192,7 @@ public class TestTableDeleteFamilyHandler {
|
||||
// 2 - Check if all the target column family exist in descriptor
|
||||
HColumnDescriptor[] families = beforehtd.getColumnFamilies();
|
||||
Boolean foundCF = false;
|
||||
int i;
|
||||
for (i = 0; i < families.length; i++) {
|
||||
for (int i = 0; i < families.length; i++) {
|
||||
if (families[i].getNameAsString().equals(cfToDelete)) {
|
||||
foundCF = true;
|
||||
break;
|
||||
@ -209,7 +207,7 @@ public class TestTableDeleteFamilyHandler {
|
||||
// 4 - Check if all the target column family exist in FS
|
||||
FileStatus[] fileStatus = fs.listStatus(tableDir);
|
||||
foundCF = false;
|
||||
for (i = 0; i < fileStatus.length; i++) {
|
||||
for (int i = 0; i < fileStatus.length; i++) {
|
||||
if (fileStatus[i].isDirectory() == true) {
|
||||
FileStatus[] cf = fs.listStatus(fileStatus[i].getPath(), new PathFilter() {
|
||||
@Override
|
||||
@ -241,7 +239,7 @@ public class TestTableDeleteFamilyHandler {
|
||||
|
||||
// 5 - Check if the target column family is gone from the FS
|
||||
fileStatus = fs.listStatus(tableDir);
|
||||
for (i = 0; i < fileStatus.length; i++) {
|
||||
for (int i = 0; i < fileStatus.length; i++) {
|
||||
if (fileStatus[i].isDirectory() == true) {
|
||||
FileStatus[] cf = fs.listStatus(fileStatus[i].getPath(), new PathFilter() {
|
||||
@Override
|
||||
@ -268,5 +266,4 @@ public class TestTableDeleteFamilyHandler {
|
||||
// Expected.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -17,7 +17,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.hadoop.hbase.master.handler;
|
||||
package org.apache.hadoop.hbase.master.procedure;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@ -51,7 +51,7 @@ import org.junit.rules.TestName;
|
||||
* addColumn(), deleteColumn() and modifyTable() operations.
|
||||
*/
|
||||
@Category(LargeTests.class)
|
||||
public class TestTableDescriptorModification {
|
||||
public class TestTableDescriptorModificationFromClient {
|
||||
|
||||
@Rule public TestName name = new TestName();
|
||||
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
|
||||
@ -286,4 +286,4 @@ public class TestTableDescriptorModification {
|
||||
assertTrue("Expected family " + Bytes.toString(familyName), htdFamilies.contains(familyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user