Commit | Line | Data |
---|---|---|
06b9339e | 1 | /********************************************************************** |
533d0bc3 | 2 | * Copyright (c) 2012, 2015 Ericsson |
cfdb727a | 3 | * |
06b9339e BH |
4 | * All rights reserved. This program and the accompanying materials are |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
cfdb727a AM |
8 | * |
9 | * Contributors: | |
06b9339e | 10 | * Bernd Hufmann - Initial API and implementation |
2ba3d0a1 | 11 | * Alexandre Montplaisir - Port to JUnit4 |
b732adaa | 12 | * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE |
06b9339e | 13 | **********************************************************************/ |
2ba3d0a1 | 14 | |
9bc60be7 | 15 | package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component; |
06b9339e | 16 | |
b732adaa MS |
17 | import static org.junit.Assert.assertEquals; |
18 | import static org.junit.Assert.assertFalse; | |
19 | import static org.junit.Assert.assertNotNull; | |
20 | import static org.junit.Assert.assertNull; | |
21 | import static org.junit.Assert.assertTrue; | |
2ba3d0a1 | 22 | |
d132bcc7 BH |
23 | import java.io.File; |
24 | import java.net.URL; | |
25 | ||
d132bcc7 BH |
26 | import org.eclipse.core.runtime.FileLocator; |
27 | import org.eclipse.core.runtime.Path; | |
b732adaa | 28 | import org.eclipse.remote.core.IRemoteConnection; |
9bc60be7 AM |
29 | import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo; |
30 | import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState; | |
31 | import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement; | |
32 | import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType; | |
33 | import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel; | |
34 | import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState; | |
35 | import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.BufferType; | |
36 | import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy; | |
37 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent; | |
38 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.BaseEventComponent; | |
39 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent; | |
40 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent; | |
41 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent; | |
42 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent; | |
43 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent; | |
44 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent; | |
45 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent; | |
46 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.UstProviderComponent; | |
47 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.BaseEventPropertySource; | |
48 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.KernelProviderPropertySource; | |
49 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TargetNodePropertySource; | |
50 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TraceChannelPropertySource; | |
51 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TraceDomainPropertySource; | |
52 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TraceEventPropertySource; | |
53 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TraceProbeEventPropertySource; | |
54 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TraceSessionPropertySource; | |
55 | import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.UstProviderPropertySource; | |
b6b4e8b4 | 56 | import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory; |
06b9339e BH |
57 | import org.eclipse.ui.views.properties.IPropertySource; |
58 | import org.junit.After; | |
13f36900 | 59 | import org.junit.Before; |
2ba3d0a1 | 60 | import org.junit.Test; |
9269df72 | 61 | import org.osgi.framework.FrameworkUtil; |
06b9339e BH |
62 | |
63 | /** | |
2ba3d0a1 AM |
64 | * The class <code>TraceControlPropertiesTest</code> contains tests for the all |
65 | * property class</code>. | |
06b9339e | 66 | */ |
2ba3d0a1 | 67 | public class TraceControlPropertiesTest { |
d132bcc7 BH |
68 | |
69 | // ------------------------------------------------------------------------ | |
70 | // Constants | |
71 | // ------------------------------------------------------------------------ | |
2ba3d0a1 | 72 | |
13f36900 | 73 | private TraceControlTestFacility fFacility; |
d132bcc7 BH |
74 | private static final String DIRECTORY = "testfiles"; |
75 | private static final String TEST_STREAM = "ListInfoTest.cfg"; | |
76 | private static final String SCEN_LIST_INFO_TEST = "ListInfoTest"; | |
77 | ||
06b9339e BH |
78 | // ------------------------------------------------------------------------ |
79 | // Housekeeping | |
80 | // ------------------------------------------------------------------------ | |
81 | ||
13f36900 BH |
82 | /** |
83 | * Perform pre-test initialization. | |
84 | */ | |
85 | @Before | |
86 | public void setUp() { | |
87 | fFacility = TraceControlTestFacility.getInstance(); | |
88 | fFacility.init(); | |
89 | } | |
90 | ||
06b9339e BH |
91 | /** |
92 | * Perform post-test clean-up. | |
06b9339e | 93 | */ |
06b9339e | 94 | @After |
2ba3d0a1 | 95 | public void tearDown() { |
13f36900 | 96 | fFacility.dispose(); |
06b9339e | 97 | } |
cfdb727a | 98 | |
06b9339e BH |
99 | /** |
100 | * Run the TraceControlComponent. | |
cfdb727a AM |
101 | * |
102 | * @throws Exception | |
103 | * This will fail the test | |
06b9339e | 104 | */ |
2ba3d0a1 | 105 | @Test |
a26d90be | 106 | public void testComponentProperties() throws Exception { |
b6b4e8b4 | 107 | IRemoteConnection host = TmfRemoteConnectionFactory.getLocalConnection(); |
d8a4fd60 | 108 | TestRemoteSystemProxy proxy = new TestRemoteSystemProxy(host); |
06b9339e | 109 | |
9269df72 | 110 | URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(DIRECTORY + File.separator + TEST_STREAM), null); |
d132bcc7 BH |
111 | File testfile = new File(FileLocator.toFileURL(location).toURI()); |
112 | proxy.setTestFile(testfile.getAbsolutePath()); | |
113 | proxy.setScenario(SCEN_LIST_INFO_TEST); | |
cfdb727a | 114 | |
13f36900 | 115 | ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot(); |
06b9339e | 116 | |
d8a4fd60 | 117 | TargetNodeComponent node = new TargetNodeComponent("myNode", root, proxy); |
06b9339e BH |
118 | |
119 | root.addChild(node); | |
120 | node.connect(); | |
121 | ||
13f36900 BH |
122 | fFacility.waitForConnect(node); |
123 | fFacility.waitForJobs(); | |
06b9339e BH |
124 | |
125 | // ------------------------------------------------------------------------ | |
126 | // Verify Node Properties (adapter) | |
127 | // ------------------------------------------------------------------------ | |
128 | Object adapter = node.getAdapter(IPropertySource.class); | |
129 | assertNotNull(adapter); | |
130 | assertTrue(adapter instanceof TargetNodePropertySource); | |
131 | ||
132 | TargetNodePropertySource source = (TargetNodePropertySource)adapter; | |
133 | ||
134 | assertNull(source.getEditableValue()); | |
135 | assertFalse(source.isPropertySet(TargetNodePropertySource.TARGET_NODE_NAME_PROPERTY_ID)); | |
136 | assertNotNull(source.getPropertyDescriptors()); | |
137 | ||
138 | assertEquals("myNode", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_NAME_PROPERTY_ID)); | |
f5d0f2fb BH |
139 | // Don't check the address property because the string can vary on the machine the test is running |
140 | // assertEquals("localhost", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_ADDRESS_PROPERTY_ID)); | |
06b9339e | 141 | assertEquals(TargetNodeState.CONNECTED.name(), source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_STATE_PROPERTY_ID)); |
6f40b641 | 142 | assertEquals("2.5.0", source.getPropertyValue(TargetNodePropertySource.TARGET_NODE_VERSION_PROPERTY_ID)); |
06b9339e BH |
143 | assertNull(source.getPropertyValue("test")); |
144 | ||
145 | adapter = node.getAdapter(IChannelInfo.class); | |
146 | assertNull(adapter); | |
cfdb727a | 147 | |
06b9339e BH |
148 | ITraceControlComponent[] groups = node.getChildren(); |
149 | assertNotNull(groups); | |
150 | assertEquals(2, groups.length); | |
cfdb727a | 151 | |
06b9339e BH |
152 | ITraceControlComponent[] providers = groups[0].getChildren(); |
153 | ||
154 | assertNotNull(providers); | |
155 | assertEquals(3, providers.length); | |
156 | ||
157 | // ------------------------------------------------------------------------ | |
158 | // Verify Kernel Provider Properties (adapter) | |
159 | // ------------------------------------------------------------------------ | |
160 | KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0]; | |
cfdb727a | 161 | |
06b9339e BH |
162 | adapter = kernelProvider.getAdapter(IPropertySource.class); |
163 | assertNotNull(adapter); | |
164 | assertTrue(adapter instanceof KernelProviderPropertySource); | |
165 | ||
166 | KernelProviderPropertySource kernelSource = (KernelProviderPropertySource)adapter; | |
167 | assertNotNull(kernelSource.getPropertyDescriptors()); | |
168 | ||
169 | assertEquals("Kernel", kernelSource.getPropertyValue(KernelProviderPropertySource.KERNEL_PROVIDER_NAME_PROPERTY_ID)); | |
170 | ||
171 | // ------------------------------------------------------------------------ | |
172 | // Verify UST Provider Properties (adapter) | |
173 | // ------------------------------------------------------------------------ | |
174 | UstProviderComponent ustProvider = (UstProviderComponent) providers[1]; | |
cfdb727a | 175 | |
06b9339e BH |
176 | adapter = ustProvider.getAdapter(IPropertySource.class); |
177 | assertNotNull(adapter); | |
178 | assertTrue(adapter instanceof UstProviderPropertySource); | |
179 | ||
180 | UstProviderPropertySource ustSource = (UstProviderPropertySource)adapter; | |
181 | assertNotNull(ustSource.getPropertyDescriptors()); | |
182 | ||
2e74131b | 183 | assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=9379]", ustSource.getPropertyValue(UstProviderPropertySource.UST_PROVIDER_NAME_PROPERTY_ID)); |
06b9339e BH |
184 | assertEquals(String.valueOf(9379), ustSource.getPropertyValue(UstProviderPropertySource.UST_PROVIDER_PID_PROPERTY_ID)); |
185 | ||
186 | // ------------------------------------------------------------------------ | |
187 | // Verify Base Event Properties (adapter) | |
188 | // ------------------------------------------------------------------------ | |
189 | ITraceControlComponent[] events = ustProvider.getChildren(); | |
190 | assertNotNull(events); | |
191 | assertEquals(2, events.length); | |
192 | ||
193 | BaseEventComponent baseEventInfo = (BaseEventComponent) events[0]; | |
194 | assertNotNull(baseEventInfo); | |
cfdb727a | 195 | |
06b9339e BH |
196 | adapter = baseEventInfo.getAdapter(IPropertySource.class); |
197 | assertNotNull(adapter); | |
198 | assertTrue(adapter instanceof BaseEventPropertySource); | |
199 | ||
200 | BaseEventPropertySource baseSource = (BaseEventPropertySource)adapter; | |
201 | assertNotNull(baseSource.getPropertyDescriptors()); | |
202 | ||
203 | assertEquals("ust_tests_hello:tptest_sighandler", baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_NAME_PROPERTY_ID)); | |
204 | assertEquals(TraceEventType.TRACEPOINT.name(), baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_TYPE_PROPERTY_ID)); | |
4775bcbf | 205 | assertEquals(TraceLogLevel.TRACE_DEBUG_MODULE.name(), baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_LOGLEVEL_PROPERTY_ID)); |
06b9339e | 206 | |
d4514365 BH |
207 | baseEventInfo = (BaseEventComponent) events[1]; |
208 | assertNotNull(baseEventInfo); | |
209 | ||
210 | adapter = baseEventInfo.getAdapter(IPropertySource.class); | |
211 | assertNotNull(adapter); | |
212 | assertTrue(adapter instanceof BaseEventPropertySource); | |
213 | baseSource = (BaseEventPropertySource)adapter; | |
214 | assertNotNull(baseSource.getPropertyDescriptors()); | |
215 | assertEquals("doublefield=float;floatfield=float;stringfield=string", baseSource.getPropertyValue(BaseEventPropertySource.BASE_EVENT_FIELDS_PROPERTY_ID)); | |
216 | ||
06b9339e BH |
217 | // ------------------------------------------------------------------------ |
218 | // Verify Session Properties (adapter) | |
219 | // ------------------------------------------------------------------------ | |
220 | ITraceControlComponent[] sessions = groups[1].getChildren(); | |
221 | assertNotNull(sessions); | |
222 | assertEquals(2, sessions.length); | |
223 | ||
224 | TraceSessionComponent session = (TraceSessionComponent)sessions[1]; | |
225 | ||
226 | adapter = session.getAdapter(IPropertySource.class); | |
227 | assertNotNull(adapter); | |
228 | assertTrue(adapter instanceof TraceSessionPropertySource); | |
229 | ||
230 | TraceSessionPropertySource sessionSource = (TraceSessionPropertySource)adapter; | |
231 | assertNotNull(sessionSource.getPropertyDescriptors()); | |
232 | ||
233 | assertEquals("mysession", sessionSource.getPropertyValue(TraceSessionPropertySource.TRACE_SESSION_NAME_PROPERTY_ID)); | |
234 | assertEquals("/home/user/lttng-traces/mysession-20120129-084256", sessionSource.getPropertyValue(TraceSessionPropertySource.TRACE_SESSION_PATH_PROPERTY_ID)); | |
235 | assertEquals(TraceSessionState.ACTIVE.name(), sessionSource.getPropertyValue(TraceSessionPropertySource.TRACE_SESSION_STATE_PROPERTY_ID)); | |
236 | ||
237 | // ------------------------------------------------------------------------ | |
238 | // Verify Domain Provider Properties (adapter) | |
239 | // ------------------------------------------------------------------------ | |
240 | ITraceControlComponent[] domains = session.getChildren(); | |
241 | assertNotNull(domains); | |
242 | assertEquals(2, domains.length); | |
243 | ||
244 | TraceDomainComponent domain = (TraceDomainComponent) domains[0]; | |
245 | adapter = domain.getAdapter(IPropertySource.class); | |
246 | assertNotNull(adapter); | |
247 | assertTrue(adapter instanceof TraceDomainPropertySource); | |
248 | ||
249 | TraceDomainPropertySource domainSource = (TraceDomainPropertySource)adapter; | |
250 | assertNotNull(domainSource.getPropertyDescriptors()); | |
251 | ||
252 | assertEquals("Kernel", domainSource.getPropertyValue(TraceDomainPropertySource.TRACE_DOMAIN_NAME_PROPERTY_ID)); | |
83051fc3 | 253 | assertEquals(BufferType.BUFFER_SHARED.getInName(), domainSource.getPropertyValue(TraceDomainPropertySource.BUFFER_TYPE_PROPERTY_ID)); |
cfdb727a | 254 | |
06b9339e BH |
255 | ITraceControlComponent[] channels = domains[0].getChildren(); |
256 | assertNotNull(channels); | |
257 | assertEquals(2, channels.length); | |
258 | ||
259 | // ------------------------------------------------------------------------ | |
260 | // Verify Channel Properties (adapter) | |
261 | // ------------------------------------------------------------------------ | |
262 | assertTrue(channels[0] instanceof TraceChannelComponent); | |
263 | TraceChannelComponent channel = (TraceChannelComponent) channels[0]; | |
cfdb727a | 264 | |
06b9339e BH |
265 | adapter = channel.getAdapter(IPropertySource.class); |
266 | assertNotNull(adapter); | |
267 | assertTrue(adapter instanceof TraceChannelPropertySource); | |
268 | ||
269 | TraceChannelPropertySource channelSource = (TraceChannelPropertySource)adapter; | |
270 | assertNotNull(channelSource.getPropertyDescriptors()); | |
271 | ||
272 | assertEquals("channel0", channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_NAME_PROPERTY_ID)); | |
273 | assertEquals(String.valueOf(4), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID)); | |
274 | assertEquals(TraceEnablement.ENABLED.name(), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_STATE_PROPERTY_ID)); | |
275 | assertEquals(String.valueOf(false), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID)); | |
276 | assertEquals("splice()", channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID)); | |
277 | assertEquals(String.valueOf(200), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_READ_TIMER_PROPERTY_ID)); | |
278 | assertEquals(String.valueOf(262144), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID)); | |
279 | assertEquals(String.valueOf(0), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID)); | |
6f40b641 BH |
280 | assertEquals(Integer.valueOf(2), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_ID)); |
281 | assertEquals(Long.valueOf(262144), channelSource.getPropertyValue(TraceChannelPropertySource.TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_ID)); | |
cfdb727a | 282 | |
06b9339e BH |
283 | // ------------------------------------------------------------------------ |
284 | // Verify Event Properties (adapter) | |
285 | // ------------------------------------------------------------------------ | |
286 | ITraceControlComponent[] channel0Events = channel.getChildren(); | |
287 | assertNotNull(channel0Events); | |
d132bcc7 | 288 | assertEquals(5, channel0Events.length); |
06b9339e | 289 | assertTrue(channel0Events[0] instanceof TraceEventComponent); |
cfdb727a | 290 | |
06b9339e | 291 | TraceEventComponent event = (TraceEventComponent) channel0Events[0]; |
cfdb727a | 292 | |
06b9339e BH |
293 | adapter = event.getAdapter(IPropertySource.class); |
294 | assertNotNull(adapter); | |
295 | assertTrue(adapter instanceof TraceEventPropertySource); | |
296 | ||
297 | TraceEventPropertySource eventSource = (TraceEventPropertySource)adapter; | |
298 | assertNotNull(eventSource.getPropertyDescriptors()); | |
cfdb727a | 299 | |
06b9339e BH |
300 | assertEquals("block_rq_remap", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID)); |
301 | assertEquals(TraceLogLevel.TRACE_EMERG.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); | |
302 | assertEquals(TraceEventType.TRACEPOINT.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID)); | |
303 | assertEquals(TraceEnablement.ENABLED.name(), eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID)); | |
cfdb727a | 304 | |
d132bcc7 BH |
305 | // ------------------------------------------------------------------------ |
306 | // Verify Probe Event Properties (adapter) | |
307 | // ------------------------------------------------------------------------ | |
308 | assertTrue(channel0Events[2] instanceof TraceProbeEventComponent); | |
cfdb727a | 309 | |
d132bcc7 | 310 | TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[2]; |
cfdb727a | 311 | |
d132bcc7 BH |
312 | adapter = probeEvent.getAdapter(IPropertySource.class); |
313 | assertNotNull(adapter); | |
314 | assertTrue(adapter instanceof TraceProbeEventPropertySource); | |
315 | ||
316 | TraceProbeEventPropertySource probeEventSource = (TraceProbeEventPropertySource)adapter; | |
317 | assertNotNull(probeEventSource.getPropertyDescriptors()); | |
318 | assertEquals(4, probeEventSource.getPropertyDescriptors().length); | |
cfdb727a | 319 | |
d132bcc7 BH |
320 | assertEquals("myevent2", probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID)); |
321 | assertEquals(TraceEventType.PROBE.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID)); | |
322 | assertEquals(TraceEnablement.ENABLED.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID)); | |
323 | assertEquals("0xc0101340", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID)); | |
cfdb727a | 324 | |
d132bcc7 | 325 | assertTrue(channel0Events[3] instanceof TraceProbeEventComponent); |
cfdb727a | 326 | |
d132bcc7 | 327 | probeEvent = (TraceProbeEventComponent) channel0Events[3]; |
cfdb727a | 328 | |
d132bcc7 BH |
329 | adapter = probeEvent.getAdapter(IPropertySource.class); |
330 | assertNotNull(adapter); | |
331 | assertTrue(adapter instanceof TraceProbeEventPropertySource); | |
332 | ||
333 | probeEventSource = (TraceProbeEventPropertySource)adapter; | |
334 | assertNotNull(probeEventSource.getPropertyDescriptors()); | |
335 | assertEquals(5, probeEventSource.getPropertyDescriptors().length); | |
cfdb727a | 336 | |
d132bcc7 BH |
337 | assertEquals("myevent0", probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_NAME_PROPERTY_ID)); |
338 | assertEquals(TraceEventType.PROBE.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_TYPE_PROPERTY_ID)); | |
339 | assertEquals(TraceEnablement.ENABLED.name(), probeEventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_STATE_PROPERTY_ID)); | |
340 | assertEquals("0x0", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID)); | |
341 | assertEquals("init_post", probeEventSource.getPropertyValue(TraceProbeEventPropertySource.TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID)); | |
cfdb727a | 342 | |
d4514365 BH |
343 | //------------------------------------------------------------------------- |
344 | // Verify Filter of UST event | |
345 | //------------------------------------------------------------------------- | |
346 | event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[0]; | |
347 | adapter = event.getAdapter(IPropertySource.class); | |
348 | assertEquals("with filter", event.getFilterExpression()); | |
349 | ||
54f2dcc0 BH |
350 | //------------------------------------------------------------------------- |
351 | // Verify Log Level Type of UST events (> LTTng 2.4) | |
352 | //------------------------------------------------------------------------- | |
353 | event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[0]; | |
354 | adapter = event.getAdapter(IPropertySource.class); | |
202956f1 | 355 | assertNotNull(adapter); |
54f2dcc0 BH |
356 | eventSource = (TraceEventPropertySource) adapter; |
357 | assertEquals("== TRACE_DEBUG_LINE", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); | |
358 | ||
359 | event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[1]; | |
360 | adapter = event.getAdapter(IPropertySource.class); | |
202956f1 | 361 | assertNotNull(adapter); |
54f2dcc0 BH |
362 | eventSource = (TraceEventPropertySource) adapter; |
363 | assertEquals("<= TRACE_INFO", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); | |
364 | ||
365 | event = (TraceEventComponent) domains[1].getChildren()[1].getChildren()[2]; | |
366 | adapter = event.getAdapter(IPropertySource.class); | |
202956f1 | 367 | assertNotNull(adapter); |
54f2dcc0 BH |
368 | eventSource = (TraceEventPropertySource) adapter; |
369 | assertEquals("TRACE_DEBUG_SYSTEM", eventSource.getPropertyValue(TraceEventPropertySource.TRACE_EVENT_LOGLEVEL_PROPERTY_ID)); | |
370 | ||
a26d90be BH |
371 | //------------------------------------------------------------------------- |
372 | // Delete node | |
373 | //------------------------------------------------------------------------- | |
374 | node.disconnect(); | |
375 | node.getParent().removeChild(node); | |
06b9339e | 376 | } |
f3b33d40 | 377 | } |