use of net.opentsdb.tree.TreeRule in project opentsdb by OpenTSDB.
the class TestTreeRule method storeRuleInvalidMissingFieldTagkCustom.
@Test(expected = IllegalArgumentException.class)
public void storeRuleInvalidMissingFieldTagkCustom() throws Exception {
setupStorage();
final TreeRule rule = new TreeRule(1);
rule.setLevel(1);
rule.setOrder(0);
rule.setType(TreeRuleType.TAGK_CUSTOM);
rule.setNotes("Just some notes");
rule.syncToStorage(storage.getTSDB(), false).joinUninterruptibly();
}
use of net.opentsdb.tree.TreeRule in project opentsdb by OpenTSDB.
the class TestTreeRule method storeRuleNoChanges.
@Test(expected = IllegalStateException.class)
public void storeRuleNoChanges() throws Exception {
setupStorage();
final TreeRule rule = TreeRule.fetchRule(storage.getTSDB(), 1, 2, 1).joinUninterruptibly();
rule.syncToStorage(storage.getTSDB(), false);
}
use of net.opentsdb.tree.TreeRule in project opentsdb by OpenTSDB.
the class TestTreeRule method storeRuleInvalidMissingCustomFieldMetricCustom.
@Test(expected = IllegalArgumentException.class)
public void storeRuleInvalidMissingCustomFieldMetricCustom() throws Exception {
setupStorage();
final TreeRule rule = new TreeRule(1);
rule.setLevel(1);
rule.setOrder(0);
rule.setType(TreeRuleType.METRIC_CUSTOM);
rule.setNotes("Just some notes");
rule.setField("foo");
rule.syncToStorage(storage.getTSDB(), false).joinUninterruptibly();
}
use of net.opentsdb.tree.TreeRule in project opentsdb by OpenTSDB.
the class TestTreeRule method storeRule.
@Test
public void storeRule() throws Exception {
setupStorage();
final TreeRule rule = new TreeRule(1);
rule.setLevel(1);
rule.setOrder(0);
rule.setType(TreeRuleType.METRIC);
rule.setNotes("Just some notes");
assertTrue(rule.syncToStorage(storage.getTSDB(), false).joinUninterruptibly());
assertEquals(3, storage.numColumns(TREE_TABLE, new byte[] { 0, 1 }));
}
use of net.opentsdb.tree.TreeRule in project opentsdb by OpenTSDB.
the class TestTreeRule method storeRuleBadID0.
@Test(expected = IllegalArgumentException.class)
public void storeRuleBadID0() throws Exception {
setupStorage();
final TreeRule rule = new TreeRule(0);
rule.syncToStorage(storage.getTSDB(), false);
}
Aggregations