* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Geneviève Bastien - Initial API and implementation
*******************************************************************************/
package org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysisModule;
import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelTidAspect;
-import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.ThreadPriorityAspect;
import org.eclipse.tracecompass.analysis.os.linux.core.tests.Activator;
import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.trace.TmfXmlKernelTraceStub;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
-import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
import org.eclipse.tracecompass.tmf.core.trace.ITmfContext;
import org.junit.Before;
import org.junit.Test;
-import com.google.common.collect.ImmutableSet;
-
/**
* Test the {@link KernelTidAspect} class
*
// Test trace class definition
// ------------------------------------------------------------------------
- private static class TmfXmlTraceStubWithTidAspects extends TmfXmlKernelTraceStub {
-
- public TmfXmlTraceStubWithTidAspects() {
- super();
- }
-
- @Override
- public Iterable<ITmfEventAspect> getEventAspects() {
- ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder();
- builder.addAll(super.getEventAspects());
- builder.add(KernelTidAspect.INSTANCE);
- builder.add(ThreadPriorityAspect.INSTANCE);
- return NonNullUtils.checkNotNull(builder.build());
- }
-
- }
-
private ITmfTrace fTrace;
private static void deleteSuppFiles(ITmfTrace trace) {
*/
@Before
public void setUp() {
- ITmfTrace trace = new TmfXmlTraceStubWithTidAspects();
+ ITmfTrace trace = new TmfXmlKernelTraceStub();
IPath filePath = Activator.getAbsoluteFilePath(LTTNG_KERNEL_FILE);
IStatus status = trace.validate(null, filePath.toOSString());
if (!status.isOK()) {
package org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.trace;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelTidAspect;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.ThreadPriorityAspect;
import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
+import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
import org.eclipse.tracecompass.tmf.tests.stubs.trace.xml.TmfXmlTraceStub;
+import com.google.common.collect.ImmutableSet;
+
/**
* A trace stub that implements a kernel trace. It can add an event layout to
* the trace.
fLayout = layout;
}
+ @Override
+ public Iterable<ITmfEventAspect> getEventAspects() {
+ /*
+ * This method needs to fill the aspects dynamically because aspects in
+ * the parent class are not all present at the beginning of the trace
+ */
+ ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder();
+ builder.addAll(super.getEventAspects());
+ builder.add(KernelTidAspect.INSTANCE);
+ builder.add(ThreadPriorityAspect.INSTANCE);
+ return builder.build();
+ }
+
}