1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.backup;
20
21 import java.util.List;
22
23 import org.apache.commons.logging.Log;
24 import org.apache.commons.logging.LogFactory;
25 import org.apache.hadoop.hbase.DoNotRetryIOException;
26 import org.apache.hadoop.hbase.TableName;
27 import org.apache.hadoop.hbase.testclassification.LargeTests;
28 import org.junit.Test;
29 import org.junit.experimental.categories.Category;
30
31 import com.google.common.collect.Lists;
32
33 @Category(LargeTests.class)
34 public class TestBackupBoundaryTests extends TestBackupBase {
35
36 private static final Log LOG = LogFactory.getLog(TestBackupBoundaryTests.class);
37
38
39
40
41
42 @Test
43 public void testFullBackupSingleEmpty() throws Exception {
44
45 LOG.info("create full backup image on single table");
46 List<TableName> tables = Lists.newArrayList(table3);
47 LOG.info("Finished Backup " + fullTableBackup(tables));
48 }
49
50
51
52
53
54 @Test
55 public void testFullBackupMultipleEmpty() throws Exception {
56 LOG.info("create full backup image on mulitple empty tables");
57
58 List<TableName> tables = Lists.newArrayList(table3, table4);
59 fullTableBackup(tables);
60 }
61
62
63
64
65
66 @Test(expected = DoNotRetryIOException.class)
67 public void testFullBackupSingleDNE() throws Exception {
68
69 LOG.info("test full backup fails on a single table that does not exist");
70 List<TableName> tables = toList("tabledne");
71 fullTableBackup(tables);
72 }
73
74
75
76
77
78 @Test(expected = DoNotRetryIOException.class)
79 public void testFullBackupMultipleDNE() throws Exception {
80
81 LOG.info("test full backup fails on multiple tables that do not exist");
82 List<TableName> tables = toList("table1dne", "table2dne");
83 fullTableBackup(tables);
84 }
85
86
87
88
89
90 @Test(expected = DoNotRetryIOException.class)
91 public void testFullBackupMixExistAndDNE() throws Exception {
92 LOG.info("create full backup fails on tableset containing real and fake table");
93
94 List<TableName> tables = toList(table1.getNameAsString(), "tabledne");
95 fullTableBackup(tables);
96 }
97 }