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

Method before

test/core/TestCompactionQueue.java:86–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 private CompactionQueue compactionq;
85
86 @Before
87 public void before() throws Exception {
88 // Inject the attributes we need into the "tsdb" object.
89 Whitebox.setInternalState(tsdb, "metrics", mock(UniqueId.class));
90 Whitebox.setInternalState(tsdb, "table", TABLE);
91 Whitebox.setInternalState(config, "enable_compactions", true);
92 Whitebox.setInternalState(config, "fix_duplicates", true);
93 Whitebox.setInternalState(tsdb, "config", config);
94 when(tsdb.getConfig()).thenReturn(config);
95 // Stub out the compaction thread, so it doesn't even start.
96 PowerMockito.whenNew(CompactionQueue.Thrd.class).withNoArguments()
97 .thenReturn(mock(CompactionQueue.Thrd.class));
98 PowerMockito.when(config.enable_compactions()).thenReturn(true);
99 PowerMockito.when(config.fix_duplicates()).thenReturn(true);
100 compactionq = new CompactionQueue(tsdb);
101
102 when(tsdb.put(anyBytes(), anyBytes(), anyBytes(), anyLong()))
103 .thenAnswer(newDeferred());
104 when(tsdb.delete(anyBytes(), any(byte[][].class)))
105 .thenAnswer(newDeferred());
106 }
107
108 @Test
109 public void useMaxTsWhileCompacting() throws Exception {

Callers

nothing calls this directly

Calls 7

anyBytesMethod · 0.95
newDeferredMethod · 0.95
enable_compactionsMethod · 0.80
fix_duplicatesMethod · 0.80
putMethod · 0.80
getConfigMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected