rcp: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / org.eclipse.tracecompass.ctf.core.tests / src / org / eclipse / tracecompass / ctf / core / tests / types / DefinitionTest.java
1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 Ericsson
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
11
12 package org.eclipse.tracecompass.ctf.core.tests.types;
13
14 import static org.junit.Assert.assertNotNull;
15
16 import org.eclipse.jdt.annotation.NonNull;
17 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
18 import org.eclipse.tracecompass.ctf.core.event.types.Definition;
19 import org.eclipse.tracecompass.ctf.core.event.types.Encoding;
20 import org.eclipse.tracecompass.ctf.core.event.types.IDeclaration;
21 import org.eclipse.tracecompass.ctf.core.event.types.IDefinition;
22 import org.eclipse.tracecompass.ctf.core.event.types.StringDeclaration;
23 import org.junit.Test;
24
25 /**
26 * The class <code>DefinitionTest</code> contains tests for the class
27 * <code>{@link Definition}</code>.
28 *
29 * @author Matthew Khouzam
30 * @version $Revision: 1.0 $
31 */
32 public class DefinitionTest {
33
34 /**
35 * Since Definition is abstract, we'll minimally extend it here to
36 * instantiate it.
37 */
38 static class DefTest extends Definition {
39
40 @NonNull
41 private static final StringDeclaration STRINGDEC = StringDeclaration.getStringDeclaration(Encoding.UTF8);
42
43 public DefTest(IDefinitionScope definitionScope, @NonNull String fieldName) {
44 super(DefTest.STRINGDEC, definitionScope, fieldName);
45 }
46
47 @Override
48 @NonNull
49 public IDeclaration getDeclaration() {
50 return DefTest.STRINGDEC;
51 }
52
53 }
54
55 /**
56 * Test a definition
57 */
58 @Test
59 public void testToString() {
60 IDefinition fixture = new DefTest(null, "Hello");
61 String result = fixture.toString();
62
63 assertNotNull(result);
64 }
65 }
This page took 0.052964 seconds and 5 git commands to generate.