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
.event
;
15 import static org
.junit
.Assert
.assertEquals
;
17 import org
.junit
.Test
;
20 * <b><u>TmfEventContentTest</u></b>
22 * JUnit test suite for the TmfEventContent class.
24 public class TmfEventContentTest
{
26 // ========================================================================
28 // ========================================================================
31 public void testTmfEventContent() {
32 TmfEventContent content
= new TmfEventContent("Some content", new TmfEventFormat());
33 assertEquals("getFormat", 1, content
.getFormat().getLabels().length
);
34 assertEquals("getLabels", "Content", content
.getFormat().getLabels()[0]);
35 assertEquals("getContent", "Some content", content
.getContent());
38 // ========================================================================
40 // ========================================================================
43 public void testBasicGetField() {
44 TmfEventContent content
= new TmfEventContent("Some content", new TmfEventFormat());
45 assertEquals("getField", 1, content
.getFields().length
);
46 assertEquals("getField", "Some content", content
.getField(0).toString());
50 public void testExtendedGetField() {
51 TmfEventContent content
= new TmfEventContent("", new TmfEventFormatStub());
52 assertEquals("getField", 5, content
.getFields().length
);
53 assertEquals("getField", "1", content
.getField(0).toString());
54 assertEquals("getField", "-10", content
.getField(1).toString());
55 assertEquals("getField", "true", content
.getField(2).toString());
56 assertEquals("getField", "some string", content
.getField(3).toString());
57 assertEquals("getField", "[TmfTimestamp:1,2,3]", content
.getField(4).toString());
This page took 0.031627 seconds and 5 git commands to generate.