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

The following examples show how to use org.eclipse.swtbot.swt.finder.utils.FileUtils. These examples are extracted from open source projects. 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 Project: saros   Source File: RemoteBotEditor.java    License: 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
/**
 * 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
/**
 * 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);
}