use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.
the class CtfTmfExperimentTrimmingTest method setup.
/**
* Test setup
*/
@Before
public void setup() {
WaitUtils.waitForJobs();
SWTBotTreeItem tracesFolder = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME);
tracesFolder.contextMenu().menu("Open As Experiment...", "Generic Experiment").click();
SWTBotUtils.activateEditor(fBot, "Experiment");
SWTBotTreeItem project = SWTBotUtils.selectProject(fBot, PROJECT_NAME);
SWTBotTreeItem experimentItem = SWTBotUtils.getTraceProjectItem(fBot, project, "Experiments", "Experiment");
experimentItem.select();
TmfTraceManager traceManager = TmfTraceManager.getInstance();
ITmfTrace trace = traceManager.getActiveTrace();
assertTrue(String.valueOf(trace), trace instanceof TmfExperiment);
TmfExperiment experiment = (TmfExperiment) trace;
assertNotNull(experiment);
ITmfProjectModelElement elem = TmfProjectRegistry.findElement(experiment.getResource(), true);
assertTrue(elem instanceof TmfExperimentElement);
fOriginalExperiment = experiment;
TmfTimeRange traceCutRange = getTraceCutRange(experiment);
assertNotNull(traceCutRange);
fRequestedTraceCutRange = traceCutRange;
ITmfTimestamp requestedTraceCutEnd = traceCutRange.getEndTime();
ITmfTimestamp requestedTraceCutStart = traceCutRange.getStartTime();
assertTrue(experiment.getTimeRange().contains(traceCutRange));
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, requestedTraceCutStart, requestedTraceCutEnd, experiment));
experimentItem.contextMenu("Export Time Selection as New Trace...").click();
SWTBotShell shell = fBot.shell("Export trace section to...").activate();
SWTBot dialogBot = shell.bot();
assertEquals("Experiment", dialogBot.text().getText());
dialogBot.text().setText("Experiment-trimmed");
dialogBot.button("OK").click();
SWTBotEditor newExperiment = fBot.editorByTitle("Experiment-trimmed");
newExperiment.setFocus();
fNewExperiment = traceManager.getActiveTrace();
assertNotNull("No active trace", fNewExperiment);
assertEquals("Incorrect active trace", "Experiment-trimmed", fNewExperiment.getName());
WaitUtils.waitForJobs();
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.
the class TimeGraphViewTest method testZoomToSelection.
/**
* Test zoom to selection
*/
@Test
public void testZoomToSelection() {
resetTimeRange();
SWTBotTimeGraph timegraph = fTimeGraph;
TimeGraphViewStub view = getView();
timegraph.setFocus();
assertEquals(80, getDuration(view.getWindowRange()));
/* set selection to trace start time */
ITmfTimestamp selStartTime = TmfTimestamp.fromNanos(30L);
ITmfTimestamp selEndTime = TmfTimestamp.fromNanos(80L);
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, selStartTime, selEndTime));
timeGraphIsReadyCondition(new TmfTimeRange(selStartTime, selEndTime));
fireKeyInGraph(timegraph, 'z');
fViewBot.bot().waitUntil(new WindowRangeCondition(view, 50));
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.
the class XYChartViewTest method testZoomToSelection.
/**
* Test zoom to selection
*/
@Test
public void testZoomToSelection() {
SWTBotEclipseSwtChart xyChart = new SWTBotEclipseSwtChart(fViewBot.bot());
xyChart.setFocus();
assertEquals(80, fXyViewer.getWindowDuration());
/* set selection to trace start time */
ITmfTimestamp selStartTime = TmfTimestamp.fromNanos(30L);
ITmfTimestamp selEndTime = TmfTimestamp.fromNanos(80L);
TmfTimeRange range = new TmfTimeRange(selStartTime, selEndTime);
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, selStartTime, selEndTime));
// Wait till selection is finished
fViewBot.bot().waitUntil(new DefaultCondition() {
@Override
public boolean test() throws Exception {
return (fXyViewer.getSelectionEndTime() - fXyViewer.getSelectionBeginTime()) == getDuration(range);
}
@Override
public String getFailureMessage() {
return "SWT Chart is null";
}
});
fireKeyInGraph(xyChart, 'z');
fViewBot.bot().waitUntil(new SeriesCondition(fXyViewer, getDuration(range)));
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.
the class TmfUml2SDSyncLoaderSignalTest method setUpClass.
/**
* Initialization
*/
@BeforeClass
public static void setUpClass() {
fFacility = Uml2SDTestFacility.getInstance();
fFacility.init();
fFacility.selectExperiment();
range = new TmfTimeRange(new Uml2SDTestTimestamp(9789689220871L), new Uml2SDTestTimestamp(9789773881426L));
// Get range window for tests below
rangeWindow = (TmfTimestamp) range.getEndTime().getDelta(range.getStartTime());
TmfTimestamp currentTime = new Uml2SDTestTimestamp(9789773782043L);
fFacility.getTrace().broadcast(new TmfWindowRangeUpdatedSignal(fFacility, range));
fFacility.getTrace().broadcast(new TmfSelectionRangeUpdatedSignal(fFacility, currentTime));
fFacility.delay(IUml2SDTestConstants.BROADCAST_DELAY);
fTmfComponent = new Uml2SDSignalValidator();
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal in project tracecompass by tracecompass.
the class TmfUml2SDSyncLoaderTimeTest method verifySynchToTimeFirst.
/**
* Test Case: 007
* Description: Verify synchToTime (timestamp of first message in page)
* Verified Methods: loader.syncToTime(), loader.moveToMessage(), loader.moveToPage()
* Expected result: Move to correct page, selection of last message in page.
*/
@Test
public void verifySynchToTimeFirst() {
fFacility.getTrace().broadcast(new TmfSelectionRangeUpdatedSignal(this, TC_007_TIME_VALUE));
fFacility.getLoader().waitForCompletion();
fFacility.delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
assertEquals("synchToTime", TC_007_PAGE_VALUE, fFacility.getLoader().currentPage());
selection = fFacility.getSdView().getSDWidget().getSelection();
assertNotNull("synchToTime", selection);
msg = (TmfSyncMessage) selection.get(0);
assertEquals("synchToTime", 1, selection.size());
assertEquals("synchToTime", TC_007_START_OCCURRANCE, msg.getStartOccurrence());
assertEquals("synchToTime", TC_007_END_OCCURRANCE, msg.getEndOccurrence());
}
Aggregations