1 /*******************************************************************************
2 * Copyright (c) 2009, 2013 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Francois Chouinard - Initial API and implementation
11 * Francois Chouinard - Adapted for TMF Trace Model 1.0
12 * Alexandre Montplaisir - Port to JUnit4
13 * Marc-Andre Laperle - Adapted to BTree indexer from TmfCheckpointIndexTest
14 *******************************************************************************/
16 package org
.eclipse
.tracecompass
.tmf
.core
.tests
.trace
.indexer
.checkpoint
;
18 import static org
.junit
.Assert
.assertFalse
;
20 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.indexer
.TmfBTreeTraceIndexer
;
21 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.indexer
.checkpoint
.ITmfCheckpointIndex
;
22 import org
.junit
.Test
;
25 * Test suite for the TmfBTreeTraceIndexer class.
27 * @author Marc-Andre Laperle
29 public class TmfBTreeIndexTest
extends AbstractIndexTest
{
32 * Create the indexer for testing
36 * @return the indexer for testing
39 protected TestIndexerInterface
createTestIndexer(TestTrace trace
) {
40 return new TestBTreeIndexer(trace
);
43 private static class TestBTreeIndexer
extends TmfBTreeTraceIndexer
implements TestIndexerInterface
{
44 public TestBTreeIndexer(TestTrace testTrace
) {
45 super(testTrace
, BLOCK_SIZE
);
49 public ITmfCheckpointIndex
getCheckpoints() {
50 return getTraceIndex();
55 * Test that a fully built index has the same content when reloaded from disk
57 * @throws Exception when error occurs
60 public void testReopenIndex() throws Exception
{
62 fTrace
= createTrace(getTracePath());
63 assertFalse(fTrace
.getIndexer().getCheckpoints().isCreatedFromScratch());
64 fTrace
.indexTrace(true);
This page took 0.052411 seconds and 5 git commands to generate.