use of org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal 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.TmfWindowRangeUpdatedSignal in project tracecompass by tracecompass.
the class TmfUml2SDSyncLoaderTimeTest method verifyTimeRangeSamePage.
/**
* Test Case: 008
* Description: Verify time range signal (start, end time and current time are in same page)
* Verified Methods: loader.synchToTimeRange(), loader.moveToMessage(), loader.moveToMessageInPage()
* Expected result: Move to correct page(=page of start time of range), set focus on start time of range, but no selection of message.
*/
@Test
public void verifyTimeRangeSamePage() {
// 9788.642228395 (page 0) -> 9789.164833324 (page 0) with selected time 9788.642228395 (page 0)
fFacility.getLoader().firstPage();
TmfTimeRange range = new TmfTimeRange(TC_008_START_TIME_VALUE, TC_008_END_TIME_VALUE);
fFacility.getLoader().waitForCompletion();
fFacility.delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
fFacility.getTrace().broadcast(new TmfWindowRangeUpdatedSignal(this, range));
assertEquals("synchToTimeRange", TC_008_PAGE_VALUE, fFacility.getLoader().currentPage());
assertNotNull("synchToTimeRange", fFacility.getLoader().getCurrentTime());
assertEquals("synchToTimeRange", 0, TC_008_TIME_VALUE.compareTo(fFacility.getLoader().getCurrentTime()));
selection = fFacility.getSdView().getSDWidget().getSelection();
// We actually don't want something to be selected!!!
assertNotNull("synchToTimeRange", selection);
assertEquals("synchToTimeRange", 0, selection.size());
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal in project tracecompass by tracecompass.
the class TmfUml2SDSyncLoader method moveToPage.
/**
* Moves to a certain page.
*
* @param notifyAll
* true to broadcast time range signal to other signal handlers
* else false
*/
protected void moveToPage(boolean notifyAll) {
TmfTimeRange window = null;
fLock.lock();
try {
// Safety check
if (fCurrentPage > fCheckPoints.size()) {
return;
}
window = fCheckPoints.get(fCurrentPage);
} finally {
fLock.unlock();
}
if (window == null) {
window = TmfTimeRange.ETERNITY;
}
fPageRequest = new TmfEventRequest(ITmfEvent.class, window, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.FOREGROUND) {
private final List<ITmfSyncSequenceDiagramEvent> fSdEvent = new ArrayList<>();
@Override
public void handleData(ITmfEvent event) {
super.handleData(event);
ITmfSyncSequenceDiagramEvent sdEvent = getSequenceDiagramEvent(event);
if (sdEvent != null) {
fSdEvent.add(sdEvent);
}
}
@Override
public void handleSuccess() {
fillCurrentPage(fSdEvent);
super.handleSuccess();
}
};
fTrace.sendRequest(fPageRequest);
if (notifyAll) {
TmfTimeRange timeRange = getSignalTimeRange(window.getStartTime());
broadcast(new TmfWindowRangeUpdatedSignal(this, timeRange, fTrace));
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal in project tracecompass by tracecompass.
the class TmfUml2SDSyncLoaderTimeTest method verifyTimeRangeDifferentPages.
/**
* Test Case: 009
* Description: Verify time range signal (start and end time are across 2 pages)
* Verified Methods: loader.synchToTimeRange(), loader.moveToMessage(), loader.moveToPage()
* Expected result: Move to correct page (=page of start time of range), set focus on start time of range, but no selection of message.
*/
@Test
public void verifyTimeRangeDifferentPages() {
TmfTimeRange range = new TmfTimeRange(TC_009_START_TIME_VALUE, TC_009_END_TIME_VALUE);
fFacility.getTrace().broadcast(new TmfWindowRangeUpdatedSignal(this, range));
fFacility.getLoader().waitForCompletion();
fFacility.delay(IUml2SDTestConstants.GUI_REFESH_DELAY);
assertEquals("synchToTimeRange", TC_009_PAGE_VALUE, fFacility.getLoader().currentPage());
assertNotNull("synchToTimeRange", fFacility.getLoader().getCurrentTime());
assertEquals("synchToTimeRange", 0, TC_009_TIME_VALUE.compareTo(fFacility.getLoader().getCurrentTime()));
selection = fFacility.getSdView().getSDWidget().getSelection();
// We actually don't want something to be selected!!!
assertNotNull("synchToTimeRange", selection);
assertEquals("synchToTimeRange", 0, selection.size());
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal in project tracecompass by tracecompass.
the class ResourcesViewTest method testFilter.
/**
* Test the filter
*/
@Test
public void testFilter() {
/* change window range to 1 ms */
TmfTimeRange range = new TmfTimeRange(START_TIME, START_TIME.normalize(1000000L, ITmfTimestamp.NANOSECOND_SCALE));
TmfSignalManager.dispatchSignal(new TmfWindowRangeUpdatedSignal(this, range));
timeGraphIsReadyCondition(new TmfTimeRange(START_TIME, START_TIME), START_TIME);
SWTBotToolbarButton filterButton = getViewBot().toolbarButton("Show View Filters");
filterButton.click();
SWTBot bot = fBot.shell("Filter").activate().bot();
/*
* The filtered tree initialization triggers a delayed refresh job that can
* interfere with the tree selection. Wait for new refresh jobs to avoid this.
*/
SWTBotTree treeBot = bot.tree();
// set filter text
SWTBotTreeItem treeItem = treeBot.getTreeItem(LttngTraceGenerator.getName());
bot.text().setText("24");
fBot.waitUntil(ConditionHelpers.treeItemCount(treeItem, 2));
// clear filter text
bot.text().setText(LttngTraceGenerator.getName());
fBot.waitUntil(ConditionHelpers.treeItemCount(treeItem, 75));
// get how many items there are
int checked = SWTBotUtils.getTreeCheckedItemCount(treeBot);
assertEquals("default", 76, checked);
// test "uncheck all button"
bot.button(UNCHECK_ALL).click();
checked = SWTBotUtils.getTreeCheckedItemCount(treeBot);
assertEquals(0, checked);
// test check all
bot.button(CHECK_ALL).click();
checked = SWTBotUtils.getTreeCheckedItemCount(treeBot);
assertEquals(CHECK_ALL, 76, checked);
// test uncheck inactive
treeBot.getTreeItem(LttngTraceGenerator.getName()).select("CPU 1 States");
bot.button(UNCHECK_ALL).click();
bot.button(CHECK_SELECTED).click();
checked = SWTBotUtils.getTreeCheckedItemCount(treeBot);
assertEquals(CHECK_SELECTED, 2, checked);
// test check subtree
bot.button(UNCHECK_ALL).click();
bot.button(CHECK_SUBTREE).click();
checked = SWTBotUtils.getTreeCheckedItemCount(treeBot);
assertEquals(CHECK_SUBTREE, 2, checked);
// test uncheck selected
bot.button(CHECK_ALL).click();
bot.button(UNCHECK_SELECTED).click();
checked = SWTBotUtils.getTreeCheckedItemCount(treeBot);
assertEquals(UNCHECK_SELECTED, 75, checked);
// test uncheck subtree
bot.button(CHECK_ALL).click();
bot.button(UNCHECK_SUBTREE).click();
checked = SWTBotUtils.getTreeCheckedItemCount(treeBot);
assertEquals(UNCHECK_SELECTED, 75, checked);
// test filter
bot.button(UNCHECK_ALL).click();
checked = SWTBotUtils.getTreeCheckedItemCount(treeBot);
assertEquals(0, checked);
bot.text().setText("CPU 2");
fBot.waitUntil(ConditionHelpers.treeItemCount(treeItem, 75));
bot.button(CHECK_ALL).click();
checked = SWTBotUtils.getTreeCheckedItemCount(treeBot);
assertEquals("Filtered", 76, checked);
bot.button("OK").click();
}
Aggregations