Commit | Line | Data |
---|---|---|
95bf10e7 AM |
1 | /******************************************************************************* |
2 | * Copyright (c) 2012 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 | * Matthew Khouzam - Initial generation with CodePro tools | |
11 | * Alexandre Montplaisir - Clean up, consolidate redundant tests | |
12 | *******************************************************************************/ | |
13 | ||
81c8e6f7 MK |
14 | package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor; |
15 | ||
aa572e22 MK |
16 | import static org.junit.Assert.assertEquals; |
17 | import static org.junit.Assert.assertNotNull; | |
18 | ||
81c8e6f7 MK |
19 | import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEventType; |
20 | import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; | |
21 | import org.eclipse.linuxtools.tmf.core.event.TmfEventField; | |
aa572e22 MK |
22 | import org.junit.After; |
23 | import org.junit.Before; | |
24 | import org.junit.Test; | |
81c8e6f7 MK |
25 | |
26 | /** | |
95bf10e7 AM |
27 | * The class <code>CtfTmfEventTypeTest</code> contains tests for the class |
28 | * <code>{@link CtfTmfEventType}</code>. | |
81c8e6f7 | 29 | * |
81c8e6f7 | 30 | * @author ematkho |
95bf10e7 | 31 | * @version 1.0 |
81c8e6f7 MK |
32 | */ |
33 | public class CtfTmfEventTypeTest { | |
81c8e6f7 MK |
34 | |
35 | /** | |
95bf10e7 | 36 | * Launch the test. |
81c8e6f7 | 37 | * |
95bf10e7 | 38 | * @param args the command line arguments |
81c8e6f7 | 39 | */ |
95bf10e7 AM |
40 | public static void main(String[] args) { |
41 | new org.junit.runner.JUnitCore().run(CtfTmfEventTypeTest.class); | |
81c8e6f7 MK |
42 | } |
43 | ||
44 | /** | |
45 | * Perform pre-test initialization. | |
81c8e6f7 MK |
46 | */ |
47 | @Before | |
95bf10e7 | 48 | public void setUp() { |
81c8e6f7 MK |
49 | // add additional set up code here |
50 | } | |
51 | ||
52 | /** | |
53 | * Perform post-test clean-up. | |
81c8e6f7 MK |
54 | */ |
55 | @After | |
95bf10e7 | 56 | public void tearDown() { |
81c8e6f7 MK |
57 | // Add additional tear down code here |
58 | } | |
59 | ||
95bf10e7 | 60 | |
81c8e6f7 | 61 | /** |
95bf10e7 | 62 | * Run the CtfTmfEventType(String,String,ITmfEventField) constructor test. |
81c8e6f7 | 63 | */ |
95bf10e7 AM |
64 | @Test |
65 | public void testCtfTmfEventType() { | |
66 | String eventName = ""; //$NON-NLS-1$ | |
67 | ITmfEventField content = new TmfEventField("", new ITmfEventField[] {}); //$NON-NLS-1$ | |
68 | CtfTmfEventType result = new CtfTmfEventType( eventName, content); | |
69 | ||
70 | assertNotNull(result); | |
71 | assertEquals("", result.toString()); //$NON-NLS-1$ | |
72 | assertEquals("", result.getName()); //$NON-NLS-1$ | |
73 | assertEquals("Ctf Event", result.getContext()); //$NON-NLS-1$ | |
74 | } | |
75 | ||
76 | /** | |
77 | * Run the String toString() method test. | |
78 | */ | |
79 | @Test | |
80 | public void testToString() { | |
81 | ITmfEventField emptyField = new TmfEventField("", new ITmfEventField[] {}); //$NON-NLS-1$ | |
82 | CtfTmfEventType fixture = new CtfTmfEventType("", emptyField); //$NON-NLS-1$ | |
83 | ||
84 | String result = fixture.toString(); | |
85 | ||
86 | assertEquals("", result); //$NON-NLS-1$ | |
81c8e6f7 MK |
87 | } |
88 | } |