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
9 * Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.ctf
.core
.tests
.types
;
14 import static org
.junit
.Assert
.assertNotNull
;
16 import org
.eclipse
.linuxtools
.ctf
.core
.event
.io
.BitBuffer
;
17 import org
.eclipse
.linuxtools
.ctf
.core
.event
.types
.Definition
;
18 import org
.eclipse
.linuxtools
.ctf
.core
.event
.types
.IDeclaration
;
19 import org
.eclipse
.linuxtools
.ctf
.core
.event
.types
.IDefinitionScope
;
20 import org
.junit
.After
;
21 import org
.junit
.Before
;
22 import org
.junit
.Test
;
25 * The class <code>DefinitionTest</code> contains tests for the class
26 * <code>{@link Definition}</code>.
29 * @version $Revision: 1.0 $
31 @SuppressWarnings("javadoc")
32 public class DefinitionTest
{
38 * the command line arguments
40 public static void main(String
[] args
) {
41 new org
.junit
.runner
.JUnitCore().run(DefinitionTest
.class);
45 * Perform pre-test initialization.
49 // add additional set up code here
53 * Perform post-test clean-up.
56 public void tearDown() {
57 // Add additional tear down code here
61 * Since Definition is abstract, we'll minimally extend it here to
64 class DefTest
extends Definition
{
66 public DefTest(IDefinitionScope definitionScope
, String fieldName
) {
67 super(definitionScope
, fieldName
);
71 public void read(BitBuffer input
) {
72 /* Just a test, no need to implement anything */
76 public IDeclaration
getDeclaration() {
77 // TODO Auto-generated method stub
84 public void testToString() {
85 Definition fixture
= new DefTest(null, "Hello");
86 String result
= fixture
.toString();
88 assertNotNull(result
);