1 /*******************************************************************************
2 * Copyright (c) 2009 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 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.request
;
15 import junit
.framework
.TestCase
;
17 import org
.eclipse
.linuxtools
.tmf
.event
.TmfEvent
;
18 import org
.eclipse
.linuxtools
.tmf
.event
.TmfTimeRange
;
19 import org
.eclipse
.linuxtools
.tmf
.event
.TmfTimestamp
;
22 * <b><u>TmfDataRequestTest</u></b>
24 * TODO: Implement me. Please.
26 public class TmfDataRequestTest
extends TestCase
{
28 // ========================================================================
30 // ========================================================================
32 public TmfDataRequestTest(String name
) {
37 protected void setUp() throws Exception
{
42 protected void tearDown() throws Exception
{
46 // ========================================================================
48 // ========================================================================
50 public void testTmfDataRequestIndexNbEvents() {
51 TmfDataRequest
<TmfEvent
> request
= new TmfDataRequest
<TmfEvent
>(10, 100);
53 assertEquals("getRange", null, request
.getRange());
54 assertEquals("getIndex", 10, request
.getIndex());
55 assertEquals("getNbRequestedEvents", 100, request
.getNbRequestedEvents());
56 assertEquals("getBlockize", TmfDataRequest
.DEFAULT_BLOCK_SIZE
, request
.getBlockize());
59 public void testTmfDataRequestIndexNbEventsBlocksize() {
60 TmfDataRequest
<TmfEvent
> request
= new TmfDataRequest
<TmfEvent
>(10, 100, 200);
62 assertEquals("getRange", null, request
.getRange());
63 assertEquals("getIndex", 10, request
.getIndex());
64 assertEquals("getNbRequestedEvents", 100, request
.getNbRequestedEvents());
65 assertEquals("getBlockize", 200, request
.getBlockize());
68 public void testTmfDataRequestTimeRange() {
69 TmfTimeRange range
= new TmfTimeRange(TmfTimestamp
.BigBang
, TmfTimestamp
.BigCrunch
);
70 TmfDataRequest
<TmfEvent
> request
= new TmfDataRequest
<TmfEvent
>(range
);
72 assertEquals("StartTime", TmfTimestamp
.BigBang
, request
.getRange().getStartTime());
73 assertEquals("EndTime", TmfTimestamp
.BigCrunch
, request
.getRange().getEndTime());
74 assertEquals("getIndex", 0, request
.getIndex());
75 assertEquals("getNbRequestedEvents", -1, request
.getNbRequestedEvents());
76 assertEquals("getBlockize", TmfDataRequest
.DEFAULT_BLOCK_SIZE
, request
.getBlockize());
79 public void testTmfDataRequestTimeRangeNbEvents() {
80 TmfTimeRange range
= new TmfTimeRange(TmfTimestamp
.BigBang
, TmfTimestamp
.BigCrunch
);
81 TmfDataRequest
<TmfEvent
> request
= new TmfDataRequest
<TmfEvent
>(range
, 10);
83 assertEquals("StartTime", TmfTimestamp
.BigBang
, request
.getRange().getStartTime());
84 assertEquals("EndTime", TmfTimestamp
.BigCrunch
, request
.getRange().getEndTime());
85 assertEquals("getIndex", 0, request
.getIndex());
86 assertEquals("getNbRequestedEvents", 10, request
.getNbRequestedEvents());
87 assertEquals("getBlockize", TmfDataRequest
.DEFAULT_BLOCK_SIZE
, request
.getBlockize());
90 public void testTmfDataRequestTimeRangeNbEventsBlockSize() {
91 TmfTimeRange range
= new TmfTimeRange(TmfTimestamp
.BigBang
, TmfTimestamp
.BigCrunch
);
92 TmfDataRequest
<TmfEvent
> request
= new TmfDataRequest
<TmfEvent
>(range
, 10, 100);
94 assertEquals("StartTime", TmfTimestamp
.BigBang
, request
.getRange().getStartTime());
95 assertEquals("EndTime", TmfTimestamp
.BigCrunch
, request
.getRange().getEndTime());
96 assertEquals("getIndex", 0, request
.getIndex());
97 assertEquals("getNbRequestedEvents", 10, request
.getNbRequestedEvents());
98 assertEquals("getBlockize", 100, request
.getBlockize());
This page took 0.032921 seconds and 5 git commands to generate.