org.eclipse.swtbot.swt.finder.utils.FileUtils Java Examples

The following examples show how to use org.eclipse.swtbot.swt.finder.utils.FileUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RemoteBotEditor.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void setTextFromFile(String contentPath) throws RemoteException {
  String contents = FileUtils.read(Platform.getBundle("saros.stf").getEntry(contentPath));
  widget.setText(contents);
}
 
Example #2
Source File: XYDataProviderBaseTest.java    From tracecompass with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Based on a SWT Chart, we check if data shown is valid with a JSON file.
 * Comparison with the main series and other series if exists
 *
 * @param chart
 *            A SWT Chart
 * @param otherSeries
 *            An array of other series name to check other than the main series
 * @param expectedJson
 *            The path of the JSON file relative to this class's bundle
 * @return True if the serialized chart data matches the JSON file content
 */
protected boolean isChartDataValid(final Chart chart, String expectedJson, String... otherSeries) {
    /**
     * FIXME : Once CQ for Jackson is approved, use deserialization instead of
     * comparing strings
     */
    String expected = FileUtils.read(getFullPath(expectedJson));
    TmfCommonXAxisModel model = extractModelFromChart(chart, otherSeries);
    String current = fGson.toJson(model);
    return expected.equals(current);
}
 
Example #3
Source File: XYDataProviderBaseTest.java    From tracecompass with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Based on a SWT Chart, we check if data shown is valid with a JSON file.
 * Comparison with the main series and other series if exists
 *
 * @param chart
 *            A SWT Chart
 * @param otherSeries
 *            An array of other series name to check other than the main series
 * @param expectedJson
 *            The path of the JSON file relative to this class's bundle
 * @return True if the serialized chart data matches the JSON file content
 */
protected boolean isChartDataValid(final Chart chart, String expectedJson, String... otherSeries) {
    /**
     * FIXME : Once CQ for Jackson is approved, use deserialization instead of
     * comparing strings
     */
    String expected = FileUtils.read(getFullPath(expectedJson));
    TmfCommonXAxisModel model = extractModelFromChart(chart, otherSeries);
    String current = fGson.toJson(model);
    current = current.replaceAll("\\(Legacy\\)", "View");
    return expected.equals(current);
}