btf: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / types / DefinitionTest.java
1 /*******************************************************************************
2 * Copyright (c) 2013 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.linuxtools.ctf.core.tests.types;
13
14 import static org.junit.Assert.assertNotNull;
15
16 import org.eclipse.jdt.annotation.NonNull;
17 import org.eclipse.linuxtools.ctf.core.event.scope.IDefinitionScope;
18 import org.eclipse.linuxtools.ctf.core.event.types.Definition;
19 import org.eclipse.linuxtools.ctf.core.event.types.IDeclaration;
20 import org.eclipse.linuxtools.ctf.core.event.types.IDefinition;
21 import org.eclipse.linuxtools.ctf.core.event.types.StringDeclaration;
22 import org.junit.Test;
23
24 /**
25 * The class <code>DefinitionTest</code> contains tests for the class
26 * <code>{@link Definition}</code>.
27 *
28 * @author Matthew Khouzam
29 * @version $Revision: 1.0 $
30 */
31 public class DefinitionTest {
32
33 /**
34 * Since Definition is abstract, we'll minimally extend it here to
35 * instantiate it.
36 */
37 static class DefTest extends Definition {
38
39 @NonNull
40 private static final StringDeclaration STRINGDEF = new StringDeclaration();
41
42 public DefTest(IDefinitionScope definitionScope, @NonNull String fieldName) {
43 super(DefTest.STRINGDEF, definitionScope, fieldName);
44 }
45
46 @Override
47 @NonNull
48 public IDeclaration getDeclaration() {
49 return DefTest.STRINGDEF;
50 }
51
52 }
53
54 /**
55 * Test a definition
56 */
57 @Test
58 public void testToString() {
59 IDefinition fixture = new DefTest(null, "Hello");
60 String result = fixture.toString();
61
62 assertNotNull(result);
63 }
64 }
This page took 0.03318 seconds and 5 git commands to generate.