Commit | Line | Data |
---|---|---|
4ab33d2b AO |
1 | /******************************************************************************* |
2 | * Copyright (c) 2009 Ericsson | |
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 (fchouinard@gmail.com) - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.tmf.event; | |
14 | ||
15 | import static org.junit.Assert.assertEquals; | |
16 | ||
17 | import org.junit.Test; | |
18 | ||
19 | /** | |
20 | * <b><u>TmfEventTypeTest</u></b> | |
21 | * <p> | |
1f506a43 | 22 | * JUnit test suite for the TmfEventType class. |
4ab33d2b AO |
23 | */ |
24 | public class TmfEventTypeTest { | |
25 | ||
26 | // ======================================================================== | |
27 | // Constructor | |
28 | // ======================================================================== | |
29 | ||
30 | @Test | |
31 | public void testEmptyConstructor() { | |
32 | TmfEventType type = new TmfEventType("", null); | |
33 | assertEquals("getValue", "", type.getTypeId()); | |
34 | assertEquals("getFormat", null, type.getFormat()); | |
35 | } | |
36 | ||
37 | @Test | |
38 | public void testNormalConstructor() { | |
39 | TmfEventType type = new TmfEventType("Type", new TmfEventFormat(new String[] { "field1", "field2" })); | |
40 | assertEquals("getValue", "Type", type.getTypeId()); | |
41 | assertEquals("getFormat", "field1", type.getFormat().getLabels()[0]); | |
42 | assertEquals("getFormat", "field2", type.getFormat().getLabels()[1]); | |
43 | } | |
44 | ||
45 | } |