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
9 * Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
12 package org
.eclipse
.tracecompass
.ctf
.core
.tests
.types
;
14 import static org
.junit
.Assert
.assertNotNull
;
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
;
26 * The class <code>DefinitionTest</code> contains tests for the class
27 * <code>{@link Definition}</code>.
29 * @author Matthew Khouzam
30 * @version $Revision: 1.0 $
32 public class DefinitionTest
{
35 * Since Definition is abstract, we'll minimally extend it here to
38 static class DefTest
extends Definition
{
41 private static final StringDeclaration STRINGDEC
= StringDeclaration
.getStringDeclaration(Encoding
.UTF8
);
43 public DefTest(IDefinitionScope definitionScope
, @NonNull String fieldName
) {
44 super(DefTest
.STRINGDEC
, definitionScope
, fieldName
);
49 public IDeclaration
getDeclaration() {
50 return DefTest
.STRINGDEC
;
59 public void testToString() {
60 IDefinition fixture
= new DefTest(null, "Hello");
61 String result
= fixture
.toString();
63 assertNotNull(result
);