Search in sources :

Example 1 with CtfTestTrace

use of org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace in project tracecompass by tracecompass.

the class AbstractProviderTest method setUp.

// ------------------------------------------------------------------------
// Maintenance
// ------------------------------------------------------------------------
/**
 * Perform pre-class initialization.
 */
@Before
public void setUp() {
    CtfTestTrace testTrace = getTestTrace();
    LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(testTrace);
    fTrace = trace;
    fModule = new TestLttngCallStackModule();
    try {
        assertTrue(fModule.setTrace(trace));
    } catch (TmfAnalysisException e) {
        fail();
    }
    fModule.schedule();
    assertTrue(fModule.waitForCompletion());
    fSS = fModule.getStateSystem();
    assertNotNull(fSS);
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) TmfAnalysisException(org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException) CtfTestTrace(org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace) Before(org.junit.Before)

Example 2 with CtfTestTrace

use of org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace in project tracecompass by tracecompass.

the class MarkerSetSwtBotTest method setUp.

/**
 * Set up the test context and environment
 */
@BeforeClass
public static void setUp() {
    SWTBotUtils.initialize();
    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 10000;
    /* 10 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fBot = new SWTWorkbenchBot();
    SWTBotUtils.createProject(TRACE_PROJECT_NAME);
    WaitUtils.waitForJobs();
    final CtfTestTrace cygProfile = CtfTestTrace.CYG_PROFILE;
    LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(cygProfile);
    fStart = ((CtfTmfTrace) trace).getStartTime().toNanos();
    fFullRange = new TmfTimeRange(TmfTimestamp.fromNanos(fStart), TmfTimestamp.fromNanos(fStart + 100l));
    final File file = new File(trace.getPath());
    LttngUstTestTraceUtils.dispose(cygProfile);
    SWTBotUtils.openTrace(TRACE_PROJECT_NAME, file.getAbsolutePath(), UST_ID);
    SWTBotUtils.openView(FlameChartView.ID);
    fViewBot = fBot.viewByTitle("Flame Chart");
    WaitUtils.waitForJobs();
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) File(java.io.File) CtfTmfTrace(org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace) CtfTestTrace(org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace) BeforeClass(org.junit.BeforeClass)

Example 3 with CtfTestTrace

use of org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace in project tracecompass by tracecompass.

the class CtfTmfLostEventsTest method testNbEventsBug475007.

/**
 * Test that the number of events is reported correctly (a range of lost
 * events is counted as one event). Events could be wrongly counted as lost
 * events in certain situations.
 */
@Test
public void testNbEventsBug475007() {
    final CtfTestTrace tmfTestTrace = CtfTestTrace.DYNSCOPE;
    CtfTmfTrace trace = CtfTmfTestTraceUtils.getTrace(tmfTestTrace);
    trace.indexTrace(true);
    final long expectedReal = 100003;
    final long expectedLost = 1;
    EventCountRequest req = new EventCountRequest();
    trace.sendRequest(req);
    try {
        req.waitForCompletion();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    assertEquals(expectedReal, req.getReal());
    assertEquals(expectedLost, req.getLost());
    trace.dispose();
}
Also used : CtfTmfTrace(org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace) CtfTestTrace(org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace) Test(org.junit.Test)

Example 4 with CtfTestTrace

use of org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace in project tracecompass by tracecompass.

the class TraceReadAllTracesTest method getTracePaths.

/**
 * Get the list of traces
 *
 * @return the list of traces
 */
@Parameters(name = "{index}: {0}")
public static Iterable<Object[]> getTracePaths() {
    CtfTestTrace[] values = CtfTestTrace.values();
    List<Object[]> list = new ArrayList<>();
    for (CtfTestTrace value : values) {
        list.add(new Object[] { value.name(), value });
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) CtfTestTrace(org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace) Parameters(org.junit.runners.Parameterized.Parameters)

Example 5 with CtfTestTrace

use of org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace in project tracecompass by tracecompass.

the class FlameChartViewTest method beforeTest.

/**
 * Open a trace in an editor
 */
@Before
public void beforeTest() {
    SWTBotUtils.createProject(PROJECT_NAME);
    SWTBotTreeItem treeItem = SWTBotUtils.selectTracesFolder(sfBot, PROJECT_NAME);
    assertNotNull(treeItem);
    final CtfTestTrace cygProfile = CtfTestTrace.CYG_PROFILE;
    final File file = new File(CtfTmfTestTraceUtils.getTrace(cygProfile).getPath());
    CtfTmfTestTraceUtils.dispose(cygProfile);
    SWTBotUtils.openTrace(PROJECT_NAME, file.getAbsolutePath(), UST_ID);
    SWTBotUtils.activateEditor(sfBot, file.getName());
    SWTBotUtils.openView(FlameChartView.ID);
    WaitUtils.waitForJobs();
    final SWTBotView viewBot = sfBot.viewById(FlameChartView.ID);
    IWorkbenchPart part = viewBot.getViewReference().getPart(false);
    sfBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) part, new TmfTimeRange(START_TIME, START_TIME), START_TIME));
}
Also used : AbstractTimeGraphView(org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) File(java.io.File) CtfTestTrace(org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace) Before(org.junit.Before)

Aggregations

CtfTestTrace (org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace)5 File (java.io.File)2 LttngUstTrace (org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace)2 TmfTimeRange (org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange)2 CtfTmfTrace (org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace)2 Before (org.junit.Before)2 ArrayList (java.util.ArrayList)1 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)1 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)1 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)1 TmfAnalysisException (org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException)1 AbstractTimeGraphView (org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1 BeforeClass (org.junit.BeforeClass)1 Test (org.junit.Test)1 Parameters (org.junit.runners.Parameterized.Parameters)1