Merge branch 'master'
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / src / org / eclipse / linuxtools / tmf / core / tests / ctfadaptor / CtfLocationTest.java
1 package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotNull;
5
6 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocation;
7 import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
8 import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
9 import org.junit.After;
10 import org.junit.Before;
11 import org.junit.Test;
12
13 /**
14 * The class <code>CtfLocationTest</code> contains tests for the class <code>{@link CtfLocation}</code>.
15 *
16 * @generatedBy CodePro at 03/05/12 2:29 PM
17 * @author ematkho
18 * @version $Revision: 1.0 $
19 */
20 public class CtfLocationTest {
21 /**
22 * Run the CtfLocation(Long) constructor test.
23 *
24 * @generatedBy CodePro at 03/05/12 2:29 PM
25 */
26 @SuppressWarnings("static-method")
27 @Test
28 public void testCtfLocation_1() {
29 Long location = new Long(1L);
30
31 CtfLocation result = new CtfLocation(location);
32
33 // add additional test code here
34 assertNotNull(result);
35 assertEquals(new Long(1L), result.getLocation());
36 }
37
38 /**
39 * Run the CtfLocation(ITmfTimestamp) constructor test.
40 *
41 * @generatedBy CodePro at 03/05/12 2:29 PM
42 */
43 @SuppressWarnings("static-method")
44 @Test
45 public void testCtfLocation_2() {
46 ITmfTimestamp timestamp = new TmfTimestamp();
47
48 CtfLocation result = new CtfLocation(timestamp);
49
50 // add additional test code here
51 assertNotNull(result);
52 assertEquals(new Long(0L), result.getLocation());
53 }
54
55 /**
56 * Run the CtfLocation clone() method test.
57 *
58 * @generatedBy CodePro at 03/05/12 2:29 PM
59 */
60 @SuppressWarnings("static-method")
61 @Test
62 public void testClone_1() {
63 CtfLocation fixture = new CtfLocation(new Long(1L));
64 fixture.setLocation(new Long(1L));
65
66 CtfLocation result = fixture.clone();
67
68 // add additional test code here
69 assertNotNull(result);
70 assertEquals(new Long(1L), result.getLocation());
71 }
72
73 /**
74 * Run the Long getLocation() method test.
75 *
76 * @generatedBy CodePro at 03/05/12 2:29 PM
77 */
78 @SuppressWarnings("static-method")
79 @Test
80 public void testGetLocation_1() {
81 CtfLocation fixture = new CtfLocation(new Long(1L));
82 fixture.setLocation(new Long(1L));
83
84 Long result = fixture.getLocation();
85
86 // add additional test code here
87 assertNotNull(result);
88 assertEquals("1", result.toString()); //$NON-NLS-1$
89 assertEquals((byte) 1, result.byteValue());
90 assertEquals((short) 1, result.shortValue());
91 assertEquals(1, result.intValue());
92 assertEquals(1L, result.longValue());
93 assertEquals(1.0f, result.floatValue(), 1.0f);
94 assertEquals(1.0, result.doubleValue(), 1.0);
95 }
96
97 /**
98 * Run the void setLocation(Long) method test.
99 *
100 * @generatedBy CodePro at 03/05/12 2:29 PM
101 */
102 @SuppressWarnings("static-method")
103 @Test
104 public void testSetLocation_1() {
105 CtfLocation fixture = new CtfLocation(new Long(1L));
106 fixture.setLocation(new Long(1L));
107 Long location = new Long(1L);
108
109 fixture.setLocation(location);
110
111 // add additional test code here
112 }
113
114 @SuppressWarnings("static-method")
115 @Test
116 public void testToString1(){
117 CtfLocation fixture = new CtfLocation(new Long(1337L));
118 assertEquals("CtfLocation: 1337",fixture.toString()); //$NON-NLS-1$
119 }
120
121 @SuppressWarnings("static-method")
122 @Test
123 public void testToString2(){
124 CtfLocation fixture = new CtfLocation(new Long(-1L));
125 assertEquals("CtfLocation: INVALID",fixture.toString()); //$NON-NLS-1$
126 }
127
128 /**
129 * Perform pre-test initialization.
130 *
131 * @generatedBy CodePro at 03/05/12 2:29 PM
132 */
133 @Before
134 public void setUp() {
135 // add additional set up code here
136 }
137
138 /**
139 * Perform post-test clean-up.
140 *
141 * @generatedBy CodePro at 03/05/12 2:29 PM
142 */
143 @After
144 public void tearDown() {
145 // Add additional tear down code here
146 }
147
148 /**
149 * Launch the test.
150 *
151 * @param args the command line arguments
152 *
153 * @generatedBy CodePro at 03/05/12 2:29 PM
154 */
155 public static void main(String[] args) {
156 new org.junit.runner.JUnitCore().run(CtfLocationTest.class);
157 }
158 }
This page took 0.041116 seconds and 6 git commands to generate.