1 /*******************************************************************************
2 * Copyright (c) 2015 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
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.segmentstore
.core
.tests
;
12 import static org
.junit
.Assert
.assertEquals
;
13 import static org
.junit
.Assert
.assertFalse
;
15 import java
.util
.Arrays
;
17 import org
.eclipse
.jdt
.annotation
.NonNull
;
18 import org
.eclipse
.tracecompass
.internal
.segmentstore
.core
.treemap
.TreeMapStore
;
19 import org
.eclipse
.tracecompass
.segmentstore
.core
.BasicSegment
;
20 import org
.eclipse
.tracecompass
.segmentstore
.core
.ISegment
;
21 import org
.eclipse
.tracecompass
.segmentstore
.core
.ISegmentStore
;
22 import org
.junit
.Test
;
25 * Test specific behavior for a TreeMapStore segment store.
27 * @author France Lapointe Nguyen
29 public class TreeMapStoreTest
extends AbstractTestSegmentStore
{
32 protected ISegmentStore
<@NonNull ISegment
> getSegmentStore() {
33 return new TreeMapStore
<>();
37 * The TreeMapStore does not have a bulk loader, if it ever gets one, it should be tested here.
40 protected ISegmentStore
<@NonNull ISegment
> getSegmentStore(@NonNull ISegment
@NonNull [] data
) {
41 TreeMapStore
<@NonNull ISegment
> treeMapStore
= new TreeMapStore
<>();
42 treeMapStore
.addAll(Arrays
.asList(data
));
47 * Try adding duplicate elements, they should be ignored
50 public void testNoDuplicateElements() {
51 for (ISegment segment
: SEGMENTS
) {
52 boolean ret
= fSegmentStore
.add(new BasicSegment(segment
.getStart(), segment
.getEnd()));
55 assertEquals(SEGMENTS
.size(), fSegmentStore
.size());
This page took 0.038032 seconds and 5 git commands to generate.