MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / buildTestTree

Method buildTestTree

test/tree/TestTree.java:704–735  ·  view source on GitHub ↗

Returns a configured tree with rules and values for testing purposes @return A tree to test with

()

Source from the content-addressed store, hash-verified

702 * @return A tree to test with
703 */
704 public static Tree buildTestTree() {
705 final Tree tree = new Tree();
706 tree.setTreeId(1);
707 tree.setCreated(1356998400L);
708 tree.setDescription("My Description");
709 tree.setName("Test Tree");
710 tree.setNotes("Details");
711 tree.setEnabled(true);
712 buildTestRuleSet(tree);
713
714 // reset the changed field via reflection
715 Method reset;
716 try {
717 reset = Tree.class.getDeclaredMethod("initializeChangedMap");
718 reset.setAccessible(true);
719 reset.invoke(tree);
720 reset.setAccessible(false);
721 // Since some other tests are calling this as a constructor, we can't throw
722 // exceptions. So just print them.
723 } catch (SecurityException e) {
724 e.printStackTrace();
725 } catch (NoSuchMethodException e) {
726 e.printStackTrace();
727 } catch (IllegalArgumentException e) {
728 e.printStackTrace();
729 } catch (IllegalAccessException e) {
730 e.printStackTrace();
731 } catch (InvocationTargetException e) {
732 e.printStackTrace();
733 }
734 return tree;
735 }
736
737 /**
738 * Mocks classes for testing the storage calls

Callers 15

setupStorageMethod · 0.95
storeLeafMethod · 0.95
storeLeafExistingSameMethod · 0.95
storeLeafCollisionMethod · 0.95
copyConstructorMethod · 0.95
copyChangesMethod · 0.95
copyChangesNoneMethod · 0.95
copyChangesOverrideMethod · 0.95
serializeMethod · 0.95
deserializeMethod · 0.95
addCollisionMethod · 0.95
addCollisionNullMethod · 0.95

Calls 7

setTreeIdMethod · 0.95
setCreatedMethod · 0.95
setDescriptionMethod · 0.95
setNameMethod · 0.95
setNotesMethod · 0.95
setEnabledMethod · 0.95
buildTestRuleSetMethod · 0.95

Tested by

no test coverage detected