Commit | Line | Data |
---|---|---|
d18dd09b | 1 | /******************************************************************************* |
e31e01e8 | 2 | * Copyright (c) 2009, 2010 Ericsson |
d18dd09b ASL |
3 | * |
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 | * | |
9 | * Contributors: | |
10 | * Francois Chouinard - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.tmf.tests.request; | |
14 | ||
15 | import junit.framework.TestCase; | |
16 | ||
17 | import org.eclipse.linuxtools.tmf.event.TmfEvent; | |
d18dd09b | 18 | import org.eclipse.linuxtools.tmf.request.TmfDataRequest; |
d18dd09b ASL |
19 | |
20 | /** | |
21 | * <b><u>TmfDataRequestTest</u></b> | |
22 | * <p> | |
75828b1a | 23 | * TODO: Implement me. Please. |
d18dd09b ASL |
24 | */ |
25 | public class TmfDataRequestTest extends TestCase { | |
26 | ||
e31e01e8 | 27 | // ------------------------------------------------------------------------ |
d18dd09b | 28 | // Housekeeping |
e31e01e8 | 29 | // ------------------------------------------------------------------------ |
d18dd09b ASL |
30 | |
31 | public TmfDataRequestTest(String name) { | |
32 | super(name); | |
33 | } | |
34 | ||
35 | @Override | |
36 | protected void setUp() throws Exception { | |
37 | super.setUp(); | |
d18dd09b ASL |
38 | } |
39 | ||
40 | @Override | |
41 | protected void tearDown() throws Exception { | |
42 | super.tearDown(); | |
43 | } | |
44 | ||
e31e01e8 | 45 | // ------------------------------------------------------------------------ |
d18dd09b | 46 | // Constructors |
e31e01e8 | 47 | // ------------------------------------------------------------------------ |
d18dd09b | 48 | |
e31e01e8 FC |
49 | public void testTmfDataRequest() { |
50 | TmfDataRequest<TmfEvent> request = new TmfDataRequest<TmfEvent>(TmfEvent.class); | |
d18dd09b | 51 | |
e31e01e8 FC |
52 | assertEquals("getIndex", 0, request.getIndex()); |
53 | assertEquals("getNbRequestedEvents", TmfDataRequest.ALL_DATA, request.getNbRequested()); | |
d18dd09b | 54 | assertEquals("getBlockize", TmfDataRequest.DEFAULT_BLOCK_SIZE, request.getBlockize()); |
d18dd09b ASL |
55 | } |
56 | ||
e31e01e8 FC |
57 | public void testTmfDataRequestIndex() { |
58 | TmfDataRequest<TmfEvent> request = new TmfDataRequest<TmfEvent>(TmfEvent.class, 10); | |
d18dd09b | 59 | |
e31e01e8 FC |
60 | assertEquals("getIndex", 10, request.getIndex()); |
61 | assertEquals("getNbRequestedEvents", TmfDataRequest.ALL_DATA, request.getNbRequested()); | |
75828b1a | 62 | assertEquals("getBlockize", TmfDataRequest.DEFAULT_BLOCK_SIZE, request.getBlockize()); |
d18dd09b ASL |
63 | } |
64 | ||
e31e01e8 FC |
65 | public void testTmfDataRequestIndexNbRequested() { |
66 | TmfDataRequest<TmfEvent> request = new TmfDataRequest<TmfEvent>(TmfEvent.class, 10, 100); | |
d18dd09b | 67 | |
e31e01e8 FC |
68 | assertEquals("getIndex", 10, request.getIndex()); |
69 | assertEquals("getNbRequestedEvents", 100, request.getNbRequested()); | |
75828b1a | 70 | assertEquals("getBlockize", TmfDataRequest.DEFAULT_BLOCK_SIZE, request.getBlockize()); |
d18dd09b ASL |
71 | } |
72 | ||
e31e01e8 FC |
73 | public void testTmfDataRequestIndexNbEventsBlocksize() { |
74 | TmfDataRequest<TmfEvent> request = new TmfDataRequest<TmfEvent>(TmfEvent.class, 10, 100, 200); | |
d18dd09b | 75 | |
e31e01e8 FC |
76 | assertEquals("getIndex", 10, request.getIndex()); |
77 | assertEquals("getNbRequestedEvents", 100, request.getNbRequested()); | |
78 | assertEquals("getBlockize", 200, request.getBlockize()); | |
d18dd09b ASL |
79 | } |
80 | ||
e31e01e8 | 81 | } |